X-Git-Url: http://nitlanguage.org diff --git a/tests/tests.sh b/tests/tests.sh index 38efba2..6cfb9be 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -319,6 +319,11 @@ case $engine in niti) enginebinname=nit ;; + emscripten) + enginebinname=nitg + OPT="-m emscripten_nodejs.nit --semi-global $OPT" + savdirs="sav/nitg-sg/" + ;; nitc) echo "disabled engine $engine" exit 0 @@ -410,6 +415,11 @@ for ii in "$@"; do inputs=/dev/null fi + ffout="$ff.bin" + if [ "$engine" = "emscripten" ]; then + ffout="$ff.bin.js" + fi + if [ "$engine" = "niti" ]; then cat > "./$ff.bin" < "$ff.cmp.err" > "$ff.compile.log" + $TIMEOUT $NITC --no-color $OPT -o "$ffout" "$i" $includes $nocc 2> "$ff.cmp.err" > "$ff.compile.log" ERR=$? if [ "x$verbose" = "xtrue" ]; then cat "$ff.compile.log" cat >&2 "$ff.cmp.err" fi fi + if [ "$engine" = "emscripten" ]; then + echo > "./$ff.bin" "nodejs $ffout \"\$@\"" + chmod +x "$ff.bin" + if grep "Fatal Error: more than one primitive class" "$ff.compile.log" > /dev/null; then + echo " [skip] do no not imports kernel" + echo >>$xml "" + continue + fi + fi if [ "$ERR" != 0 ]; then echo -n "! " cat "$ff.compile.log" "$ff.cmp.err" > "$ff.res"