diff options
author | Martin Holst Swende <martin@swende.se> | 2018-09-04 16:49:18 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-09-04 16:49:18 +0800 |
commit | 32f28a9360d26a661d55915915f12fd3c70f012b (patch) | |
tree | 870134b45677ea479b6fca7983d48eb362c12b4d /tests/init_test.go | |
parent | 6a33954731658667056466bf7573ed1c397f4750 (diff) | |
download | dexon-32f28a9360d26a661d55915915f12fd3c70f012b.tar dexon-32f28a9360d26a661d55915915f12fd3c70f012b.tar.gz dexon-32f28a9360d26a661d55915915f12fd3c70f012b.tar.bz2 dexon-32f28a9360d26a661d55915915f12fd3c70f012b.tar.lz dexon-32f28a9360d26a661d55915915f12fd3c70f012b.tar.xz dexon-32f28a9360d26a661d55915915f12fd3c70f012b.tar.zst dexon-32f28a9360d26a661d55915915f12fd3c70f012b.zip |
core/vm, tests: update tests, enable constantinople statetests, fix SAR opcode (#17538)
This commit does a few things at once:
- Updates the tests to contain the latest data from ethereum/tests repo.
- Enables Constantinople state tests. This is needed to be able to
fuzz-test the evm with constantinople rules.
- Fixes the error in opSAR that we've known about for some time. I was
kind of saving it to see if we hit upon it with the random test
generator, but it's difficult to both enable the tests and have the
bug there -- we don't want to forget about it, so maybe it's better
to just fix it.
Diffstat (limited to 'tests/init_test.go')
-rw-r--r-- | tests/init_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/init_test.go b/tests/init_test.go index 26e919d24..90a74448a 100644 --- a/tests/init_test.go +++ b/tests/init_test.go @@ -91,6 +91,7 @@ type testMatcher struct { failpat []testFailure skiploadpat []*regexp.Regexp skipshortpat []*regexp.Regexp + whitelistpat *regexp.Regexp } type testConfig struct { @@ -121,6 +122,10 @@ func (tm *testMatcher) fails(pattern string, reason string) { tm.failpat = append(tm.failpat, testFailure{regexp.MustCompile(pattern), reason}) } +func (tm *testMatcher) whitelist(pattern string) { + tm.whitelistpat = regexp.MustCompile(pattern) +} + // config defines chain config for tests matching the pattern. func (tm *testMatcher) config(pattern string, cfg params.ChainConfig) { tm.configpat = append(tm.configpat, testConfig{regexp.MustCompile(pattern), cfg}) @@ -208,6 +213,11 @@ func (tm *testMatcher) runTestFile(t *testing.T, path, name string, runTest inte if r, _ := tm.findSkip(name); r != "" { t.Skip(r) } + if tm.whitelistpat != nil { + if !tm.whitelistpat.MatchString(name) { + t.Skip("Skipped by whitelist") + } + } t.Parallel() // Load the file as map[string]<testType>. |