Skip to content

Commit 099c383

Browse files
ehildenbDwight Guth
authored andcommitted
Generic test updater via CHECK variable (#576)
* Makefile: use -R to swap argument order to CHECK * Makefile: no need for specific Web3 updaters * Jenkinsfile: use LLVM backend for parse tests
1 parent ee1cc19 commit 099c383

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ pipeline {
130130
'''
131131
}
132132
}
133-
stage('OCaml kast') {
133+
stage('LLVM Kast') {
134134
steps {
135135
sh '''
136-
make test-parse TEST_CONCRETE_BACKEND=ocaml
136+
make test-parse TEST_CONCRETE_BACKEND=llvm
137137
'''
138138
}
139139
}

Makefile

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export LUA_PATH
4444
split-tests \
4545
test test-all test-conformance test-rest-conformance test-all-conformance \
4646
test-vm test-rest-vm test-all-vm test-bchain test-rest-bchain test-all-bchain \
47-
test-web3 update-web3 \
47+
test-web3 \
4848
test-prove test-prove-benchmarks test-prove-functional test-prove-opcodes test-prove-erc20 test-prove-bihu test-prove-examples test-klab-prove \
4949
test-parse test-failure \
5050
test-interactive test-interactive-help test-interactive-run test-interactive-prove test-interactive-search test-interactive-firefly \
@@ -368,9 +368,8 @@ release.md: INSTALL.md
368368
TEST_CONCRETE_BACKEND := llvm
369369
TEST_SYMBOLIC_BACKEND := java
370370

371-
TEST := ./kevm
372-
CHECK := git --no-pager diff --no-index --ignore-all-space
373-
UPDATE := cp
371+
TEST := ./kevm
372+
CHECK := git --no-pager diff --no-index --ignore-all-space -R
374373

375374
KEVM_MODE := NORMAL
376375
KEVM_SCHEDULE := PETERSBURG
@@ -396,34 +395,29 @@ tests/ethereum-tests/VMTests/%: KEVM_SCHEDULE=DEFAULT
396395

397396
tests/%.run: tests/%
398397
MODE=$(KEVM_MODE) SCHEDULE=$(KEVM_SCHEDULE) $(TEST) interpret --backend $(TEST_CONCRETE_BACKEND) $< > tests/$*.$(TEST_CONCRETE_BACKEND)-out \
399-
|| $(CHECK) tests/templates/output-success-$(TEST_CONCRETE_BACKEND).json tests/$*.$(TEST_CONCRETE_BACKEND)-out
398+
|| $(CHECK) tests/$*.$(TEST_CONCRETE_BACKEND)-out tests/templates/output-success-$(TEST_CONCRETE_BACKEND).json
400399
rm -rf tests/$*.$(TEST_CONCRETE_BACKEND)-out
401400

402401
tests/%.run-interactive: tests/%
403402
MODE=$(KEVM_MODE) SCHEDULE=$(KEVM_SCHEDULE) $(TEST) run --backend $(TEST_CONCRETE_BACKEND) $< > tests/$*.$(TEST_CONCRETE_BACKEND)-out \
404-
|| $(CHECK) tests/templates/output-success-$(TEST_CONCRETE_BACKEND).json tests/$*.$(TEST_CONCRETE_BACKEND)-out
403+
|| $(CHECK) tests/$*.$(TEST_CONCRETE_BACKEND)-out tests/templates/output-success-$(TEST_CONCRETE_BACKEND).json
405404
rm -rf tests/$*.$(TEST_CONCRETE_BACKEND)-out
406405

407406
tests/%.run-expected: tests/% tests/%.expected
408407
MODE=$(KEVM_MODE) SCHEDULE=$(KEVM_SCHEDULE) $(TEST) run --backend $(TEST_CONCRETE_BACKEND) $< > tests/$*.$(TEST_CONCRETE_BACKEND)-out \
409-
|| $(CHECK) tests/$*.expected tests/$*.$(TEST_CONCRETE_BACKEND)-out
408+
|| $(CHECK) tests/$*.$(TEST_CONCRETE_BACKEND)-out tests/$*.expected
410409
rm -rf tests/$*.$(TEST_CONCRETE_BACKEND)-out
411410

412411
tests/web3/no-shutdown/%: KEVM_WEB3_ARGS=
413412

414413
tests/%.run-web3: tests/%.in.json
415414
tests/web3/runtest.sh $< tests/$*.out.json $(KEVM_WEB3_ARGS)
416-
$(CHECK) tests/$*.expected.json tests/$*.out.json
417-
rm -rf tests/$*.out.json
418-
419-
tests/%.update-web3: tests/%.in.json
420-
tests/web3/runtest.sh $< tests/$*.out.json $(KEVM_WEB3_ARGS)
421-
$(UPDATE) tests/$*.out.json tests/$*.expected.json
415+
$(CHECK) tests/$*.out.json tests/$*.expected.json
422416
rm -rf tests/$*.out.json
423417

424418
tests/%.parse: tests/%
425419
$(TEST) kast --backend $(TEST_CONCRETE_BACKEND) $< kast > $@-out
426-
$(CHECK) $@-expected $@-out
420+
$(CHECK) $@-out $@-expected
427421
rm -rf $@-out
428422

429423
tests/specs/functional/%.prove: TEST_SYMBOLIC_BACKEND=haskell
@@ -434,7 +428,7 @@ tests/%.prove: tests/%
434428

435429
tests/%.search: tests/%
436430
$(TEST) search --backend $(TEST_SYMBOLIC_BACKEND) $< "<statusCode> EVMC_INVALID_INSTRUCTION </statusCode>" > $@-out
437-
$(CHECK) $@-expected $@-out
431+
$(CHECK) $@-out $@-expected
438432
rm -rf $@-out
439433

440434
tests/%.klab-prove: tests/%
@@ -481,7 +475,6 @@ web3_tests=$(wildcard tests/web3/*.in.json) \
481475
$(wildcard tests/web3/no-shutdown/*.in.json)
482476

483477
test-web3: $(web3_tests:.in.json=.run-web3)
484-
update-web3: $(web3_tests:.in.json=.update-web3)
485478

486479
# Proof Tests
487480

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
`___ETHEREUM-SIMULATION`(`mkAcct__STATE-LOADER`(#token("7","Int")),`___ETHEREUM-SIMULATION`(`load__STATE-LOADER`(`_:__EVM-DATA`(#token("\"account\"","String"),`{_}_EVM-DATA`(`_,__EVM-DATA`(`_:__EVM-DATA`(#token("7","Int"),`{_}_EVM-DATA`(`_,__EVM-DATA`(`_:__EVM-DATA`(#token("\"balance\"","String"),#token("1000000000","Int")),`_,__EVM-DATA`(`_:__EVM-DATA`(#token("\"nonce\"","String"),#token("1","Int")),`_,__EVM-DATA`(`_:__EVM-DATA`(#token("\"code\"","String"),`.ByteArray_EVM-DATA`(.KList)),`_,__EVM-DATA`(`_:__EVM-DATA`(#token("\"storage\"","String"),`.Map`(.KList)),`.List{"_,__EVM-DATA"}`(.KList))))))),`.List{"_,__EVM-DATA"}`(.KList))))),`___ETHEREUM-SIMULATION`(`load__STATE-LOADER`(`_:__EVM-DATA`(#token("\"exec\"","String"),`{_}_EVM-DATA`(`_,__EVM-DATA`(`_:__EVM-DATA`(#token("\"address\"","String"),#token("7","Int")),`_,__EVM-DATA`(`_:__EVM-DATA`(#token("\"gas\"","String"),#token("100000","Int")),`_,__EVM-DATA`(`_:__EVM-DATA`(#token("\"code\"","String"),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("0","Int")),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("0","Int")),`_;__EVM-ASSEMBLY`(`MSTORE_EVM`(.KList),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("10","Int")),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("32","Int")),`_;__EVM-ASSEMBLY`(`MSTORE_EVM`(.KList),`_;__EVM-ASSEMBLY`(`JUMPDEST_EVM`(.KList),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("32","Int")),`_;__EVM-ASSEMBLY`(`MLOAD_EVM`(.KList),`_;__EVM-ASSEMBLY`(`ISZERO_EVM`(.KList),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("411","Int")),`_;__EVM-ASSEMBLY`(`JUMPI_EVM`(.KList),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("32","Int")),`_;__EVM-ASSEMBLY`(`MLOAD_EVM`(.KList),`_;__EVM-ASSEMBLY`(`DUP`(#token("1","Int")),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("0","Int")),`_;__EVM-ASSEMBLY`(`MLOAD_EVM`(.KList),`_;__EVM-ASSEMBLY`(`ADD_EVM`(.KList),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("0","Int")),`_;__EVM-ASSEMBLY`(`MSTORE_EVM`(.KList),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("1","Int")),`_;__EVM-ASSEMBLY`(`SWAP`(#token("1","Int")),`_;__EVM-ASSEMBLY`(`SUB_EVM`(.KList),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("32","Int")),`_;__EVM-ASSEMBLY`(`MSTORE_EVM`(.KList),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("134","Int")),`_;__EVM-ASSEMBLY`(`JUMP_EVM`(.KList),`_;__EVM-ASSEMBLY`(`JUMPDEST_EVM`(.KList),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("0","Int")),`_;__EVM-ASSEMBLY`(`MLOAD_EVM`(.KList),`_;__EVM-ASSEMBLY`(`PUSHAsm`(#token("32","Int"),#token("0","Int")),`_;__EVM-ASSEMBLY`(`SSTORE_EVM`(.KList),`.OpCodes_EVM-ASSEMBLY`(.KList)))))))))))))))))))))))))))))))))),`.List{"_,__EVM-DATA"}`(.KList))))))),`___ETHEREUM-SIMULATION`(`start_ETHEREUM-SIMULATION`(.KList),`___ETHEREUM-SIMULATION`(`check__ETHEREUM-SIMULATION`(`_:__EVM-DATA`(#token("\"account\"","String"),`{_}_EVM-DATA`(`_,__EVM-DATA`(`_:__EVM-DATA`(#token("7","Int"),`{_}_EVM-DATA`(`_,__EVM-DATA`(`_:__EVM-DATA`(#token("\"storage\"","String"),`{_}_EVM-DATA`(`_,__EVM-DATA`(`_:__EVM-DATA`(#token("\"0x00\"","String"),#token("\"0x37\"","String")),`.List{"_,__EVM-DATA"}`(.KList)))),`.List{"_,__EVM-DATA"}`(.KList)))),`.List{"_,__EVM-DATA"}`(.KList))))),`___ETHEREUM-SIMULATION`(`failure__ETHEREUM-SIMULATION`(#token("\"Interactive sumTo10 test\"","String")),`___ETHEREUM-SIMULATION`(`success_ETHEREUM-SIMULATION`(.KList),`___ETHEREUM-SIMULATION`(`clear_STATE-LOADER`(.KList),`.EthereumSimulation_ETHEREUM-SIMULATION`(.KList)))))))))
1+
`___ETHEREUM-SIMULATION_EthereumSimulation_EthereumCommand_EthereumSimulation`(`mkAcct__STATE-LOADER_EthereumCommand_Int`(#token("7","Int")),`___ETHEREUM-SIMULATION_EthereumSimulation_EthereumCommand_EthereumSimulation`(`load__STATE-LOADER_EthereumCommand_JSON`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("\"account\"","String"),`{_}_EVM-DATA_JSON_JSONList`(`_,__EVM-DATA_JSONList_JSON_JSONList`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("7","Int"),`{_}_EVM-DATA_JSON_JSONList`(`_,__EVM-DATA_JSONList_JSON_JSONList`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("\"balance\"","String"),#token("1000000000","Int")),`_,__EVM-DATA_JSONList_JSON_JSONList`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("\"nonce\"","String"),#token("1","Int")),`_,__EVM-DATA_JSONList_JSON_JSONList`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("\"code\"","String"),`.ByteArray_EVM-DATA_ByteArray`(.KList)),`_,__EVM-DATA_JSONList_JSON_JSONList`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("\"storage\"","String"),`.Map`(.KList)),`.List{"_,__EVM-DATA_JSONList_JSON_JSONList"}_JSONList`(.KList))))))),`.List{"_,__EVM-DATA_JSONList_JSON_JSONList"}_JSONList`(.KList))))),`___ETHEREUM-SIMULATION_EthereumSimulation_EthereumCommand_EthereumSimulation`(`load__STATE-LOADER_EthereumCommand_JSON`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("\"exec\"","String"),`{_}_EVM-DATA_JSON_JSONList`(`_,__EVM-DATA_JSONList_JSON_JSONList`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("\"address\"","String"),#token("7","Int")),`_,__EVM-DATA_JSONList_JSON_JSONList`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("\"gas\"","String"),#token("100000","Int")),`_,__EVM-DATA_JSONList_JSON_JSONList`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("\"code\"","String"),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("0","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("0","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`MSTORE_EVM_BinStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("10","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("32","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`MSTORE_EVM_BinStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`JUMPDEST_EVM_NullStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("32","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`MLOAD_EVM_UnStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`ISZERO_EVM_UnStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("411","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`JUMPI_EVM_BinStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("32","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`MLOAD_EVM_UnStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`DUP(_)_EVM_StackOp_Int`(#token("1","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("0","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`MLOAD_EVM_UnStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`ADD_EVM_BinStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("0","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`MSTORE_EVM_BinStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("1","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`SWAP(_)_EVM_StackOp_Int`(#token("1","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`SUB_EVM_BinStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("32","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`MSTORE_EVM_BinStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("134","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`JUMP_EVM_UnStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`JUMPDEST_EVM_NullStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("0","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`MLOAD_EVM_UnStackOp`(.KList),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`PUSH(_,_)_EVM-ASSEMBLY_OpCode_Int_Int`(#token("32","Int"),#token("0","Int")),`_;__EVM-ASSEMBLY_OpCodes_OpCode_OpCodes`(`SSTORE_EVM_BinStackOp`(.KList),`.OpCodes_EVM-ASSEMBLY_OpCodes`(.KList)))))))))))))))))))))))))))))))))),`.List{"_,__EVM-DATA_JSONList_JSON_JSONList"}_JSONList`(.KList))))))),`___ETHEREUM-SIMULATION_EthereumSimulation_EthereumCommand_EthereumSimulation`(`start_ETHEREUM-SIMULATION_EthereumCommand`(.KList),`___ETHEREUM-SIMULATION_EthereumSimulation_EthereumCommand_EthereumSimulation`(`check__ETHEREUM-SIMULATION_EthereumCommand_JSON`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("\"account\"","String"),`{_}_EVM-DATA_JSON_JSONList`(`_,__EVM-DATA_JSONList_JSON_JSONList`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("7","Int"),`{_}_EVM-DATA_JSON_JSONList`(`_,__EVM-DATA_JSONList_JSON_JSONList`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("\"storage\"","String"),`{_}_EVM-DATA_JSON_JSONList`(`_,__EVM-DATA_JSONList_JSON_JSONList`(`_:__EVM-DATA_JSON_JSONKey_JSON`(#token("\"0x00\"","String"),#token("\"0x37\"","String")),`.List{"_,__EVM-DATA_JSONList_JSON_JSONList"}_JSONList`(.KList)))),`.List{"_,__EVM-DATA_JSONList_JSON_JSONList"}_JSONList`(.KList)))),`.List{"_,__EVM-DATA_JSONList_JSON_JSONList"}_JSONList`(.KList))))),`___ETHEREUM-SIMULATION_EthereumSimulation_EthereumCommand_EthereumSimulation`(`failure__ETHEREUM-SIMULATION_EthereumCommand_String`(#token("\"Interactive sumTo10 test\"","String")),`___ETHEREUM-SIMULATION_EthereumSimulation_EthereumCommand_EthereumSimulation`(`success_ETHEREUM-SIMULATION_EthereumCommand`(.KList),`___ETHEREUM-SIMULATION_EthereumSimulation_EthereumCommand_EthereumSimulation`(`clear_STATE-LOADER_EthereumCommand`(.KList),`.EthereumSimulation_ETHEREUM-SIMULATION_EthereumSimulation`(.KList)))))))))
22

0 commit comments

Comments
 (0)