diff --git a/tools/hako_check/run_tests.sh b/tools/hako_check/run_tests.sh index 4c0194c9..d05cea0c 100644 --- a/tools/hako_check/run_tests.sh +++ b/tools/hako_check/run_tests.sh @@ -94,10 +94,26 @@ run_case() { rm -f "$tmp_out" "$tmp_norm" "$tmp_json" } -for d in "$TARGET_DIR"/*; do - [ -d "$d" ] || continue - run_case "$d" -done +# Handle arguments: if provided, test only specified dirs; otherwise test all +if [ $# -gt 0 ]; then + # Test only specified directories + for arg in "$@"; do + # Convert relative path to absolute + if [[ "$arg" == /* ]]; then + d="$arg" + else + d="$ROOT/$arg" + fi + [ -d "$d" ] || { echo "[TEST] not a directory: $d" >&2; continue; } + run_case "$d" + done +else + # Test all directories + for d in "$TARGET_DIR"/*; do + [ -d "$d" ] || continue + run_case "$d" + done +fi if [ $fail -ne 0 ]; then echo "[TEST/SUMMARY] failures=$fail" >&2