Skip to content

Commit

Permalink
unify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DerThorsten committed Oct 6, 2023
1 parent a9db04b commit 86dd40d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
8 changes: 4 additions & 4 deletions test/test_wasm/test_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
# run tests with node
node build/test/test_xsimd.js
42 changes: 20 additions & 22 deletions test/test_wasm/test_wasm_playwright.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down

0 comments on commit 86dd40d

Please sign in to comment.