-
Notifications
You must be signed in to change notification settings - Fork 44
Add script to regenerate regression tests #2465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f1f0412
WIP: generate evm tests
ana-pantilie fd57bf2
Write part of script which regenerates evm-semantics
ana-pantilie d6ccf83
Rename evm regression test dir
ana-pantilie 204e129
Revert "Rename evm regression test dir"
ana-pantilie 8064832
Merge remote-tracking branch 'origin/master' into regenerate-test-script
ana-pantilie e93b888
Rename evm regression test dir
ana-pantilie d50f6b5
Rename wasm regression test dir
ana-pantilie ba8b9d0
Remove duplicated wasm directory
ana-pantilie b6164eb
Actually rename wasm dir
ana-pantilie 59f49bd
Add part of script which regenerates wasm-semantics
ana-pantilie ed7690f
Remove generate scripts from test dirs
ana-pantilie feb5441
Reintroduce changes to kollect script
ana-pantilie b256e8f
Do not build K for wasm-semantics
ana-pantilie 9b5bc42
Merge branch 'master' into regenerate-test-script
rv-jenkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -exuo pipefail | ||
|
||
kollect() { | ||
local name="$1" | ||
shift | ||
echo '#!/bin/sh' > "$name.sh" | ||
"$@" --save-temps --dry-run | xargs $KORE/scripts/kollect.sh "$name" >> "$name.sh" | ||
chmod +x "$name.sh" | ||
} | ||
|
||
build-evm() { | ||
cd $KORE | ||
git clone [email protected]:kframework/evm-semantics.git | ||
cd evm-semantics | ||
git submodule update --init --recursive | ||
make plugin-deps | ||
make build-haskell | ||
export PATH=$(pwd)/.build/usr/bin:$PATH | ||
} | ||
|
||
build-wasm() { | ||
cd $KORE | ||
git clone [email protected]:kframework/wasm-semantics.git | ||
cd wasm-semantics | ||
git submodule update --init --recursive | ||
make build-haskell | ||
} | ||
|
||
generate-evm() { | ||
cd $KORE/evm-semantics | ||
|
||
kollect test-pop1 env MODE=VMTESTS SCHEDULE=DEFAULT \ | ||
kevm run --backend haskell \ | ||
tests/ethereum-tests/VMTests/vmIOandFlowOperations/pop1.json | ||
|
||
kollect test-add0 env MODE=VMTESTS SCHEDULE=DEFAULT \ | ||
kevm run --backend haskell \ | ||
tests/ethereum-tests/VMTests/vmArithmeticTest/add0.json \ | ||
|
||
kollect test-sumTo10 env MODE=VMTESTS SCHEDULE=DEFAULT \ | ||
kevm run --backend haskell \ | ||
tests/interactive/sumTo10.evm \ | ||
|
||
for search in \ | ||
branching-no-invalid straight-line-no-invalid \ | ||
branching-invalid straight-line | ||
do | ||
kollect "test-$search" \ | ||
kevm search --backend haskell \ | ||
"tests/interactive/search/$search.evm" \ | ||
"<statusCode> EVMC_INVALID_INSTRUCTION </statusCode>" | ||
done | ||
|
||
kollect test-sum-to-n \ | ||
kevm prove --backend haskell \ | ||
tests/specs/examples/sum-to-n-spec.k \ | ||
VERIFICATION --format-failures | ||
} | ||
|
||
generate-wasm() { | ||
cd $KORE/wasm-semantics | ||
|
||
for spec in \ | ||
simple-arithmetic \ | ||
locals \ | ||
loops | ||
do | ||
kollect "test-$spec" \ | ||
./kwasm prove --backend haskell \ | ||
tests/proofs/"$spec"-spec.k \ | ||
KWASM-LEMMAS | ||
done | ||
|
||
kollect "test-memory" \ | ||
./kwasm prove --backend haskell \ | ||
tests/proofs/memory-spec.k \ | ||
KWASM-LEMMAS \ | ||
--concrete-rules WASM-DATA.wrap-Positive,WASM-DATA.setRange-Positive,WASM-DATA.getRange-Positive | ||
|
||
kollect "test-wrc20" \ | ||
./kwasm prove --backend haskell tests/proofs/wrc20-spec.k WRC20-LEMMAS --format-failures \ | ||
--concrete-rules WASM-DATA.wrap-Positive,WASM-DATA.setRange-Positive,WASM-DATA.getRange-Positive,WASM-DATA.get-Existing,WASM-DATA.set-Extend | ||
} | ||
|
||
replace-tests() { | ||
local testdir=$KORE/$1 | ||
local tests=$KORE/$2/test-* | ||
|
||
if [ -d $testdir ] | ||
then | ||
rm $testdir/test-* | ||
else | ||
mkdir $testdir | ||
echo "include \$(CURDIR)/../include.mk" > $testdir/Makefile | ||
echo "" >> $testdir/Makefile | ||
echo "test-%.sh.out: \$(TEST_DIR)/test-%-*" >> $testdir/Makefile | ||
fi | ||
mv $tests $testdir | ||
} | ||
|
||
build-evm | ||
generate-evm | ||
replace-tests "test/regression-evm" "evm-semantics" | ||
rm -rf $KORE/evm-semantics | ||
|
||
build-wasm | ||
generate-wasm | ||
replace-tests "test/regression-wasm" "wasm-semantics" | ||
rm -rf $KORE/wasm-semantics |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @MirceaS originally wrote this, it was included in one of the PRs he had to revert, but I suppose this was also reverted by accident.
Without this change to
kollect
, we wouldn't be able to extract the files generated by the frontend, because on the latest versions the way the temporary files are named has changed.