Skip to content

Commit 7eb6a01

Browse files
committed
Changing tests
1 parent fdbf45a commit 7eb6a01

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

analysis/tests/run-tests.sh

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,47 @@
11
#!/bin/bash
22

3+
# Move to analysis directory where the ash binary is located
34
cd ..
45

56
PASS_COUNT=0
67
FAIL_COUNT=0
78

8-
echo "Running positive tests..."
9+
GREEN='\033[0;32m'
10+
RED='\033[0;31m'
11+
YELLOW='\033[1;33m'
12+
NC='\033[0m' # No Color
13+
14+
echo -e "${YELLOW}Running positive tests...${NC}"
915
for file in tests/positive/*.ash; do
10-
echo "$file"
16+
echo "$file"
1117
./ash < "$file" > /dev/null
1218
if [ $? -eq 0 ]; then
13-
echo " Passed"
19+
echo -e "${GREEN} Passed${NC}"
1420
((PASS_COUNT++))
1521
else
16-
echo "Unexpected failure: $file"
22+
echo -e "${RED}Unexpected failure: $file${NC}"
1723
((FAIL_COUNT++))
1824
fi
1925
echo
2026
done
2127

22-
echo "🔍 Running negative tests..."
28+
echo -e "${YELLOW}Running negative tests...${NC}"
2329
for file in tests/negative/*.ash; do
24-
echo "$file"
30+
echo "$file"
2531
./ash < "$file" > /dev/null
2632
if [ $? -ne 0 ]; then
27-
echo "Correctly failed"
33+
echo -e "${GREEN}Correctly failed${NC}"
2834
((PASS_COUNT++))
2935
else
30-
echo "Unexpected pass: $file"
36+
echo -e "${RED}Unexpected pass: $file${NC}"
3137
((FAIL_COUNT++))
3238
fi
3339
echo
3440
done
3541

36-
echo "Total passed: $PASS_COUNT"
37-
echo "Total failed: $FAIL_COUNT"
42+
echo -e "${YELLOW}Summary:${NC}"
43+
echo -e "${GREEN}✔ Total passed: $PASS_COUNT${NC}"
44+
echo -e "${RED}✘ Total failed: $FAIL_COUNT${NC}"
3845

3946
if [ $FAIL_COUNT -ne 0 ]; then
4047
exit 1

0 commit comments

Comments
 (0)