...
1
2
3
4
5 package asmdecl_test
6
7 import (
8 "os"
9 "strings"
10 "testing"
11
12 "golang.org/x/tools/go/analysis/analysistest"
13 "golang.org/x/tools/go/analysis/passes/asmdecl"
14 )
15
16 var goosarches = []string{
17 "linux/amd64",
18 "linux/386",
19 "linux/arm",
20
21
22 "linux/mips64",
23 "linux/s390x",
24 "linux/ppc64",
25 "linux/mips",
26 "js/wasm",
27 "linux/riscv64",
28 }
29
30 func Test(t *testing.T) {
31 testdata := analysistest.TestData()
32 for _, goosarch := range goosarches {
33 t.Run(goosarch, func(t *testing.T) {
34 i := strings.Index(goosarch, "/")
35 os.Setenv("GOOS", goosarch[:i])
36 os.Setenv("GOARCH", goosarch[i+1:])
37 analysistest.Run(t, testdata, asmdecl.Analyzer, "a")
38 })
39 }
40 }
41
View as plain text