-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_integrated_tests.sh
More file actions
executable file
·100 lines (98 loc) · 3.2 KB
/
run_integrated_tests.sh
File metadata and controls
executable file
·100 lines (98 loc) · 3.2 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
test_suites=(
"Cancun"
"Pyspecs"
"Shanghai"
"VMTests"
"stArgsZeroOneBalance"
"stAttackTest"
"stBadOpcode"
"stBugs"
"stCallCodes"
"stCallCreateCallCodeTest"
"stCallDelegateCodesCallCodeHomestead"
"stCallDelegateCodesHomestead"
"stChainId"
"stCodeCopyTest"
"stCodeSizeLimit"
"stCreate2"
"stCreateTest"
"stDelegatecallTestHomestead"
"stEIP150Specific"
"stEIP150singleCodeGasPrices"
# "stEIP1559" // skip creation transactions
"stEIP158Specific"
"stEIP2930"
"stEIP3607"
"stExample"
"stExtCodeHash"
"stHomesteadSpecific"
"stInitCodeTest"
"stLogTests"
"stMemExpandingEIP150Calls"
"stMemoryStressTest"
"stMemoryTest"
"stNonZeroCallsTest"
"stPreCompiledContracts"
"stPreCompiledContracts2"
"stQuadraticComplexityTest"
"stRandom"
"stRandom2"
"stRecursiveCreate"
"stRefundTest"
"stReturnDataTest"
"stRevertTest"
"stSLoadTest"
"stSStoreTest"
"stSelfBalance"
"stShift"
"stSolidityTest"
"stSpecialTest"
"stStackTests"
"stStaticCall"
"stStaticFlagEnabled"
"stSystemOperationsTest"
"stTimeConsuming"
"stTransactionTest"
"stTransitionTest"
"stWalletTest"
"stZeroCallsRevert"
"stZeroCallsTest"
"stZeroKnowledge"
"stZeroKnowledge2"
)
log_backfix=".log"
if [ "$#" -eq 2 ] && [ "$2" == "sanitizer" ]; then
log_backfix="_sanitizer.log"
fi
# Parse command line argument
if [ "$1" == "run" ]; then
for test_suite in "${test_suites[@]}"; do
./build/vscode/bin/debug/integrated_vm_tests --gtest_filter="GeneralStateTests_$test_suite*" > logs/$test_suite$log_backfix 2>&1
done
elif [ "$1" == "count" ]; then
for test_suite in "${test_suites[@]}"; do
log_file="logs/${test_suite}${log_backfix}"
if [ -f "$log_file" ]; then
# Count total tests
total_tests=$(tail -n 1000 "$log_file" | grep -oP '\[\s*==========\s*\]\s*\d+\s*test' | grep -oP '\d+')
# Count passed tests
passed_tests=$(tail -n 1000 "$log_file" | grep -oP '\[\s*PASSED\s*\]\s*\d+\s*test' | grep -oP '\d+' || echo 0)
# Count failed tests
failed_tests=$(tail -n 1000 "$log_file" | grep -oP '\[\s*FAILED\s*\]\s*\d+\s*test' | grep -oP '\d+' || echo 0)
# Count skipped tests
skipped_tests=$(tail -n 1000 "$log_file" | grep -oP '\[\s*SKIPPED\s*\]\s*\d+\s*test' | grep -oP '\d+' || echo 0)
# Extract the number of errors from the sanitizer log file
error_summary=$(tail -n 1 "$log_file" | grep -oP '(?<=ERROR SUMMARY: )\d+')
printf "%-37s - Total: %-5s Passed: %-5s Failed: %-5s Skipped: %-5s Errors: %-5s\n" \
"$test_suite" "$total_tests" "$passed_tests" "$failed_tests" "$skipped_tests" "$error_summary"
else
printf "%-37s - File not found.\n" "$test_suite"
fi
done
else
echo "Usage: $0 <run|count> [sanitizer]"
echo " run - Execute the test suites and log the output."
echo " sanitizer - flag to run the test suites with sanitizer."
echo " count - Count the errors from the sanitizer logs."
echo " sanitizer - flag to count sanitizer errors."
fi