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>
diff --git a/cmd/bent/bent_test.go b/cmd/bent/bent_test.go
index e3c9560..746cbfc 100644
--- a/cmd/bent/bent_test.go
+++ b/cmd/bent/bent_test.go
@@ -10,6 +10,7 @@
"fmt"
"os"
"os/exec"
+ "runtime"
"testing"
)
@@ -46,6 +47,9 @@
}
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 {
diff --git a/driver/driver_stub.go b/driver/driver_stub.go
index 0b9696d..da94600 100644
--- a/driver/driver_stub.go
+++ b/driver/driver_stub.go
@@ -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
diff --git a/driver/driver_wasm.go b/driver/driver_wasm.go
new file mode 100644
index 0000000..59703b1
--- /dev/null
+++ b/driver/driver_wasm.go
@@ -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)
+}
diff --git a/sweet/benchmarks/bleve-index/main.go b/sweet/benchmarks/bleve-index/main.go
index da965d8..9724bbd 100644
--- a/sweet/benchmarks/bleve-index/main.go
+++ b/sweet/benchmarks/bleve-index/main.go
@@ -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
diff --git a/sweet/benchmarks/etcd/main.go b/sweet/benchmarks/etcd/main.go
index b132185..2625440 100644
--- a/sweet/benchmarks/etcd/main.go
+++ b/sweet/benchmarks/etcd/main.go
@@ -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 (
diff --git a/third_party/bleve-bench/mapping.go b/third_party/bleve-bench/mapping.go
index e364d20..a3421f1 100644
--- a/third_party/bleve-bench/mapping.go
+++ b/third_party/bleve-bench/mapping.go
@@ -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