-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_all.sh
More file actions
executable file
·50 lines (41 loc) · 840 Bytes
/
test_all.sh
File metadata and controls
executable file
·50 lines (41 loc) · 840 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
set -o pipefail
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
# Track results
declare -a failed_tests=()
run_test() {
local name="$1"
shift
echo "=== $name ==="
"$@"
local status=$?
if [ $status -eq 0 ]; then
echo -e "${GREEN}[$name] OK${NC}"
else
echo -e "${RED}[$name] FAILED${NC}"
failed_tests+=("$name")
fi
return $status
}
echo ""
# Run all tests
run_test "analyzer" \
go test -v ./...
run_test "lint" \
golangci-lint run ./...
# Summary
echo ""
echo "===== Summary ====="
if [ ${#failed_tests[@]} -eq 0 ]; then
echo -e "${GREEN}All tests passed!${NC}"
exit 0
else
echo -e "${RED}Failed tests:${NC}"
for test in "${failed_tests[@]}"; do
echo -e " ${RED}- $test${NC}"
done
exit 1
fi