...
Source file
src/cmd/dist/supported_test.go
1
2
3
4
5 package main
6
7 import (
8 "internal/platform"
9 "testing"
10 )
11
12
13
14
15
16 func TestSupported(t *testing.T) {
17 defer func(a, o string) {
18 goarch = a
19 goos = o
20 }(goarch, goos)
21
22 var modes = []string{
23
24 "pie",
25 "c-archive",
26 "c-shared",
27 "shared",
28 "plugin",
29 }
30
31 for _, a := range okgoarch {
32 goarch = a
33 for _, o := range okgoos {
34 if _, ok := cgoEnabled[o+"/"+a]; !ok {
35 continue
36 }
37 goos = o
38 for _, mode := range modes {
39 var dt tester
40 dist := dt.supportedBuildmode(mode)
41 std := platform.BuildModeSupported("gc", mode, o, a)
42 if dist != std {
43 t.Errorf("discrepancy for %s-%s %s: dist says %t, standard library says %t", o, a, mode, dist, std)
44 }
45 }
46 }
47 }
48 }
49
View as plain text