all: add test skips for GOARCH=wasm

These changes are enough to get 'GOOS=js GOARCH=wasm go test ./...'
to pass.

For golang/go#61104.

Change-Id: I78a2978a83a1026adeecc81b31bf7c2aa2db2155
Cq-Include-Trybots: luci.golang.try:x_benchmarks-gotip-js-wasm
Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/533695
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
pull/8/head
Dmitri Shuralyov 2023-10-08 23:52:29 -04:00 committed by Gopher Robot
parent f6c13af26d
commit f8359292dd
6 changed files with 32 additions and 3 deletions

View File

@ -10,6 +10,7 @@ import (
"fmt"
"os"
"os/exec"
"runtime"
"testing"
)
@ -46,6 +47,9 @@ func bentCmd(t *testing.T, args ...string) *exec.Cmd {
}
func TestBent(t *testing.T) {
if runtime.GOARCH == "wasm" {
t.Skipf("skipping test: exec not supported on %s/%s", runtime.GOOS, runtime.GOARCH)
}
cmd := bentCmd(t, "-I")
output, err := cmd.CombinedOutput()
if err != nil {

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build aix || dragonfly || freebsd || netbsd || openbsd || solaris
//go:build aix || dragonfly || freebsd || netbsd || openbsd || solaris || wasm
package driver

23
driver/driver_wasm.go Normal file
View File

@ -0,0 +1,23 @@
// 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 wasm
package driver
import (
"fmt"
"os/exec"
"runtime"
)
type sysStats struct{}
func InitSysStats(N uint64) sysStats { return sysStats{} }
func (sysStats) Collect(*Result) {}
func RunAndCollectSysStats(cmd *exec.Cmd, res *Result, N uint64, prefix string) (string, error) {
return "", fmt.Errorf("not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
}

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !aix && !plan9
//go:build !aix && !plan9 && !wasm
package main

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !wasm
package main
import (

View File

@ -16,7 +16,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !aix && !plan9
//go:build !aix && !plan9 && !wasm
package blevebench