aboutsummaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/cpu/cpu_test.go5
-rw-r--r--src/internal/godebug/godebug_test.go2
-rw-r--r--src/internal/syscall/windows/exec_windows_test.go3
3 files changed, 4 insertions, 6 deletions
diff --git a/src/internal/cpu/cpu_test.go b/src/internal/cpu/cpu_test.go
index a6fe7f77f3..3bff9bed4e 100644
--- a/src/internal/cpu/cpu_test.go
+++ b/src/internal/cpu/cpu_test.go
@@ -8,7 +8,6 @@ import (
. "internal/cpu"
"internal/godebug"
"internal/testenv"
- "os"
"os/exec"
"testing"
)
@@ -26,11 +25,9 @@ func MustSupportFeatureDetection(t *testing.T) {
func runDebugOptionsTest(t *testing.T, test string, options string) {
MustHaveDebugOptionsSupport(t)
- testenv.MustHaveExec(t)
-
env := "GODEBUG=" + options
- cmd := exec.Command(os.Args[0], "-test.run=^"+test+"$")
+ cmd := exec.Command(testenv.Executable(t), "-test.run=^"+test+"$")
cmd.Env = append(cmd.Env, env)
output, err := cmd.CombinedOutput()
diff --git a/src/internal/godebug/godebug_test.go b/src/internal/godebug/godebug_test.go
index fe1e67225c..fbabc657fe 100644
--- a/src/internal/godebug/godebug_test.go
+++ b/src/internal/godebug/godebug_test.go
@@ -78,7 +78,7 @@ func TestPanicNilRace(t *testing.T) {
t.Skip("Skipping test intended for use with -race.")
}
if os.Getenv("GODEBUG") != "panicnil=1" {
- cmd := testenv.CleanCmdEnv(testenv.Command(t, os.Args[0], "-test.run=^TestPanicNilRace$", "-test.v", "-test.parallel=2", "-test.count=1"))
+ cmd := testenv.CleanCmdEnv(testenv.Command(t, testenv.Executable(t), "-test.run=^TestPanicNilRace$", "-test.v", "-test.parallel=2", "-test.count=1"))
cmd.Env = append(cmd.Env, "GODEBUG=panicnil=1")
out, err := cmd.CombinedOutput()
t.Logf("output:\n%s", out)
diff --git a/src/internal/syscall/windows/exec_windows_test.go b/src/internal/syscall/windows/exec_windows_test.go
index 72550b5a84..fc694199f7 100644
--- a/src/internal/syscall/windows/exec_windows_test.go
+++ b/src/internal/syscall/windows/exec_windows_test.go
@@ -9,6 +9,7 @@ package windows_test
import (
"fmt"
"internal/syscall/windows"
+ "internal/testenv"
"os"
"os/exec"
"syscall"
@@ -29,7 +30,7 @@ func TestRunAtLowIntegrity(t *testing.T) {
return
}
- cmd := exec.Command(os.Args[0], "-test.run=^TestRunAtLowIntegrity$", "--")
+ cmd := exec.Command(testenv.Executable(t), "-test.run=^TestRunAtLowIntegrity$", "--")
cmd.Env = []string{"GO_WANT_HELPER_PROCESS=1"}
token, err := getIntegrityLevelToken(sidWilLow)