mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 03:03:27 +00:00
test: support non-host tests
For example, for running tests with -target=wasm or -target=cortex-m-qemu. It looks at the output to determine whether tests were successful in the absence of a status code.
This commit is contained in:
committed by
Ron Evans
parent
1096596b69
commit
b713001313
@@ -289,6 +289,17 @@
|
||||
setTimeout(this._inst.exports.go_scheduler, timeout);
|
||||
},
|
||||
|
||||
// func Exit(code int)
|
||||
"syscall.Exit": (code) => {
|
||||
if (global.process) {
|
||||
// Node.js
|
||||
process.exit(code);
|
||||
} else {
|
||||
// Can't exit in a browser.
|
||||
throw 'trying to exit with code ' + code;
|
||||
}
|
||||
},
|
||||
|
||||
// func finalizeRef(v ref)
|
||||
"syscall/js.finalizeRef": (sp) => {
|
||||
// Note: TinyGo does not support finalizers so this should never be
|
||||
|
||||
Reference in New Issue
Block a user