diff options
Diffstat (limited to 'adapters/gtest/executable.go')
-rw-r--r-- | adapters/gtest/executable.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/adapters/gtest/executable.go b/adapters/gtest/executable.go index 78b0b56..25c83c1 100644 --- a/adapters/gtest/executable.go +++ b/adapters/gtest/executable.go @@ -27,7 +27,7 @@ func createExecutables(tcs []planr.TestCase) []executable { for _, tc := range tcs { cfg := tc.AdapterConfig().(*Config) - file := *cfg.Testfile + file := cfg.Testfile exe, contained := exes[file] // For set comparison @@ -55,7 +55,7 @@ func createExecutables(tcs []planr.TestCase) []executable { if !reflect.DeepEqual(exe.srcs, cfg.Srcs) { log.Fatalf( "Two test case definitions %s and %s have different lists of sources", - exe.testpath, *cfg.Testfile, + exe.testpath, cfg.Testfile, ) } @@ -119,12 +119,12 @@ func runGtest(exe string, tc planr.TestCase, builddir string) planr.TestResult { log.Fatal(err) } - timeout := time.Duration(*cfg.Timeout) * time.Millisecond + timeout := time.Duration(cfg.Timeout) * time.Millisecond ctx, cancel := context.WithTimeout(context.Background(), timeout) jsonFlag := "--gtest_output=json:" + f.Name() - testFlag := "--gtest_filter=" + *cfg.Suite + "." + *cfg.Name + testFlag := "--gtest_filter=" + cfg.Suite + "." + cfg.Name cmd := exec.CommandContext(ctx, exePath, jsonFlag, testFlag) @@ -151,14 +151,13 @@ func runGtest(exe string, tc planr.TestCase, builddir string) planr.TestResult { log.Fatalf( "Could not find testcase %s with name=\"%s\" and suite=\"%s\". Does such a test exist in the test source?", tc.Cname, - *cfg.Name, - *cfg.Suite, + cfg.Name, + cfg.Suite, ) } - // TODO: Cleanup -- ZERO TESTS? if len(results) > 1 { - log.Fatalf("Unexpected number of results") + log.Fatalf("Unexpected number of results, filter should have produced one result") } decodeResult := results[0] |