From 09fd2cb2a4364ce69982617062bd17d48c3cebf4 Mon Sep 17 00:00:00 2001 From: Erik Brakkee Date: Fri, 22 Nov 2024 21:50:28 +0100 Subject: [PATCH] simple testcase names --- cmd/go2junit/go2junit.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/go2junit/go2junit.go b/cmd/go2junit/go2junit.go index 57572f2..1125ab9 100644 --- a/cmd/go2junit/go2junit.go +++ b/cmd/go2junit/go2junit.go @@ -7,6 +7,7 @@ import ( "fmt" "os" "path/filepath" + "strings" ) func (t *Test) MarshalXML(e *xml.Encoder, start xml.StartElement) error { @@ -28,8 +29,9 @@ func (t *Test) MarshalXML(e *xml.Encoder, start xml.StartElement) error { Message: "failed", } } + parts := strings.Split(t.Name, "/") tc := Testcase{ - Name: t.Name, + Name: parts[len(parts)-1], // parent class name Classname: classname, Time: t.Time,