aboutsummaryrefslogtreecommitdiffhomepage
path: root/main_test.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-08-02 17:10:52 +0200
committerRon Evans <[email protected]>2024-10-23 12:25:27 +0100
commitb8fe75a9dd4949a08b78b2f3dd06fa3c697573dd (patch)
tree79350981ea8af9440f86818cd17c49741a948c89 /main_test.go
parent0f95b4102d83b6977277ea7d5e87ad538eddc5ef (diff)
downloadtinygo-b8fe75a9dd4949a08b78b2f3dd06fa3c697573dd.tar.gz
tinygo-b8fe75a9dd4949a08b78b2f3dd06fa3c697573dd.zip
runtime: add support for os/signal
This adds support for enabling and listening to signals on Linux and MacOS.
Diffstat (limited to 'main_test.go')
-rw-r--r--main_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/main_test.go b/main_test.go
index 93da10736..136128d51 100644
--- a/main_test.go
+++ b/main_test.go
@@ -79,6 +79,7 @@ func TestBuild(t *testing.T) {
"oldgo/",
"print.go",
"reflect.go",
+ "signal.go",
"slice.go",
"sort.go",
"stdlib.go",
@@ -217,6 +218,7 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) {
// isWebAssembly := strings.HasPrefix(spec.Triple, "wasm")
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"
for _, name := range tests {
if options.GOOS == "linux" && (options.GOARCH == "arm" || options.GOARCH == "386") {
@@ -281,6 +283,13 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) {
continue
}
}
+ if isWebAssembly || isBaremetal || options.GOOS == "windows" {
+ switch name {
+ case "signal.go":
+ // Signals only work on POSIX-like systems.
+ continue
+ }
+ }
name := name // redefine to avoid race condition
t.Run(name, func(t *testing.T) {