Skip to content

Commit

Permalink
tests: Add flag to use EVMC for state tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Nov 14, 2018
1 parent 58632d4 commit d935379
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package tests

import (
"bytes"
"flag"
"fmt"
"reflect"
"testing"
Expand Down Expand Up @@ -65,8 +66,15 @@ func TestState(t *testing.T) {
// Transactions with gasLimit above this value will not get a VM trace on failure.
const traceErrorLimit = 400000

var testVMConfig = func() vm.Config {
vmconfig := vm.Config{}
flag.StringVar(&vmconfig.EVMInterpreter, "vm.evm", "", "External EVM configuration (default = built-in interpreter)")
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
}
Expand Down

0 comments on commit d935379

Please sign in to comment.