From 17078f5860699e0d1e1f6f3ca328f92621ac49d0 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 27 Sep 2022 16:13:40 +0200 Subject: [PATCH] cmd/api: skip tests on platforms that cannot exec These tests execute commands using exec.Command. Change-Id: I2708d6d24762fe2b2a902b1b221cc67392bf5c41 Reviewed-on: https://go-review.googlesource.com/c/go/+/435235 TryBot-Result: Gopher Robot Reviewed-by: Bryan Mills Auto-Submit: Tobias Klauser Reviewed-by: Dmitri Shuralyov Run-TryBot: Tobias Klauser --- src/cmd/api/goapi_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cmd/api/goapi_test.go b/src/cmd/api/goapi_test.go index e905e65b24..f8ee520bda 100644 --- a/src/cmd/api/goapi_test.go +++ b/src/cmd/api/goapi_test.go @@ -18,6 +18,11 @@ import ( ) func TestMain(m *testing.M) { + if !testenv.HasExec() { + os.Stdout.WriteString("skipping test: platform cannot exec") + os.Exit(0) + } + flag.Parse() for _, c := range contexts { c.Compiler = build.Default.Compiler -- 2.50.0