Skip to content

Commit 09db5df

Browse files
jakebaileydeadprogram
authored andcommitted
main_test: skip json on Cortex-M QEMU with Go 1.27
Go 1.27 jsonv2 pushes testdata/json.go beyond the LM3S6965 flash budget. Keep coverage on larger emulated targets while skipping only the too-small Cortex-M QEMU configuration.
1 parent f00d896 commit 09db5df

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

main_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) {
273273
isWASI := strings.HasPrefix(options.Target, "wasi")
274274
isWebAssembly := isWASI || strings.HasPrefix(options.Target, "wasm") || (options.Target == "" && strings.HasPrefix(options.GOARCH, "wasm"))
275275
isBaremetal := options.Target == "simavr" || options.Target == "cortex-m-qemu" || options.Target == "riscv-qemu"
276+
_, goMinor, err := goenv.GetGorootVersion()
277+
if err != nil {
278+
t.Fatal("could not get version:", goMinor)
279+
}
276280

277281
for _, name := range tests {
278282
if options.GOOS == "linux" && (options.GOARCH == "arm" || options.GOARCH == "386") {
@@ -296,6 +300,11 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) {
296300
continue
297301
}
298302
}
303+
if options.Target == "cortex-m-qemu" && goMinor >= 27 && name == "json.go" {
304+
// Go 1.27 jsonv2 exceeds the LM3S6965's 256KiB flash. json.go
305+
// is still covered by larger targets such as riscv-qemu.
306+
continue
307+
}
299308
if options.Target == "simavr" {
300309
// Not all tests are currently supported on AVR.
301310
// Skip the ones that aren't.

0 commit comments

Comments
 (0)