Commits

Miki Tebeka committed 0b83cf9

PASSing suites and Test_Multi

  • Participants
  • Parent commits 8712ba2

Comments (0)

Files changed (4)

File data/gotest-multi.out

+?       alipay  [no test files]
+?       config  [no test files]
+=== RUN TestApp_AssetPath
+--- PASS: TestApp_AssetPath (0.00 seconds)
+=== RUN TestTrimTransferCeil
+--- PASS: TestTrimTransferCeil (0.00 seconds)
+=== RUN TestStatusDescription
+--- PASS: TestStatusDescription (0.00 seconds)
+=== RUN TestCode
+--- PASS: TestCode (0.00 seconds)
+PASS
+ok      controllers 0.024s
+?       controllers/api [no test files]
+?       controllers/bucket  [no test files]
+?       mail    [no test files]
+?       models  [no test files]
+?       plugins [no test files]
+?       templatefunc    [no test files]
+?       utils   [no test files]
+?       website [no test files]

File data/gotest.out

 FAIL	_/home/miki/Projects/goroot/src/xunit	0.004s
 === RUN TestAdd
 --- PASS: TestAdd (0.00 seconds)
-ok  	_/home/miki/Projects/goroot/src/anotherTest	0.000s
+ok  	_/home/miki/Projects/goroot/src/anotherTest	0.000s
+PASS
 )
 
 const (
-	version = "0.2.3"
+	version = "0.2.4"
 
 	// gotest regular expressions
 
 
 type TestResults struct {
 	Suites []*Suite
-	Multi bool
+	Multi  bool
 }
 
 func (suite *Suite) NumFailed() int {
 			continue
 		}
 
-		if is_exit(line) || (line == "FAIL") {
+		if is_exit(line) || (line == "FAIL") || (line == "PASS") {
 			continue
 		}
 
 func writeXML(suites []*Suite, out io.Writer, bamboo bool) {
 	testsResult := TestResults{
 		Suites: suites,
-		Multi: bamboo || (len(suites) > 1),
+		Multi:  bamboo || (len(suites) > 1),
 	}
 	t := template.New("test template")
 	t, err := t.Parse(xmlTemplate)

File go2xunit_test.go

 		t.Fatalf("bad number of suites. expected %d got %d", count, len(suites))
 	}
 }
+
+func Test_Multi(t *testing.T) {
+	filename := "data/gotest-multi.out"
+	suites, err := loadGotest(filename, t)
+	if err != nil {
+		t.Fatalf("error loading %s - %s", filename, err)
+	}
+
+	count := 1
+	if len(suites) != count {
+		t.Fatalf("bad number of suites. expected %d got %d", count, len(suites))
+	}
+}