Skip to content

Commit 0ef8fd6

Browse files
ehildenbrv-jenkins
authored andcommitted
Option --no-unparse to kevm script (#597)
* kevm: add option to skip unparsing unconditionally * Makefile: enable passing options through to kevm command * kevm: compact option parsing * Jenkinsfile: bump timeout for execution tests 15 => 20 minutes
1 parent 1f5e719 commit 0ef8fd6

File tree

3 files changed

+35
-43
lines changed

3 files changed

+35
-43
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pipeline {
5151
}
5252
stage('Test Execution') {
5353
failFast true
54-
options { timeout(time: 15, unit: 'MINUTES') }
54+
options { timeout(time: 20, unit: 'MINUTES') }
5555
parallel {
5656
stage('Conformance (OCaml)') {
5757
steps {

Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,9 @@ release.md: INSTALL.md
370370
TEST_CONCRETE_BACKEND := llvm
371371
TEST_SYMBOLIC_BACKEND := java
372372

373-
TEST := ./kevm
374-
CHECK := git --no-pager diff --no-index --ignore-all-space -R
373+
TEST := ./kevm
374+
TEST_OPTIONS :=
375+
CHECK := git --no-pager diff --no-index --ignore-all-space -R
375376

376377
KEVM_MODE := NORMAL
377378
KEVM_SCHEDULE := PETERSBURG
@@ -396,17 +397,17 @@ tests/ethereum-tests/VMTests/%: KEVM_MODE=VMTESTS
396397
tests/ethereum-tests/VMTests/%: KEVM_SCHEDULE=DEFAULT
397398

398399
tests/%.run: tests/%
399-
MODE=$(KEVM_MODE) SCHEDULE=$(KEVM_SCHEDULE) $(TEST) interpret --backend $(TEST_CONCRETE_BACKEND) $< > tests/$*.$(TEST_CONCRETE_BACKEND)-out \
400+
MODE=$(KEVM_MODE) SCHEDULE=$(KEVM_SCHEDULE) $(TEST) interpret $(TEST_OPTIONS) --backend $(TEST_CONCRETE_BACKEND) $< > tests/$*.$(TEST_CONCRETE_BACKEND)-out \
400401
|| $(CHECK) tests/$*.$(TEST_CONCRETE_BACKEND)-out tests/templates/output-success-$(TEST_CONCRETE_BACKEND).json
401402
rm -rf tests/$*.$(TEST_CONCRETE_BACKEND)-out
402403

403404
tests/%.run-interactive: tests/%
404-
MODE=$(KEVM_MODE) SCHEDULE=$(KEVM_SCHEDULE) $(TEST) run --backend $(TEST_CONCRETE_BACKEND) $< > tests/$*.$(TEST_CONCRETE_BACKEND)-out \
405+
MODE=$(KEVM_MODE) SCHEDULE=$(KEVM_SCHEDULE) $(TEST) run $(TEST_OPTIONS) --backend $(TEST_CONCRETE_BACKEND) $< > tests/$*.$(TEST_CONCRETE_BACKEND)-out \
405406
|| $(CHECK) tests/$*.$(TEST_CONCRETE_BACKEND)-out tests/templates/output-success-$(TEST_CONCRETE_BACKEND).json
406407
rm -rf tests/$*.$(TEST_CONCRETE_BACKEND)-out
407408

408409
tests/%.run-expected: tests/% tests/%.expected
409-
MODE=$(KEVM_MODE) SCHEDULE=$(KEVM_SCHEDULE) $(TEST) run --backend $(TEST_CONCRETE_BACKEND) $< > tests/$*.$(TEST_CONCRETE_BACKEND)-out \
410+
MODE=$(KEVM_MODE) SCHEDULE=$(KEVM_SCHEDULE) $(TEST) run $(TEST_OPTIONS) --backend $(TEST_CONCRETE_BACKEND) $< > tests/$*.$(TEST_CONCRETE_BACKEND)-out \
410411
|| $(CHECK) tests/$*.$(TEST_CONCRETE_BACKEND)-out tests/$*.expected
411412
rm -rf tests/$*.$(TEST_CONCRETE_BACKEND)-out
412413

@@ -418,23 +419,23 @@ tests/%.run-web3: tests/%.in.json
418419
rm -rf tests/$*.out.json
419420

420421
tests/%.parse: tests/%
421-
$(TEST) kast --backend $(TEST_CONCRETE_BACKEND) $< kast > $@-out
422+
$(TEST) kast $(TEST_OPTIONS) --backend $(TEST_CONCRETE_BACKEND) $< kast > $@-out
422423
$(CHECK) $@-out $@-expected
423424
rm -rf $@-out
424425

425426
tests/specs/functional/%.prove: TEST_SYMBOLIC_BACKEND=haskell
426427
tests/specs/functional/storageRoot-spec.k.prove: TEST_SYMBOLIC_BACKEND=java
427428

428429
tests/%.prove: tests/%
429-
$(TEST) prove --backend $(TEST_SYMBOLIC_BACKEND) $< --format-failures --def-module $(KPROVE_MODULE) $(KPROVE_OPTIONS)
430+
$(TEST) prove $(TEST_OPTIONS) --backend $(TEST_SYMBOLIC_BACKEND) $< --format-failures --def-module $(KPROVE_MODULE) $(KPROVE_OPTIONS)
430431

431432
tests/%.search: tests/%
432-
$(TEST) search --backend $(TEST_SYMBOLIC_BACKEND) $< "<statusCode> EVMC_INVALID_INSTRUCTION </statusCode>" > $@-out
433+
$(TEST) search $(TEST_OPTIONS) --backend $(TEST_SYMBOLIC_BACKEND) $< "<statusCode> EVMC_INVALID_INSTRUCTION </statusCode>" > $@-out
433434
$(CHECK) $@-out $@-expected
434435
rm -rf $@-out
435436

436437
tests/%.klab-prove: tests/%
437-
$(TEST) klab-prove --backend $(TEST_SYMBOLIC_BACKEND) $< --format-failures --def-module $(KPROVE_MODULE) $(KPROVE_OPTIONS)
438+
$(TEST) klab-prove $(TEST_OPTIONS) --backend $(TEST_SYMBOLIC_BACKEND) $< --format-failures --def-module $(KPROVE_MODULE) $(KPROVE_OPTIONS)
438439

439440
# Smoke Tests
440441

kevm

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -179,21 +179,21 @@ run_interpret() {
179179
-c SCHEDULE "$cSCHEDULE" text -c MODE "$cMODE" text --initializer 'initKevmCell' \
180180
--output-file "$output" "$@" \
181181
|| exit_status="$?"
182-
if [[ "$exit_status" != '0' ]]; then
182+
if [[ "$unparse" == 'true' ]] && [[ "$exit_status" != '0' ]]; then
183183
k-bin-to-text "$output" "$output_text"
184184
cat "$output_text"
185-
exit "$exit_status"
186185
fi
186+
exit "$exit_status"
187187
;;
188188

189189
llvm) run_kast kore > "$kast"
190190
if $debug; then debugger="gdb --args"; fi
191191
$debugger "$interpreter" "$kast" -1 "$output_text" "$@" \
192192
|| exit_status="$?"
193-
if [[ "$exit_status" != '0' ]]; then
193+
if [[ "$unparse" == 'true' ]] && [[ "$exit_status" != '0' ]]; then
194194
cat "$output_text" | "$0" kast --backend "$backend" - pretty --input "$output_format" --sort GeneratedTopCell
195-
exit "$exit_status"
196195
fi
196+
exit "$exit_status"
197197
;;
198198

199199
*) fatal "Bad backend for interpreter: '$backend'"
@@ -208,17 +208,17 @@ run_command="$1" ; shift
208208

209209
if [[ "$run_command" == 'help' ]] || [[ "$run_command" == '--help' ]] ; then
210210
echo "
211-
usage: $0 run [--backend (ocaml|java|llvm|haskell)] <pgm> <K arg>*
212-
$0 interpret [--backend (ocaml|llvm)] [--debug] <pgm> <interpreter arg>*
213-
$0 kast [--backend (ocaml|java|llvm|haskell|web3)] <pgm> <output format> <K arg>*
214-
$0 prove [--backend (java|haskell)] <spec> <K arg>* -m <def_module>
215-
$0 search [--backend (java|haskell)] <pgm> <pattern> <K arg>*
216-
$0 web3 [--debug|--dump] <port>
217-
$0 web3-ganache [--debug|--dump] <port>
218-
$0 web3-send <port> <web3 method> <web3 params>
219-
$0 klab-run <pgm> <K arg>*
220-
$0 klab-prove <spec> <K arg>* -m <def_module>
221-
$0 klab-view <spec>
211+
usage: $0 run [--backend (ocaml|java|llvm|haskell)] <pgm> <K arg>*
212+
$0 interpret [--backend (ocaml|llvm)] [--debug|--no-unparse] <pgm> <interpreter arg>*
213+
$0 kast [--backend (ocaml|java|llvm|haskell|web3)] <pgm> <output format> <K arg>*
214+
$0 prove [--backend (java|haskell)] <spec> <K arg>* -m <def_module>
215+
$0 search [--backend (java|haskell)] <pgm> <pattern> <K arg>*
216+
$0 web3 [--debug|--dump] <port>
217+
$0 web3-ganache [--debug|--dump] <port>
218+
$0 web3-send <port> <web3 method> <web3 params>
219+
$0 klab-run <pgm> <K arg>*
220+
$0 klab-prove <spec> <K arg>* -m <def_module>
221+
$0 klab-view <spec>
222222
223223
$0 [help|--help|version|--version]
224224
@@ -265,28 +265,19 @@ fi
265265
backend="llvm"
266266
debug=false
267267
dump=false
268+
unparse=true
268269
[[ ! "$run_command" == 'prove' ]] || backend='java'
269270
[[ ! "$run_command" =~ klab* ]] || backend='java'
270271
[[ ! "$run_command" =~ web3* ]] || backend='llvm'
271272
while [[ $# -gt 0 ]]; do
272-
arg="$1"
273-
case $arg in
274-
--backend)
275-
backend="$2"
276-
shift 2
277-
;;
278-
--debug)
279-
debug=true
280-
shift
281-
;;
282-
--dump)
283-
dump=true
284-
shift
285-
;;
286-
*)
287-
break
288-
;;
289-
esac
273+
arg="$1"
274+
case $arg in
275+
--backend) backend="$2" ; shift 2 ;;
276+
--debug) debug=true ; shift ;;
277+
--dump) dump=true ; shift ;;
278+
--no-unparse) unparse=false ; shift ;;
279+
*) break ;;
280+
esac
290281
done
291282
backend_dir="$defn_dir/$backend"
292283
[[ ! "$backend" == "ocaml" ]] || eval $(${OPAM:-opam} config env)

0 commit comments

Comments
 (0)