avr: get go test -target=simavr to work

This patch changes two things:

 1. It changes the default stack size. Without this change, the
    goroutine.go test doesn't pass (apparently there's some memory
    corruption).
 2. It moves the excluded tests so that they are skipped with a regular
    `-target=simavr`, not just when running all tests (without
    `-target`).
Этот коммит содержится в:
Ayke van Laethem 2022-05-04 22:15:26 +02:00 коммит произвёл Ron Evans
родитель eb3d6261b4
коммит a94e03eff2
2 изменённых файлов: 50 добавлений и 41 удалений

Просмотреть файл

@ -146,46 +146,7 @@ func TestBuild(t *testing.T) {
// LIBCLANG FATAL ERROR: Cannot select: t3: i16 = JumpTable<0> // LIBCLANG FATAL ERROR: Cannot select: t3: i16 = JumpTable<0>
// This bug is non-deterministic. // This bug is non-deterministic.
t.Skip("skipped due to non-deterministic backend bugs") t.Skip("skipped due to non-deterministic backend bugs")
runPlatTests(optionsFromTarget("simavr", sema), tests, t)
var avrTests []string
for _, t := range tests {
switch t {
case "atomic.go":
// Requires GCC 11.2.0 or above for interface comparison.
// https://github.com/gcc-mirror/gcc/commit/f30dd607669212de135dec1f1d8a93b8954c327c
case "reflect.go":
// Reflect tests do not work due to type code issues.
case "gc.go":
// Does not pass due to high mark false positive rate.
case "json.go", "stdlib.go", "testing.go":
// Breaks interp.
case "map.go":
// Reflect size calculation crashes.
case "binop.go":
// Interface comparison results are inverted.
case "channel.go":
// Freezes after recv from closed channel.
case "float.go", "math.go", "print.go":
// Stuck in runtime.printfloat64.
case "interface.go":
// Several comparison tests fail.
case "cgo/":
// CGo does not work on AVR.
default:
avrTests = append(avrTests, t)
}
}
runPlatTests(optionsFromTarget("simavr", sema), avrTests, t)
}) })
if runtime.GOOS == "linux" { if runtime.GOOS == "linux" {
@ -217,6 +178,54 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) {
} }
for _, name := range tests { for _, name := range tests {
if options.Target == "simavr" {
// Not all tests are currently supported on AVR.
// Skip the ones that aren't.
switch name {
case "atomic.go":
// Requires GCC 11.2.0 or above for interface comparison.
// https://github.com/gcc-mirror/gcc/commit/f30dd607669212de135dec1f1d8a93b8954c327c
continue
case "reflect.go":
// Reflect tests do not work due to type code issues.
continue
case "gc.go":
// Does not pass due to high mark false positive rate.
continue
case "json.go", "stdlib.go", "testing.go", "testing_go118.go":
// Breaks interp.
continue
case "map.go":
// Reflect size calculation crashes.
continue
case "binop.go":
// Interface comparison results are inverted.
continue
case "channel.go":
// Freezes after recv from closed channel.
continue
case "float.go", "math.go", "print.go":
// Stuck in runtime.printfloat64.
continue
case "interface.go":
// Several comparison tests fail.
continue
case "cgo/":
// CGo does not work on AVR.
continue
default:
}
}
name := name // redefine to avoid race condition name := name // redefine to avoid race condition
t.Run(name, func(t *testing.T) { t.Run(name, func(t *testing.T) {
t.Parallel() t.Parallel()

Просмотреть файл

@ -1,5 +1,5 @@
{ {
"inherits": ["atmega1284p"], "inherits": ["atmega1284p"],
"scheduler": "tasks", "scheduler": "tasks",
"default-stack-size": 512 "default-stack-size": 384
} }