-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun-tests
More file actions
executable file
·51 lines (45 loc) · 1.08 KB
/
Copy pathrun-tests
File metadata and controls
executable file
·51 lines (45 loc) · 1.08 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
#!/usr/bin/env bash
# Run all dirtree tests
set -uo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
errors=0
echo "=== Zig unit tests ==="
if zig build test 2>&1; then
echo "Zig unit tests: PASS"
else
echo "Zig unit tests: FAIL"
((errors++))
fi
echo ""
echo "=== Bash integration tests ==="
if [[ -x "$SCRIPT_DIR/test/dirtree_test" ]]; then
if "$SCRIPT_DIR/test/dirtree_test" 2>&1; then
echo "Integration tests: PASS"
else
((errors+=$?))
echo "Integration tests: FAIL"
fi
else
echo "Integration test script not found at $SCRIPT_DIR/test/dirtree_test"
((errors++))
fi
echo ""
echo "=== Build-tooling tests (flake staleness) ==="
if [[ -x "$SCRIPT_DIR/test/build_staleness_test" ]]; then
if "$SCRIPT_DIR/test/build_staleness_test" 2>&1; then
echo "Build-tooling tests: PASS"
else
((errors++))
echo "Build-tooling tests: FAIL"
fi
else
echo "Build-tooling test script not found at $SCRIPT_DIR/test/build_staleness_test"
((errors++))
fi
echo ""
if [[ $errors -eq 0 ]]; then
echo "All tests passed."
else
echo "$errors test suite(s) failed."
fi
exit $errors