Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
85afdeef
Unverified
Commit
85afdeef
authored
Jul 29, 2021
by
baptiste-b-pegasys
Committed by
GitHub
Jul 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: remove whitelist feature (#23297)
parent
860184d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
25 deletions
+4
-25
init_test.go
tests/init_test.go
+4
-25
No files found.
tests/init_test.go
View file @
85afdeef
...
...
@@ -89,11 +89,10 @@ func findLine(data []byte, offset int64) (line int) {
// testMatcher controls skipping and chain config assignment to tests.
type
testMatcher
struct
{
configpat
[]
testConfig
failpat
[]
testFailure
skiploadpat
[]
*
regexp
.
Regexp
slowpat
[]
*
regexp
.
Regexp
whitelistpat
*
regexp
.
Regexp
configpat
[]
testConfig
failpat
[]
testFailure
skiploadpat
[]
*
regexp
.
Regexp
slowpat
[]
*
regexp
.
Regexp
}
type
testConfig
struct
{
...
...
@@ -124,10 +123,6 @@ 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
})
...
...
@@ -217,11 +212,6 @@ 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>.
...
...
@@ -275,14 +265,3 @@ func runTestFunc(runTest interface{}, t *testing.T, name string, m reflect.Value
m
.
MapIndex
(
reflect
.
ValueOf
(
key
)),
})
}
func
TestMatcherWhitelist
(
t
*
testing
.
T
)
{
t
.
Parallel
()
tm
:=
new
(
testMatcher
)
tm
.
whitelist
(
"invalid*"
)
tm
.
walk
(
t
,
rlpTestDir
,
func
(
t
*
testing
.
T
,
name
string
,
test
*
RLPTest
)
{
if
name
[
:
len
(
"invalidRLPTest.json"
)]
!=
"invalidRLPTest.json"
{
t
.
Fatalf
(
"invalid test found: %s != invalidRLPTest.json"
,
name
)
}
})
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment