diff options
author | Paweł Bylica <chfast@gmail.com> | 2018-11-26 23:09:32 +0800 |
---|---|---|
committer | Guillaume Ballet <gballet@gmail.com> | 2018-11-26 23:09:32 +0800 |
commit | 0699287440527dedbc7d6f881fc466057b7822bc (patch) | |
tree | 6383d4af331e350db8908d3da11d616b5755998d /tests | |
parent | 197d609b9a3a9b5436a9902dcc8db38bb3e7543b (diff) | |
download | dexon-0699287440527dedbc7d6f881fc466057b7822bc.tar.gz dexon-0699287440527dedbc7d6f881fc466057b7822bc.tar.zst dexon-0699287440527dedbc7d6f881fc466057b7822bc.zip |
tests: Add flag to use EVMC for state tests (#18084)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/state_test.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/state_test.go b/tests/state_test.go index ad77e4f33..964405382 100644 --- a/tests/state_test.go +++ b/tests/state_test.go @@ -18,10 +18,12 @@ package tests import ( "bytes" + "flag" "fmt" "reflect" "testing" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/core/vm" ) @@ -65,8 +67,17 @@ func TestState(t *testing.T) { // Transactions with gasLimit above this value will not get a VM trace on failure. const traceErrorLimit = 400000 +// The VM config for state tests that accepts --vm.* command line arguments. +var testVMConfig = func() vm.Config { + vmconfig := vm.Config{} + flag.StringVar(&vmconfig.EVMInterpreter, utils.EVMInterpreterFlag.Name, utils.EVMInterpreterFlag.Value, utils.EVMInterpreterFlag.Usage) + flag.StringVar(&vmconfig.EWASMInterpreter, utils.EWASMInterpreterFlag.Name, utils.EWASMInterpreterFlag.Value, utils.EWASMInterpreterFlag.Usage) + flag.Parse() + return vmconfig +}() + func withTrace(t *testing.T, gasLimit uint64, test func(vm.Config) error) { - err := test(vm.Config{}) + err := test(testVMConfig) if err == nil { return } |