File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ integration_tests/py_*
6767integration_tests /b1 /*
6868integration_tests /b2 /*
6969integration_tests /b3 /*
70+ integration_tests /b4 /*
7071
7172# ## https://raw.github.com/github/gitignore/218a941be92679ce67d0484547e3e142b2f5f6f0/Global/macOS.gitignore
7273
Original file line number Diff line number Diff line change @@ -107,6 +107,29 @@ macro(RUN)
107107 if (${RUN_FAIL} )
108108 set_tests_properties (${name} PROPERTIES WILL_FAIL TRUE )
109109 endif ()
110+ elseif (KIND STREQUAL "wasm" )
111+ # wasm test
112+ execute_process (COMMAND lpython --backend wasm ${CMAKE_CURRENT_SOURCE_DIR } /${name}.py -o ${name} )
113+
114+ find_program (WASM_EXEC_RUNTIME node )
115+ execute_process (COMMAND "${WASM_EXEC_RUNTIME} " --version
116+ OUTPUT_VARIABLE WASM_EXEC_VERSION
117+ OUTPUT_STRIP_TRAILING_WHITESPACE )
118+ string (COMPARE GREATER_EQUAL "${WASM_EXEC_VERSION} "
119+ "v16.0.0" IS_NODE_ABOVE_16)
120+
121+ if (NOT IS_NODE_ABOVE_16)
122+ message (STATUS "${WASM_EXEC_RUNTIME} version: ${WASM_EXEC_VERSION} " )
123+ set (WASM_EXEC_FLAGS "--experimental-wasm-bigint" )
124+ endif ()
125+
126+ add_test (${name} ${WASM_EXEC_RUNTIME} ${WASM_EXEC_FLAGS} ${CMAKE_CURRENT_BINARY_DIR } /${name}.js )
127+ if (RUN_LABELS)
128+ set_tests_properties (${name} PROPERTIES LABELS "${RUN_LABELS} " )
129+ endif ()
130+ if (${RUN_FAIL} )
131+ set_tests_properties (${name} PROPERTIES WILL_FAIL TRUE )
132+ endif ()
110133 endif ()
111134 endif ()
112135endmacro (RUN )
Original file line number Diff line number Diff line change 22
33set -ex
44
5- rm -rf b1 b2 b3
5+ rm -rf b1 b2 b3 b4
66
77# Append "-j4" or "-j" to run in parallel
88jn=$1
3030cmake -DKIND=c ..
3131make $jn
3232ctest $jn --output-on-failure
33+
34+ mkdir b4
35+ cd b4
36+ cmake -DKIND=wasm ..
37+ make $jn
38+ ctest $jn --output-on-failure
You can’t perform that action at this time.
0 commit comments