(t *testing.T)
| 58 | var sema = make(chan struct{}, runtime.NumCPU()) |
| 59 | |
| 60 | func TestBuild(t *testing.T) { |
| 61 | t.Parallel() |
| 62 | |
| 63 | tests := []string{ |
| 64 | "alias.go", |
| 65 | "atomic.go", |
| 66 | "binop.go", |
| 67 | "calls.go", |
| 68 | "cgo/", |
| 69 | "channel.go", |
| 70 | "embed/", |
| 71 | "float.go", |
| 72 | "gc.go", |
| 73 | "generics.go", |
| 74 | "goroutines.go", |
| 75 | "init.go", |
| 76 | "init_multi.go", |
| 77 | "interface.go", |
| 78 | "json.go", |
| 79 | "map.go", |
| 80 | "math.go", |
| 81 | "oldgo/", |
| 82 | "print.go", |
| 83 | "reflect.go", |
| 84 | "signal.go", |
| 85 | "slice.go", |
| 86 | "sort.go", |
| 87 | "stdlib.go", |
| 88 | "string.go", |
| 89 | "structs.go", |
| 90 | "testing.go", |
| 91 | "timers.go", |
| 92 | "zeroalloc.go", |
| 93 | } |
| 94 | |
| 95 | // Go 1.21 made some changes to the language, which we can only test when |
| 96 | // we're actually on Go 1.21. |
| 97 | _, minor, err := goenv.GetGorootVersion() |
| 98 | if err != nil { |
| 99 | t.Fatal("could not get version:", minor) |
| 100 | } |
| 101 | if minor >= 21 { |
| 102 | tests = append(tests, "go1.21.go") |
| 103 | } |
| 104 | if minor >= 22 { |
| 105 | tests = append(tests, "go1.22/") |
| 106 | } |
| 107 | if minor >= 23 { |
| 108 | tests = append(tests, "go1.23/") |
| 109 | } |
| 110 | if minor >= 24 { |
| 111 | tests = append(tests, "typealias.go") |
| 112 | } |
| 113 | |
| 114 | if *testTarget != "" { |
| 115 | // This makes it possible to run one specific test (instead of all), |
| 116 | // which is especially useful to quickly check whether some changes |
| 117 | // affect a particular target architecture. |
nothing calls this directly
no test coverage detected