Skip to content

Commit

Permalink
vendor: update pingcap check (#5812)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackysp authored and tiancaiamao committed Feb 7, 2018
1 parent 2f8b1d2 commit 9665073
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
16 changes: 15 additions & 1 deletion _vendor/src/github.com/pingcap/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ type RunConf struct {
BenchmarkTime time.Duration // Defaults to 1 second
BenchmarkMem bool
KeepWorkDir bool
Exclude string
}

// Create a new suiteRunner able to run all methods in the given suite.
Expand Down Expand Up @@ -578,6 +579,17 @@ func newSuiteRunner(suite interface{}, runConf *RunConf) *suiteRunner {
}
}

var excludeRegexp *regexp.Regexp
if conf.Exclude != "" {
if regexp, err := regexp.Compile(conf.Exclude); err != nil {
msg := "Bad exclude expression: " + err.Error()
runner.tracker.result.RunError = errors.New(msg)
return runner
} else {
excludeRegexp = regexp
}
}

for i := 0; i != suiteNumMethods; i++ {
method := newMethod(suiteValue, i)
switch method.Info.Name {
Expand All @@ -598,7 +610,9 @@ func newSuiteRunner(suite interface{}, runConf *RunConf) *suiteRunner {
continue
}
if filterRegexp == nil || method.matches(filterRegexp) {
runner.tests = append(runner.tests, method)
if excludeRegexp == nil || !method.matches(excludeRegexp) {
runner.tests = append(runner.tests, method)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion _vendor/src/github.com/pingcap/check/checkers.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ type hasLenChecker struct {

// The HasLen checker verifies that the obtained value has the
// provided length. In many cases this is superior to using Equals
// in conjuction with the len function because in case the check
// in conjunction with the len function because in case the check
// fails the value itself will be printed, instead of its length,
// providing more details for figuring the problem.
//
Expand Down
2 changes: 2 additions & 0 deletions _vendor/src/github.com/pingcap/check/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var (
newBenchMem = flag.Bool("check.bmem", false, "Report memory benchmarks")
newListFlag = flag.Bool("check.list", false, "List the names of all tests that will be run")
newWorkFlag = flag.Bool("check.work", false, "Display and do not remove the test working directory")
newExcludeFlag = flag.String("check.exclude", "", "Regular expression to exclude tests to run")
)

var CustomVerboseFlag bool
Expand All @@ -62,6 +63,7 @@ func TestingT(testingT *testing.T) {
BenchmarkTime: benchTime,
BenchmarkMem: *newBenchMem,
KeepWorkDir: *oldWorkFlag || *newWorkFlag,
Exclude: *newExcludeFlag,
}
if *oldListFlag || *newListFlag {
w := bufio.NewWriter(os.Stdout)
Expand Down
2 changes: 1 addition & 1 deletion glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import:
- package: github.com/peterh/liner
version: 3f3a91ddf7d2784892a58e27ddf48d70e3304bb7
- package: github.com/pingcap/check
version: 9b266636177e249ec28b0aeffe8e86bc272bb481
version: 1c287c953996ab3a0bf535dba9d53d809d3dc0b6
- package: github.com/pingcap/goleveldb
version: 8d44bfdf1030639ae7130922c95df12d6d4da3b6
subpackages:
Expand Down

0 comments on commit 9665073

Please sign in to comment.