aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/internal
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2025-02-24 10:21:01 +0100
committerQuim Muntal <quimmuntal@gmail.com>2025-02-25 12:01:35 -0800
commitb47ebb229fba8748366d52b6894a572da7c3ccfd (patch)
tree86916cc1baceb71747c876e40a1b41d10e6add2d /src/runtime/internal
parent00e793cfe36de845501ea302645094149ed63e91 (diff)
downloadgo-b47ebb229fba8748366d52b6894a572da7c3ccfd.tar.xz
all: use testenv.GoToolPath instead of hardcoding go
Change-Id: I84ec73d3ddef913a87cb9b48147c44ac3e7c8a8d Reviewed-on: https://go-review.googlesource.com/c/go/+/651957 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/internal')
-rw-r--r--src/runtime/internal/wasitest/nonblock_test.go5
-rw-r--r--src/runtime/internal/wasitest/tcpecho_test.go5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/runtime/internal/wasitest/nonblock_test.go b/src/runtime/internal/wasitest/nonblock_test.go
index 3072b96ed8..f5f6bb84d0 100644
--- a/src/runtime/internal/wasitest/nonblock_test.go
+++ b/src/runtime/internal/wasitest/nonblock_test.go
@@ -10,6 +10,7 @@ package wasi_test
import (
"bufio"
"fmt"
+ "internal/testenv"
"io"
"math/rand"
"os"
@@ -41,6 +42,8 @@ func TestNonblock(t *testing.T) {
t.Skip("wasmer does not support non-blocking I/O")
}
+ testenv.MustHaveGoRun(t)
+
for _, mode := range []string{"os.OpenFile", "os.NewFile"} {
t.Run(mode, func(t *testing.T) {
args := []string{"run", "./testdata/nonblock.go", mode}
@@ -62,7 +65,7 @@ func TestNonblock(t *testing.T) {
fifos[len(fifos)-i-1] = &fifo{file, path}
}
- subProcess := exec.Command("go", args...)
+ subProcess := exec.Command(testenv.GoToolPath(t), args...)
subProcess.Env = append(os.Environ(), "GOOS=wasip1", "GOARCH=wasm")
diff --git a/src/runtime/internal/wasitest/tcpecho_test.go b/src/runtime/internal/wasitest/tcpecho_test.go
index bbcea90310..aa57d9e2e3 100644
--- a/src/runtime/internal/wasitest/tcpecho_test.go
+++ b/src/runtime/internal/wasitest/tcpecho_test.go
@@ -7,6 +7,7 @@ package wasi_test
import (
"bytes"
"fmt"
+ "internal/testenv"
"math/rand"
"net"
"os"
@@ -20,6 +21,8 @@ func TestTCPEcho(t *testing.T) {
t.Skip()
}
+ testenv.MustHaveGoRun(t)
+
// We're unable to use port 0 here (let the OS choose a spare port).
// Although the WASM runtime accepts port 0, and the WASM module listens
// successfully, there's no way for this test to query the selected port
@@ -44,7 +47,7 @@ func TestTCPEcho(t *testing.T) {
port++
}
- subProcess := exec.Command("go", "run", "./testdata/tcpecho.go")
+ subProcess := exec.Command(testenv.GoToolPath(t), "run", "./testdata/tcpecho.go")
subProcess.Env = append(os.Environ(), "GOOS=wasip1", "GOARCH=wasm")