This repository was archived by the owner on Jul 12, 2024. It is now read-only.
test: Remove @JSExportTopLevel
from test-suites functions
#17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the resulting Wasm module contained all the code for every test-suite package, which made debugging test results harder because
(1) the resulting Wasm module contained a lot of irrelevant code, and (2) if one of the test-suites was compiled to invalid Wasm code, all the tests would be affected, rendering all modules unable to instantiate.
This issue caused because each Scala.js package in the test-suites containing
@JSExportTopLevel
, which served as a root node for reachability analysis. Thus, all the code under test-suites remained alive after linking.To address this, this commit removes all
@JSExportTopLevel
from the test-suites. Instead, we added a function call to theModuleInitializer
methods into the start function of WasmIf a test fails, Wasm will execute unreachable, causing instantiation to fail and the test to fail accordingly.