Skip to content

Commit 1fede2c

Browse files
authored
Use Makefile for generating regression tests (#2580)
* Use Makefile for evm proof * Add kollect-file, use upcoming evm Makefile changes * Clean-up evm part of script * Use Makefile for wasm tests * CLean-up * Review: replace with shift 2
1 parent f77318a commit 1fede2c

File tree

1 file changed

+40
-37
lines changed

1 file changed

+40
-37
lines changed

scripts/generate-regression-tests.sh

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@ kollect() {
77
local name="$1"
88
shift
99
echo '#!/bin/sh' > "$name.sh"
10-
"$@" --save-temps --dry-run | xargs $KORE/scripts/kollect.sh "$name" >> "$name.sh"
10+
"$@" | xargs $KORE/scripts/kollect.sh "$name" >> "$name.sh"
11+
chmod +x "$name.sh"
12+
}
13+
14+
kollect-file() {
15+
local name="$1"
16+
local path="$2"
17+
shift 2
18+
echo '#!/bin/sh' > "$name.sh"
19+
"$@"
20+
cat $path | xargs $KORE/scripts/kollect.sh "$name" >> "$name.sh"
1121
chmod +x "$name.sh"
1222
}
1323

@@ -32,63 +42,56 @@ build-wasm() {
3242
generate-evm() {
3343
cd $KORE/evm-semantics
3444

35-
kollect test-pop1 \
36-
kevm run --backend haskell \
37-
--mode VMTESTS --schedule DEFAULT \
38-
tests/ethereum-tests/VMTests/vmIOandFlowOperations/pop1.json
39-
40-
kollect test-add0 env \
41-
kevm run --backend haskell \
42-
--mode VMTESTS --schedule DEFAULT \
43-
tests/ethereum-tests/VMTests/vmArithmeticTest/add0.json \
44-
45-
kollect test-sumTo10 \
46-
kevm run --backend haskell \
47-
--mode VMTESTS --schedule DEFAULT \
48-
tests/interactive/sumTo10.evm \
45+
export \
46+
TEST_CONCRETE_BACKEND=haskell \
47+
TEST_SYMBOLIC_BACKEND=haskell \
48+
TEST_OPTIONS="--dry-run --save-temps" \
49+
CHECK=true \
50+
KEEP_OUTPUTS=true
51+
52+
local testpop1=tests/ethereum-tests/VMTests/vmIOandFlowOperations/pop1.json
53+
local testadd0=tests/ethereum-tests/VMTests/vmArithmeticTest/add0.json
54+
local testsumTo10=tests/interactive/sumTo10.evm
55+
56+
kollect-file test-pop1 "$testpop1.haskell-out" \
57+
make "$testpop1.run-interactive" -e
58+
59+
kollect-file test-add0 "$testadd0.haskell-out" \
60+
make "$testadd0.run-interactive" -e
61+
62+
kollect-file test-sumTo10 $testsumTo10.haskell-out \
63+
make "$testsumTo10.run-interactive" -e
4964

5065
for search in \
5166
branching-no-invalid straight-line-no-invalid \
5267
branching-invalid straight-line
5368
do
54-
kollect "test-$search" \
55-
kevm search --backend haskell \
56-
"tests/interactive/search/$search.evm" \
57-
"<statusCode> EVMC_INVALID_INSTRUCTION </statusCode>"
69+
kollect-file "test-$search" "tests/interactive/search/$search.evm.search-out" \
70+
make "tests/interactive/search/$search.evm.search" -e
5871
done
5972

6073
kollect test-sum-to-n \
61-
kevm prove --backend haskell \
62-
tests/specs/examples/sum-to-n-spec.k \
63-
VERIFICATION --format-failures
64-
74+
make tests/specs/examples/sum-to-n-spec.k.prove -e
75+
6576
$KORE/scripts/trim-source-paths.sh *.kore
6677
}
6778

6879
generate-wasm() {
6980
cd $KORE/wasm-semantics
7081

82+
export KPROVE_OPTS="--dry-run --save-temps"
83+
7184
for spec in \
7285
simple-arithmetic \
7386
locals \
74-
loops
87+
loops \
88+
memory \
89+
wrc20
7590
do
7691
kollect "test-$spec" \
77-
./kwasm prove --backend haskell \
78-
tests/proofs/"$spec"-spec.k \
79-
KWASM-LEMMAS
92+
make tests/proofs/"$spec"-spec.k.prove -e
8093
done
8194

82-
kollect "test-memory" \
83-
./kwasm prove --backend haskell \
84-
tests/proofs/memory-spec.k \
85-
KWASM-LEMMAS \
86-
--concrete-rules WASM-DATA.wrap-Positive,WASM-DATA.setRange-Positive,WASM-DATA.getRange-Positive
87-
88-
kollect "test-wrc20" \
89-
./kwasm prove --backend haskell tests/proofs/wrc20-spec.k WRC20-LEMMAS --format-failures \
90-
--concrete-rules WASM-DATA.wrap-Positive,WASM-DATA.setRange-Positive,WASM-DATA.getRange-Positive,WASM-DATA.get-Existing,WASM-DATA.set-Extend
91-
9295
$KORE/scripts/trim-source-paths.sh *.kore
9396
}
9497

0 commit comments

Comments
 (0)