Skip to content

Commit

Permalink
core/vm: instruction tests (#16327)
Browse files Browse the repository at this point in the history
This PR makes it easy to generate and execute testcases for VM arithmetic operations. By enabling and running the testcase TestWriteExpectedValues, a set of json files are created which contain input and output for each arith operation.
The test TestJsonTestcases executes all of those tests.

While meaningless as is, this PR makes it less risky to make changes (optimizations) to the vm operations, since there will be a larger body of testcases.
  • Loading branch information
holiman authored Apr 4, 2019
1 parent 5164274 commit 36b78ab
Show file tree
Hide file tree
Showing 22 changed files with 159 additions and 87 deletions.
225 changes: 138 additions & 87 deletions core/vm/instructions_test.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_add.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_and.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_byte.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_div.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_eq.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_exp.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_gt.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_lt.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_mod.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_mul.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_or.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_sar.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_sdiv.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_sgt.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_shl.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_shr.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_signext.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_slt.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_smod.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_sub.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/vm/testdata/testcases_xor.json

Large diffs are not rendered by default.

0 comments on commit 36b78ab

Please sign in to comment.