diff options
Diffstat (limited to 'src/testing/testing_test.go')
| -rw-r--r-- | src/testing/testing_test.go | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/testing/testing_test.go b/src/testing/testing_test.go index f53c233905..d62455baa8 100644 --- a/src/testing/testing_test.go +++ b/src/testing/testing_test.go @@ -440,12 +440,7 @@ func runTest(t *testing.T, test string) []byte { testenv.MustHaveExec(t) - exe, err := os.Executable() - if err != nil { - t.Skipf("can't find test executable: %v", err) - } - - cmd := testenv.Command(t, exe, "-test.run=^"+test+"$", "-test.bench="+test, "-test.v", "-test.parallel=2", "-test.benchtime=2x") + cmd := testenv.Command(t, testenv.Executable(t), "-test.run=^"+test+"$", "-test.bench="+test, "-test.v", "-test.parallel=2", "-test.benchtime=2x") cmd = testenv.CleanCmdEnv(cmd) cmd.Env = append(cmd.Env, "GO_WANT_HELPER_PROCESS=1") out, err := cmd.CombinedOutput() @@ -674,14 +669,7 @@ func TestRaceBeforeParallel(t *testing.T) { } func TestRaceBeforeTests(t *testing.T) { - testenv.MustHaveExec(t) - - exe, err := os.Executable() - if err != nil { - t.Skipf("can't find test executable: %v", err) - } - - cmd := testenv.Command(t, exe, "-test.run=^$") + cmd := testenv.Command(t, testenv.Executable(t), "-test.run=^$") cmd = testenv.CleanCmdEnv(cmd) cmd.Env = append(cmd.Env, "GO_WANT_RACE_BEFORE_TESTS=1") out, _ := cmd.CombinedOutput() |
