|
|
@ -25,7 +25,6 @@ import ( |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"path/filepath" |
|
|
|
"path/filepath" |
|
|
|
"reflect" |
|
|
|
"reflect" |
|
|
|
"runtime" |
|
|
|
|
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
"testing" |
|
|
|
"testing" |
|
|
|
"time" |
|
|
|
"time" |
|
|
@ -99,15 +98,20 @@ func TestExecutionSpecState(t *testing.T) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func execStateTest(t *testing.T, st *testMatcher, test *StateTest) { |
|
|
|
func execStateTest(t *testing.T, st *testMatcher, test *StateTest) { |
|
|
|
if runtime.GOARCH == "386" && runtime.GOOS == "windows" && rand.Int63()%2 == 0 { |
|
|
|
|
|
|
|
t.Skip("test (randomly) skipped on 32-bit windows") |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for _, subtest := range test.Subtests() { |
|
|
|
for _, subtest := range test.Subtests() { |
|
|
|
subtest := subtest |
|
|
|
subtest := subtest |
|
|
|
key := fmt.Sprintf("%s/%d", subtest.Fork, subtest.Index) |
|
|
|
key := fmt.Sprintf("%s/%d", subtest.Fork, subtest.Index) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If -short flag is used, we don't execute all four permutations, only
|
|
|
|
|
|
|
|
// one.
|
|
|
|
|
|
|
|
executionMask := 0xf |
|
|
|
|
|
|
|
if testing.Short() { |
|
|
|
|
|
|
|
executionMask = (1 << (rand.Int63() & 4)) |
|
|
|
|
|
|
|
} |
|
|
|
t.Run(key+"/hash/trie", func(t *testing.T) { |
|
|
|
t.Run(key+"/hash/trie", func(t *testing.T) { |
|
|
|
|
|
|
|
if executionMask&0x1 == 0 { |
|
|
|
|
|
|
|
t.Skip("test (randomly) skipped due to short-tag") |
|
|
|
|
|
|
|
} |
|
|
|
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error { |
|
|
|
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error { |
|
|
|
var result error |
|
|
|
var result error |
|
|
|
test.Run(subtest, vmconfig, false, rawdb.HashScheme, func(err error, state *StateTestState) { |
|
|
|
test.Run(subtest, vmconfig, false, rawdb.HashScheme, func(err error, state *StateTestState) { |
|
|
@ -117,6 +121,9 @@ func execStateTest(t *testing.T, st *testMatcher, test *StateTest) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
t.Run(key+"/hash/snap", func(t *testing.T) { |
|
|
|
t.Run(key+"/hash/snap", func(t *testing.T) { |
|
|
|
|
|
|
|
if executionMask&0x2 == 0 { |
|
|
|
|
|
|
|
t.Skip("test (randomly) skipped due to short-tag") |
|
|
|
|
|
|
|
} |
|
|
|
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error { |
|
|
|
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error { |
|
|
|
var result error |
|
|
|
var result error |
|
|
|
test.Run(subtest, vmconfig, true, rawdb.HashScheme, func(err error, state *StateTestState) { |
|
|
|
test.Run(subtest, vmconfig, true, rawdb.HashScheme, func(err error, state *StateTestState) { |
|
|
@ -132,6 +139,9 @@ func execStateTest(t *testing.T, st *testMatcher, test *StateTest) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
t.Run(key+"/path/trie", func(t *testing.T) { |
|
|
|
t.Run(key+"/path/trie", func(t *testing.T) { |
|
|
|
|
|
|
|
if executionMask&0x4 == 0 { |
|
|
|
|
|
|
|
t.Skip("test (randomly) skipped due to short-tag") |
|
|
|
|
|
|
|
} |
|
|
|
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error { |
|
|
|
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error { |
|
|
|
var result error |
|
|
|
var result error |
|
|
|
test.Run(subtest, vmconfig, false, rawdb.PathScheme, func(err error, state *StateTestState) { |
|
|
|
test.Run(subtest, vmconfig, false, rawdb.PathScheme, func(err error, state *StateTestState) { |
|
|
@ -141,6 +151,9 @@ func execStateTest(t *testing.T, st *testMatcher, test *StateTest) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
t.Run(key+"/path/snap", func(t *testing.T) { |
|
|
|
t.Run(key+"/path/snap", func(t *testing.T) { |
|
|
|
|
|
|
|
if executionMask&0x8 == 0 { |
|
|
|
|
|
|
|
t.Skip("test (randomly) skipped due to short-tag") |
|
|
|
|
|
|
|
} |
|
|
|
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error { |
|
|
|
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error { |
|
|
|
var result error |
|
|
|
var result error |
|
|
|
test.Run(subtest, vmconfig, true, rawdb.PathScheme, func(err error, state *StateTestState) { |
|
|
|
test.Run(subtest, vmconfig, true, rawdb.PathScheme, func(err error, state *StateTestState) { |
|
|
|