// Only run where builders (build.golang.org) have
// access to compiled packages for import.
//
-//go:build !android && !ios && !js
+//go:build !android && !ios && !js && !wasip1
package types2_test
}
// Runtime CPU tests.
- if !t.compileOnly && goos != "js" { // js can't handle -cpu != 1
+ if !t.compileOnly && t.hasParallelism() {
t.registerTest("runtime:cpu124", "GOMAXPROCS=2 runtime -cpu=1,2,4 -quick",
&goTest{
timeout: 300 * time.Second,
// On the builders only, test that a moved GOROOT still works.
// Fails on iOS because CC_FOR_TARGET refers to clangwrap.sh
// in the unmoved GOROOT.
- // Fails on Android and js/wasm with an exec format error.
+ // Fails on Android, js/wasm and wasip1/wasm with an exec format error.
// Fails on plan9 with "cannot find GOROOT" (issue #21016).
- if os.Getenv("GO_BUILDER_NAME") != "" && goos != "android" && !t.iOS() && goos != "plan9" && goos != "js" {
+ if os.Getenv("GO_BUILDER_NAME") != "" && goos != "android" && !t.iOS() && goos != "plan9" && goos != "js" && goos != "wasip1" {
t.tests = append(t.tests, distTest{
name: "moved_goroot",
heading: "moved GOROOT",
}
// sync tests
- if goos != "js" { // js doesn't support -cpu=10
+ if t.hasParallelism() {
t.registerTest("sync_cpu", "sync -cpu=10",
&goTest{
timeout: 120 * time.Second,
return true
}
+func (t *tester) hasParallelism() bool {
+ switch goos {
+ case "js", "wasip1":
+ return false
+ }
+ return true
+}
+
func (t *tester) raceDetectorSupported() bool {
if gohostos != goos {
return false
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build unix || js
+//go:build unix || js || wasip1
package base
"bytes"
"encoding/binary"
"fmt"
- "internal/testenv"
"os"
"path/filepath"
"runtime"
}
func TestCacheTrim(t *testing.T) {
- if runtime.GOOS == "js" {
- testenv.SkipFlaky(t, 35220)
+ if runtime.GOOS == "js" || runtime.GOOS == "wasip1" {
+ t.Skip("file lock is unsupported on +" + runtime.GOOS)
}
dir, err := os.MkdirTemp("", "cachetest-")
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !js && !plan9
+//go:build !js && !plan9 && !wasip1
package filelock_test
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// js does not support inter-process file locking.
+// js and wasip1 do not support inter-process file locking.
//
-//go:build !js
+//go:build !js && !wasip1
package lockedfile_test
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// js does not support inter-process file locking.
+// js and wasip1 do not support inter-process file locking.
//
-//go:build !js
+//go:build !js && !wasip1
package lockedfile_test
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build (js && wasm) || plan9
+//go:build (js && wasm) || wasip1 || plan9
package mmap
import (
"fmt"
+ "internal/testenv"
"io/fs"
"os"
"path/filepath"
// directory.
// See https://golang.org/issue/18878.
func TestRespectSetgidDir(t *testing.T) {
- switch runtime.GOOS {
- case "ios":
- t.Skip("can't set SetGID bit with chmod on iOS")
- case "windows", "plan9":
- t.Skip("chown/chmod setgid are not supported on Windows or Plan 9")
- }
-
var b Builder
// Check that `cp` is called instead of `mv` by looking at the output
// the new temporary directory.
err = os.Chown(setgiddir, os.Getuid(), os.Getgid())
if err != nil {
+ if testenv.SyscallIsNotSupported(err) {
+ t.Skip("skipping: chown is not supported on " + runtime.GOOS)
+ }
t.Fatal(err)
}
// Change setgiddir's permissions to include the SetGID bit.
if err := os.Chmod(setgiddir, 0755|fs.ModeSetgid); err != nil {
+ if testenv.SyscallIsNotSupported(err) {
+ t.Skip("skipping: chmod is not supported on " + runtime.GOOS)
+ }
+ t.Fatal(err)
+ }
+ if fi, err := os.Stat(setgiddir); err != nil {
t.Fatal(err)
+ } else if fi.Mode()&fs.ModeSetgid == 0 {
+ t.Skip("skipping: Chmod ignored ModeSetgid on " + runtime.GOOS)
}
pkgfile, err := os.CreateTemp("", "pkgfile")
--- /dev/null
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build wasip1
+
+package osinfo
+
+import (
+ "errors"
+ "fmt"
+)
+
+// Version returns the OS version name/number.
+func Version() (string, error) {
+ return "", fmt.Errorf("unable to determine OS version: %w", errors.ErrUnsupported)
+}
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build unix || js
+//go:build unix || js || wasip1
package main