Skip to content

Commit 1246bcb

Browse files
committed
[Tests][emscripten] Catch errors from test handlers.
This helps with running the whole browser testsuite even if there are uncaught errors (for example, from attempting to run an inner main loop)
1 parent 91f10bd commit 1246bcb

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/_emscripten/__boot.livecodescript

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on startup
1616
TestLoadLibrary "_inputlib"
1717

1818
-- Run tests
19-
local tTestFiles, tTestFile, tStackName, tCommand, tSetupResult
19+
local tTestFiles, tTestFile, tStackName, tCommand, tSetupResult, tError
2020

2121
put TesterGetTestFileNames("/boot/standalone") into tTestFiles
2222

@@ -45,7 +45,12 @@ on startup
4545
end if
4646

4747
-- Run tests
48-
dispatch tCommand to tStackName
48+
try
49+
dispatch tCommand to tStackName
50+
catch tError
51+
TestDiagnostic tError
52+
TestAssert empty, false
53+
end try
4954

5055
-- Send teardown command
5156
dispatch "TestTearDown" to tStackName

0 commit comments

Comments
 (0)