-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_all_errors.sh
More file actions
executable file
·36 lines (28 loc) · 981 Bytes
/
test_all_errors.sh
File metadata and controls
executable file
·36 lines (28 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
echo "=== Testing Lexer Errors ==="
echo "1. Unterminated char literal:"
cargo run tests/fixtures/error_unterminated_char.c 2>&1 | head -5
echo
echo "2. Illegal character:"
cargo run tests/fixtures/error_invalid_token.c 2>&1 | head -5
echo
echo "=== Testing Parser Errors ==="
echo "3. Missing semicolon:"
cargo run tests/fixtures/error_missing_semicolon.c 2>&1 | head -5
echo
echo "=== Testing Semantic Errors ==="
echo "4. Undefined variable:"
cargo run tests/fixtures/error_undefined_var.c 2>&1 | head -5
echo
echo "5. Type mismatch:"
cargo run tests/fixtures/error_type_mismatch.c 2>&1 | head -5
echo
echo "6. Break outside loop:"
cargo run tests/fixtures/error_break_outside_loop.c 2>&1 | head -5
echo
echo "7. Duplicate declaration:"
cargo run tests/fixtures/error_duplicate_declaration.c 2>&1 | head -5
echo
echo "=== Testing Successful Compilation ==="
echo "8. Valid program (should output IR):"
cargo run tests/fixtures/error_success.c 2>&1 | head -10