-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-invariant-only.sh
More file actions
46 lines (36 loc) Β· 1.31 KB
/
run-invariant-only.sh
File metadata and controls
46 lines (36 loc) Β· 1.31 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
#!/bin/bash
# Run only Invariant Tests (if fuzz tests already completed)
# Configuration: 1M runs, depth 20 (proven to work)
echo "π Running Invariant Tests Only (1M runs, depth 20)..."
echo "=========================================="
echo ""
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
# Create test-reports directory if it doesn't exist
mkdir -p test-reports
echo "β³ This will take approximately 20-25 minutes..."
echo ""
FOUNDRY_PROFILE=maximum forge test \
--match-contract ZeroMoonInvariantTest \
--json > "test-reports/invariant-maximum-${TIMESTAMP}.json" 2>&1
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo ""
echo "β
Invariant tests completed successfully!"
echo "π JSON log: test-reports/invariant-maximum-${TIMESTAMP}.json"
echo ""
echo "π Configuration used:"
echo " - Runs: 1,000,000 per invariant"
echo " - Depth: 20 calls per sequence"
echo " - Total: ~20,000,000 function calls"
else
echo ""
echo "β Invariant tests failed (exit code: $EXIT_CODE)"
echo "π JSON log: test-reports/invariant-maximum-${TIMESTAMP}.json"
echo ""
if [ $EXIT_CODE -eq 137 ]; then
echo "β οΈ Process was killed (likely out of memory)"
echo " Try using the audit profile instead: ./test/run-invariant-safe.sh"
fi
fi
echo ""
echo "β¨ Done!"