From ec184e90c15877a3e47ae23267cd3a260790a2f7 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 8 Jul 2026 10:05:34 -0700 Subject: [PATCH] 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. --- main_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main_test.go b/main_test.go index b7dfa6b0f..4316c2dae 100644 --- a/main_test.go +++ b/main_test.go @@ -273,6 +273,10 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) { isWASI := strings.HasPrefix(options.Target, "wasi") isWebAssembly := isWASI || strings.HasPrefix(options.Target, "wasm") || (options.Target == "" && strings.HasPrefix(options.GOARCH, "wasm")) isBaremetal := options.Target == "simavr" || options.Target == "cortex-m-qemu" || options.Target == "riscv-qemu" + _, goMinor, err := goenv.GetGorootVersion() + if err != nil { + t.Fatal("could not get version:", goMinor) + } for _, name := range tests { if options.GOOS == "linux" && (options.GOARCH == "arm" || options.GOARCH == "386") { @@ -296,6 +300,11 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) { continue } } + if options.Target == "cortex-m-qemu" && goMinor >= 27 && name == "json.go" { + // Go 1.27 jsonv2 exceeds the LM3S6965's 256KiB flash. json.go + // is still covered by larger targets such as riscv-qemu. + continue + } if options.Target == "simavr" { // Not all tests are currently supported on AVR. // Skip the ones that aren't.