test(phase124): Update smoke tests to JoinIR-only

- Remove all NYASH_HAKO_CHECK_JOINIR=0 legacy path tests
- Keep only JoinIR-only tests (no environment variables)
- Update script header to Phase 124
- Update test descriptions to reflect JoinIR-only architecture
- Fix arithmetic increment issue with set -e compatibility

Test Results: 4/4 PASS (100%)
- phase123_simple_if.hako:  PASS
- phase123_nested_if.hako:  PASS
- phase123_while_loop.hako:  PASS
- phase123_if_in_loop.hako:  PASS

Phase 124 Task 4/5 complete
This commit is contained in:
nyash-codex
2025-12-04 06:31:18 +09:00
parent 2337e8a378
commit e67bc50f6f

View File

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
# Phase 123: hako_check JoinIR implementation test # Phase 124: hako_check JoinIR-only test (legacy path removed)
set -e set -e
# Profile metadata # Profile metadata
PROFILE_NAME="hako_check_joinir" PROFILE_NAME="hako_check_joinir"
DESCRIPTION="Test hako_check with both legacy and JoinIR paths" DESCRIPTION="Test hako_check with JoinIR-only path (Phase 124 consolidation)"
# Color codes # Color codes
GREEN='\033[0;32m' GREEN='\033[0;32m'
@ -26,7 +26,7 @@ ROOT="$(cd "$(dirname "$0")/../../../../.." && pwd)"
BIN="${ROOT}/target/release/hakorune" BIN="${ROOT}/target/release/hakorune"
echo "==========================================" echo "=========================================="
echo " Phase 123: hako_check JoinIR Test" echo " Phase 124: hako_check JoinIR-Only Test"
echo "==========================================" echo "=========================================="
echo "" echo ""
@ -38,12 +38,10 @@ if [ ! -f "$BIN" ]; then
fi fi
# Test counters # Test counters
legacy_pass=0
legacy_fail=0
joinir_pass=0 joinir_pass=0
joinir_fail=0 joinir_fail=0
echo "=== Testing Legacy Path (NYASH_HAKO_CHECK_JOINIR=0) ===" echo "=== Testing JoinIR-Only Path (Phase 124: No environment variables) ==="
echo "" echo ""
for case in "${test_cases[@]}"; do for case in "${test_cases[@]}"; do
@ -54,36 +52,15 @@ for case in "${test_cases[@]}"; do
continue continue
fi fi
echo -n "Testing $case (legacy)... " echo -n "Testing $case (joinir-only)... "
if timeout 10 env NYASH_HAKO_CHECK_JOINIR=0 "$BIN" --backend vm "$test_file" >/dev/null 2>&1; then # Phase 124: No environment variables - JoinIR is the only path
if timeout 10 "$BIN" --backend vm "$test_file" >/dev/null 2>&1; then
echo -e "${GREEN}PASS${NC}" echo -e "${GREEN}PASS${NC}"
((legacy_pass++)) joinir_pass=$((joinir_pass + 1))
else else
echo -e "${RED}FAIL${NC}" echo -e "${RED}FAIL${NC}"
((legacy_fail++)) joinir_fail=$((joinir_fail + 1))
fi
done
echo ""
echo "=== Testing JoinIR Path (NYASH_HAKO_CHECK_JOINIR=1) ==="
echo ""
for case in "${test_cases[@]}"; do
test_file="${ROOT}/local_tests/${case}"
if [ ! -f "$test_file" ]; then
continue
fi
echo -n "Testing $case (joinir)... "
if timeout 10 env NYASH_HAKO_CHECK_JOINIR=1 "$BIN" --backend vm "$test_file" >/dev/null 2>&1; then
echo -e "${GREEN}PASS${NC}"
((joinir_pass++))
else
echo -e "${RED}FAIL${NC}"
((joinir_fail++))
fi fi
done done
@ -92,24 +69,17 @@ echo "=========================================="
echo " Test Results Summary" echo " Test Results Summary"
echo "==========================================" echo "=========================================="
echo "" echo ""
echo "Legacy Path:" echo "JoinIR-Only Path (Phase 124):"
echo " PASS: $legacy_pass"
echo " FAIL: $legacy_fail"
echo ""
echo "JoinIR Path:"
echo " PASS: $joinir_pass" echo " PASS: $joinir_pass"
echo " FAIL: $joinir_fail" echo " FAIL: $joinir_fail"
echo "" echo ""
# Determine overall result # Determine overall result
if [ $legacy_fail -eq 0 ] && [ $joinir_fail -eq 0 ]; then if [ $joinir_fail -eq 0 ]; then
echo -e "${GREEN}✓ All tests PASSED${NC}" echo -e "${GREEN}✓ All tests PASSED (JoinIR-only)${NC}"
exit 0 echo "Phase 124: hako_check successfully consolidated to JoinIR-only architecture"
elif [ $legacy_fail -eq 0 ]; then
echo -e "${YELLOW}⚠ Legacy path: OK, JoinIR path: Some failures${NC}"
echo "Note: JoinIR implementation is placeholder in Phase 123"
exit 0 exit 0
else else
echo -e "${RED}Legacy path has failures${NC}" echo -e "${RED}Some tests failed${NC}"
exit 1 exit 1
fi fi