aboutsummaryrefslogtreecommitdiff
path: root/spec/cli/run_all_tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'spec/cli/run_all_tests.sh')
-rwxr-xr-xspec/cli/run_all_tests.sh77
1 files changed, 77 insertions, 0 deletions
diff --git a/spec/cli/run_all_tests.sh b/spec/cli/run_all_tests.sh
new file mode 100755
index 0000000..0067bba
--- /dev/null
+++ b/spec/cli/run_all_tests.sh
@@ -0,0 +1,77 @@
1#!/bin/bash
2# Main test runner for YueScript CLI
3# Runs all CLI test suites
4
5SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
7# Colors
8RED='\033[0;31m'
9GREEN='\033[0;32m'
10YELLOW='\033[1;33m'
11BLUE='\033[0;34m'
12NC='\033[0m' # No Color
13
14echo -e "${BLUE}======================================"
15echo "YueScript CLI Test Suite"
16echo "======================================${NC}"
17echo ""
18
19# Check if yue binary exists
20YUE_BIN="${YUE_BIN:-./bin/debug/yue}"
21if [ ! -f "$YUE_BIN" ]; then
22 echo -e "${RED}Error: yue binary not found at $YUE_BIN${NC}"
23 echo "Please build the project first:"
24 echo " make debug"
25 echo "Or set YUE_BIN environment variable"
26 exit 1
27fi
28
29# Track overall results
30TOTAL_SUITES=0
31PASSED_SUITES=0
32FAILED_SUITES=0
33
34# Function to run a test suite
35run_test_suite() {
36 local suite_name="$1"
37 local suite_file="$2"
38
39 TOTAL_SUITES=$((TOTAL_SUITES + 1))
40 echo ""
41 echo -e "${BLUE}Running: $suite_name${NC}"
42 echo "======================================"
43
44 if bash "$suite_file"; then
45 echo -e "${GREEN}✓ $suite_name PASSED${NC}"
46 PASSED_SUITES=$((PASSED_SUITES + 1))
47 return 0
48 else
49 echo -e "${RED}✗ $suite_name FAILED${NC}"
50 FAILED_SUITES=$((FAILED_SUITES + 1))
51 return 1
52 fi
53}
54
55# Run all test suites
56run_test_suite "Basic Options Test" "$SCRIPT_DIR/test_basic_options.sh"
57run_test_suite "Compilation Test" "$SCRIPT_DIR/test_compilation.sh"
58run_test_suite "Error Handling Test" "$SCRIPT_DIR/test_error_handling.sh"
59run_test_suite "Execution Test" "$SCRIPT_DIR/test_execution.sh"
60
61# Print final summary
62echo ""
63echo -e "${BLUE}======================================"
64echo "Final Test Suite Summary"
65echo "======================================${NC}"
66echo "Total test suites: $TOTAL_SUITES"
67echo -e "Passed: ${GREEN}$PASSED_SUITES${NC}"
68echo -e "Failed: ${RED}$FAILED_SUITES${NC}"
69echo "======================================"
70
71if [ $FAILED_SUITES -eq 0 ]; then
72 echo -e "${GREEN}All test suites passed!${NC}"
73 exit 0
74else
75 echo -e "${RED}Some test suites failed!${NC}"
76 exit 1
77fi