forked from Ammaar-Alam/tigertype
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-tests.sh
More file actions
executable file
·89 lines (77 loc) · 1.96 KB
/
run-tests.sh
File metadata and controls
executable file
·89 lines (77 loc) · 1.96 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
# TigerType Test Runner
# This script runs tests for TigerType codebase
# Set colors for output
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
BOLD='\033[1m'
NC='\033[0m' # No Color
# Default choice
DEFAULT_CHOICE=2
# Show header
echo -e "${YELLOW}${BOLD}TigerType Test Runner${NC}"
echo -e "${CYAN}=============================${NC}"
echo ""
# Function to run tests with nice output
run_tests() {
TEST_TYPE=$1
COMMAND=$2
echo -e "${YELLOW}Running $TEST_TYPE Tests...${NC}"
echo -e "${CYAN}Command: $COMMAND${NC}"
echo -e "${CYAN}------------------------------${NC}"
# Run the test command
eval $COMMAND
# Check exit status
if [ $? -eq 0 ]; then
echo -e "${GREEN}✓ $TEST_TYPE Tests Passed${NC}"
else
echo -e "${RED}✗ $TEST_TYPE Tests Failed${NC}"
fi
echo ""
}
# Ask what tests to run
echo -e "${BOLD}What tests would you like to run?${NC}"
echo "1. All Tests (Server + Client) - Standard Output"
echo -e "${YELLOW}2. All Tests (Server + Client) - With Progress Bar${NC} [Default]"
echo "3. Server Tests Only"
echo "4. Client Tests Only"
echo "5. Client Tests with Progress Bar"
echo "6. Exit"
read -p "Enter your choice (1-6) or press Enter for default: " choice
# Use default if empty
if [ -z "$choice" ]; then
choice=$DEFAULT_CHOICE
echo "Using default choice: $DEFAULT_CHOICE"
fi
case $choice in
1)
run_tests "All" "npm run test:all"
;;
2)
run_tests "All (Pretty)" "npm run test:all:pretty"
;;
3)
run_tests "Server" "npm run test:server"
;;
4)
run_tests "Client" "npm run test:client"
;;
5)
run_tests "Client (Pretty)" "npm run test:client:progress"
;;
6)
echo "Exiting..."
exit 0
;;
*)
echo -e "${RED}Invalid choice. Exiting...${NC}"
exit 1
;;
esac
# Final message
echo -e "${YELLOW}Test Run Complete${NC}"
echo "See above for test results and any failures."
echo "Fix any failing tests before merging your changes."
echo ""