summaryrefslogtreecommitdiffstats
path: root/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.cpp
diff options
context:
space:
mode:
authorMorten Sørvig <[email protected]>2022-07-06 23:01:59 +0200
committerMorten Sørvig <[email protected]>2022-08-08 18:14:28 +0200
commit964765f686bca3ba62833e76e5ed689fce9a62bb (patch)
treefc0b7cfae17f7a930c07003562115c78548255bc /tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.cpp
parent2a17034ddc513870bda49e5d76cb0b1bf358c754 (diff)
wasm: add event loop auto test
Add basic tests for timers and event processing, for different use cases such as on the main thread, on a secondary thread, and with asyncify. Pick-to: 6.4 Change-Id: Ie0f82b5de97f639867b1e65dbb0ab8b11db86f85 Reviewed-by: Lorn Potter <[email protected]>
Diffstat (limited to 'tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.cpp')
-rw-r--r--tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.cpp b/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.cpp
index dd7d11c398f..c70c3902496 100644
--- a/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.cpp
+++ b/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.cpp
@@ -45,7 +45,6 @@ void verify(bool condition, std::string_view conditionString, std::string_view f
// thread-safe and call be called from any thread.
void completeTestFunction(TestResult result, std::string message)
{
-
// Report test result to JavaScript test runner, on the main thread
runOnMainThread([resultString = result == TestResult::Pass ? "PASS" : "FAIL", message](){
EM_ASM({
@@ -54,6 +53,12 @@ void completeTestFunction(TestResult result, std::string message)
});
}
+// Completes the currently running test function with a Pass result.
+void completeTestFunction()
+{
+ completeTestFunction(TestResult::Pass, std::string());
+}
+
//
// Private API for the Javascript test runnner
//