diff options
author | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-05 01:00:12 -0500 |
---|---|---|
committer | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-05 01:00:12 -0500 |
commit | 4cc29e50d59daf445f4152d10f9f41cb1828f702 (patch) | |
tree | 2726dc5648c574213fdadf22349017be73690bd2 /adapters/gtest/executable.go | |
parent | 151d516e68f5d43aa2d0c5ff462752d640b6a614 (diff) | |
download | planr-4cc29e50d59daf445f4152d10f9f41cb1828f702.tar.xz planr-4cc29e50d59daf445f4152d10f9f41cb1828f702.zip |
Remove pointers and cleanup templating, add version info
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] |