From 86dd40d7fb3957bd38ef90cedcfda017c8f2bac0 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Fri, 6 Oct 2023 10:13:52 +0200 Subject: [PATCH] unify tests --- test/test_wasm/test_wasm.sh | 8 ++--- test/test_wasm/test_wasm_playwright.py | 42 ++++++++++++-------------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/test/test_wasm/test_wasm.sh b/test/test_wasm/test_wasm.sh index 70330b41d..319f4fbc1 100755 --- a/test/test_wasm/test_wasm.sh +++ b/test/test_wasm/test_wasm.sh @@ -39,8 +39,8 @@ emcmake cmake \ emmake make -j4 cd .. -# run tests with node -#node build/test/test_xsimd.js - +# run tests in browser +python $TEST_WASM_DIR/test_wasm_playwright.py build/test -python $TEST_WASM_DIR/test_wasm_playwright.py build/test \ No newline at end of file +# run tests with node +node build/test/test_xsimd.js \ No newline at end of file diff --git a/test/test_wasm/test_wasm_playwright.py b/test/test_wasm/test_wasm_playwright.py index c8d660cf5..c3107e254 100644 --- a/test/test_wasm/test_wasm_playwright.py +++ b/test/test_wasm/test_wasm_playwright.py @@ -66,31 +66,29 @@ async def handle_console(msg): page.on("console", handle_console) - if True: - status = await page.evaluate( - f"""async () => {{ - - let test_module = await test_xsimd_wasm(); - console.log("\\n\\n************************************************************"); - console.log("XSIMD WASM TESTS:"); - console.log("************************************************************"); - let r = test_module.run_tests(); - if (r == 0) {{ - console.log("\\n\\n************************************************************"); - console.log("XSIMD WASM TESTS PASSED"); - console.log("************************************************************"); - return r; - }} - else {{ - console.log("************************************************************"); - console.log("XSIMD WASM TESTS FAILED"); - console.log("************************************************************"); - return r; - }} + status = await page.evaluate( + f"""async () => {{ + let test_module = await test_xsimd_wasm(); + console.log("\\n\\n************************************************************"); + console.log("XSIMD WASM TESTS:"); + console.log("************************************************************"); + let r = test_module.run_tests(); + if (r == 0) {{ + console.log("\\n\\n************************************************************"); + console.log("XSIMD WASM TESTS PASSED"); + console.log("************************************************************"); + return r; + }} + else {{ + console.log("************************************************************"); + console.log("XSIMD WASM TESTS FAILED"); + console.log("************************************************************"); + return r; + }} }}""" ) - return_code = 0#int(status) + return_code = int(status) return return_code def main(build_dir):