@@ -35,6 +35,8 @@ const TESTDATA = "testdata"
3535
3636var testTarget = flag .String ("target" , "" , "override test target" )
3737
38+ var testOnlyCurrentOS = flag .Bool ("only-current-os" , false , "" )
39+
3840var supportedLinuxArches = map [string ]string {
3941 "AMD64Linux" : "linux/amd64" ,
4042 "X86Linux" : "linux/386" ,
@@ -158,20 +160,35 @@ func TestBuild(t *testing.T) {
158160 return
159161 }
160162
161- t .Run ("EmulatedCortexM3" , func (t * testing.T ) {
162- t .Parallel ()
163- runPlatTests (optionsFromTarget ("cortex-m-qemu" , sema ), tests , t )
164- })
163+ if ! * testOnlyCurrentOS {
164+ t .Run ("EmulatedCortexM3" , func (t * testing.T ) {
165+ t .Parallel ()
166+ runPlatTests (optionsFromTarget ("cortex-m-qemu" , sema ), tests , t )
167+ })
165168
166- t .Run ("EmulatedRISCV" , func (t * testing.T ) {
167- t .Parallel ()
168- runPlatTests (optionsFromTarget ("riscv-qemu" , sema ), tests , t )
169- })
169+ t .Run ("EmulatedRISCV" , func (t * testing.T ) {
170+ t .Parallel ()
171+ runPlatTests (optionsFromTarget ("riscv-qemu" , sema ), tests , t )
172+ })
170173
171- t .Run ("AVR" , func (t * testing.T ) {
172- t .Parallel ()
173- runPlatTests (optionsFromTarget ("simavr" , sema ), tests , t )
174- })
174+ t .Run ("AVR" , func (t * testing.T ) {
175+ t .Parallel ()
176+ runPlatTests (optionsFromTarget ("simavr" , sema ), tests , t )
177+ })
178+
179+ t .Run ("WebAssembly" , func (t * testing.T ) {
180+ t .Parallel ()
181+ runPlatTests (optionsFromTarget ("wasm" , sema ), tests , t )
182+ })
183+ t .Run ("WASI" , func (t * testing.T ) {
184+ t .Parallel ()
185+ runPlatTests (optionsFromTarget ("wasip1" , sema ), tests , t )
186+ })
187+ t .Run ("WASIp2" , func (t * testing.T ) {
188+ t .Parallel ()
189+ runPlatTests (optionsFromTarget ("wasip2" , sema ), tests , t )
190+ })
191+ }
175192
176193 if runtime .GOOS == "linux" {
177194 for name , osArch := range supportedLinuxArches {
@@ -191,18 +208,13 @@ func TestBuild(t *testing.T) {
191208 options := optionsFromOSARCH ("linux/mipsle/softfloat" , sema )
192209 runTest ("cgo/" , options , t , nil , nil )
193210 })
194- t .Run ("WebAssembly" , func (t * testing.T ) {
195- t .Parallel ()
196- runPlatTests (optionsFromTarget ("wasm" , sema ), tests , t )
197- })
198- t .Run ("WASI" , func (t * testing.T ) {
199- t .Parallel ()
200- runPlatTests (optionsFromTarget ("wasip1" , sema ), tests , t )
201- })
202- t .Run ("WASIp2" , func (t * testing.T ) {
203- t .Parallel ()
204- runPlatTests (optionsFromTarget ("wasip2" , sema ), tests , t )
205- })
211+ } else if runtime .GOOS == "windows" {
212+ if runtime .GOARCH != "386" {
213+ t .Run ("Windows386" , func (t * testing.T ) {
214+ t .Parallel ()
215+ runPlatTests (optionsFromOSARCH ("windows/386" , sema ), tests , t )
216+ })
217+ }
206218 }
207219}
208220
0 commit comments