-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-tests.sh
More file actions
executable file
·55 lines (46 loc) · 1.16 KB
/
run-tests.sh
File metadata and controls
executable file
·55 lines (46 loc) · 1.16 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
#!/bin/bash
# run-tests.sh - Test runner for IPCrypt Lua implementation
set -e
echo "================================"
echo "IPCrypt Lua Test Suite"
echo "================================"
echo ""
# Colors for output
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Track test results
TESTS_PASSED=0
TESTS_FAILED=0
# Function to run a test
run_test() {
local name=$1
local script=$2
echo -n "Running $name... "
if cd tests && lua "$script" > /dev/null 2>&1; then
echo -e "${GREEN}✓ PASSED${NC}"
((TESTS_PASSED++))
else
echo -e "${RED}✗ FAILED${NC}"
((TESTS_FAILED++))
cd tests && lua "$script" 2>&1 | sed 's/^/ /'
fi
cd ..
}
# Run tests
run_test "Test Vectors" "test_vectors.lua"
run_test "Random Generation" "test_random.lua"
# Summary
echo ""
echo "================================"
echo "Test Summary"
echo "================================"
echo -e "Passed: ${GREEN}$TESTS_PASSED${NC}"
echo -e "Failed: ${RED}$TESTS_FAILED${NC}"
if [ $TESTS_FAILED -eq 0 ]; then
echo -e "\n${GREEN}All tests passed!${NC}"
exit 0
else
echo -e "\n${RED}Some tests failed!${NC}"
exit 1
fi