diff options
Diffstat (limited to 'tests/manual/wasm/qtwasmtestlib')
-rw-r--r-- | tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.cpp | 7 | ||||
-rw-r--r-- | tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.h | 1 |
2 files changed, 7 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 // diff --git a/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.h b/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.h index f4b0f752417..c691f44600e 100644 --- a/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.h +++ b/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.h @@ -20,6 +20,7 @@ std::string formatMessage(std::string_view file, std::string_view message); void completeTestFunction(TestResult result, std::string message); +void completeTestFunction(); void initTestCase(QObject *testObject, std::function<void ()> cleanup); template <typename App> void initTestCase(int argc, |