diff --git a/scripts/test.sh b/scripts/test.sh index 97f498e..f6d7a03 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -3,11 +3,17 @@ set -uo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +TESTS_DIR="$PROJECT_DIR/tests/required" + +is_windows=false +case "$(uname -s | tr '[:upper:]' '[:lower:]')" in + *mingw*|*msys*|*cygwin*) is_windows=true ;; +esac + COMPILER="$PROJECT_DIR/build/dynlex" -if [[ ! -x "$COMPILER" && -x "$PROJECT_DIR/build/dynlex.exe" ]]; then - COMPILER="$PROJECT_DIR/build/dynlex.exe" +if [[ "$is_windows" == "true" ]]; then + COMPILER+=".exe" fi -TESTS_DIR="$PROJECT_DIR/tests/required" # Colors RED='\033[0;31m' @@ -20,10 +26,6 @@ failed=0 skipped=0 failures=() test_output="" -is_windows=false -case "$(uname -s | tr '[:upper:]' '[:lower:]')" in - *mingw*|*msys*|*cygwin*) is_windows=true ;; -esac # Known failing tests — these don't count as unexpected failures KNOWN_FAILURES="" @@ -382,7 +384,7 @@ run_auxiliary_test() { run_auxiliary_test "dl_file_discovery" 10 python3 -B "$SCRIPT_DIR/test_dl_files.py" run_auxiliary_test "dependency_installer" 10 python3 -B "$SCRIPT_DIR/test_install.py" -run_auxiliary_test "import_root_consistency" 60 python3 -B "$SCRIPT_DIR/test_import_roots.py" +run_auxiliary_test "import_root_consistency" 60 python3 -B "$SCRIPT_DIR/test_import_roots.py" "$COMPILER" echo "Testing timeout_process_tree..." timeout_test_start_ms=$(now_ms) diff --git a/scripts/test_import_roots.py b/scripts/test_import_roots.py index f9deb8b..849c263 100644 --- a/scripts/test_import_roots.py +++ b/scripts/test_import_roots.py @@ -9,12 +9,15 @@ from __future__ import annotations import subprocess +import sys import tempfile import unittest from pathlib import Path -SCRIPT_DIR = Path(__file__).resolve().parent -COMPILER = SCRIPT_DIR.parent / "build" / "dynlex" +if len(sys.argv) != 2: + raise SystemExit(f"Usage: {Path(sys.argv[0]).name} ") + +COMPILER = Path(sys.argv.pop()).resolve() class ImportRootConsistencyTests(unittest.TestCase): diff --git a/src/web/ide/public/compiler/dynlex_web.wasm b/src/web/ide/public/compiler/dynlex_web.wasm index ae2072e..bdcc3b7 100755 Binary files a/src/web/ide/public/compiler/dynlex_web.wasm and b/src/web/ide/public/compiler/dynlex_web.wasm differ