| 1 | package checkscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/ |
| 2 | |
| 3 | import ( |
| 4 | "bufioscip-go gomod github.com/golang/go/src go1.13 bufio/" |
| 5 | "flagscip-go gomod github.com/golang/go/src go1.13 flag/" |
| 6 | "fmtscip-go gomod github.com/golang/go/src go1.13 fmt/" |
| 7 | "osscip-go gomod github.com/golang/go/src go1.13 os/" |
| 8 | "syncscip-go gomod github.com/golang/go/src go1.13 sync/" |
| 9 | "testingscip-go gomod github.com/golang/go/src go1.13 testing/" |
| 10 | "timescip-go gomod github.com/golang/go/src go1.13 time/" |
| 11 | |
| 12 | "github.com/pingcap/logscip-go gomod github.com/pingcap/log b742a5d432e9 `github.com/pingcap/log`/" |
| 13 | "go.uber.org/zapscip-go gomod go.uber.org/zap v1.12.0 `go.uber.org/zap`/" |
| 14 | ) |
| 15 | |
| 16 | // ----------------------------------------------------------------------- |
| 17 | // Test suite registry. |
| 18 | |
| 19 | var ( |
| 20 | allParallelSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allParallelSuites. []interface{} |
| 21 | allSerialSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allSerialSuites. []interface{} |
| 22 | ) |
| 23 | |
| 24 | // Suite registers the given value as a test suite to be run. Any methods |
| 25 | // starting with the Test prefix in the given value will be considered as |
| 26 | // a test method. |
| 27 | func Suitescip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Suite().(suite interface{}) interface{} { |
| 28 | allParallelSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allParallelSuites. = append(allParallelSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allParallelSuites., suite) |
| 29 | return suite |
| 30 | } |
| 31 | |
| 32 | // SerialSuites registers the given value as a test suite to be run serially. Any methods |
| 33 | // starting with the Test prefix in the given value will be considered as |
| 34 | // a test method. |
| 35 | func SerialSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/SerialSuites().(suite interface{}) interface{} { |
| 36 | allSerialSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allSerialSuites. = append(allSerialSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allSerialSuites., suite) |
| 37 | return suite |
| 38 | } |
| 39 | |
| 40 | // ----------------------------------------------------------------------- |
| 41 | // Public running interface. |
| 42 | |
| 43 | var ( |
| 44 | oldFilterFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldFilterFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Stringscip-go gomod github.com/golang/go/src go1.13 flag/String().("gocheck.f", "", "Regular expression selecting which tests and/or suites to run") |
| 45 | oldVerboseFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldVerboseFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Boolscip-go gomod github.com/golang/go/src go1.13 flag/Bool().("gocheck.v", false, "Verbose mode") |
| 46 | oldStreamFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldStreamFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Boolscip-go gomod github.com/golang/go/src go1.13 flag/Bool().("gocheck.vv", false, "Super verbose mode (disables output caching)") |
| 47 | oldBenchFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldBenchFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Boolscip-go gomod github.com/golang/go/src go1.13 flag/Bool().("gocheck.b", false, "Run benchmarks") |
| 48 | oldBenchTimescip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldBenchTime. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Durationscip-go gomod github.com/golang/go/src go1.13 flag/Duration().("gocheck.btime", 1*timescip-go gomod github.com/golang/go/src go1.13 time/.Secondscip-go gomod github.com/golang/go/src go1.13 time/Second., "approximate run time for each benchmark") |
| 49 | oldListFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldListFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Boolscip-go gomod github.com/golang/go/src go1.13 flag/Bool().("gocheck.list", false, "List the names of all tests that will be run") |
| 50 | oldWorkFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldWorkFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Boolscip-go gomod github.com/golang/go/src go1.13 flag/Bool().("gocheck.work", false, "Display and do not remove the test working directory") |
| 51 | |
| 52 | newFilterFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newFilterFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Stringscip-go gomod github.com/golang/go/src go1.13 flag/String().("check.f", "", "Regular expression selecting which tests and/or suites to run") |
| 53 | newVerboseFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newVerboseFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Boolscip-go gomod github.com/golang/go/src go1.13 flag/Bool().("check.v", false, "Verbose mode") |
| 54 | newStreamFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newStreamFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Boolscip-go gomod github.com/golang/go/src go1.13 flag/Bool().("check.vv", false, "Super verbose mode (disables output caching)") |
| 55 | newBenchFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newBenchFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Boolscip-go gomod github.com/golang/go/src go1.13 flag/Bool().("check.b", false, "Run benchmarks") |
| 56 | newBenchTimescip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newBenchTime. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Durationscip-go gomod github.com/golang/go/src go1.13 flag/Duration().("check.btime", 1*timescip-go gomod github.com/golang/go/src go1.13 time/.Secondscip-go gomod github.com/golang/go/src go1.13 time/Second., "approximate run time for each benchmark") |
| 57 | methodTimeoutscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/methodTimeout. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Durationscip-go gomod github.com/golang/go/src go1.13 flag/Duration().("check.timeout", 0, "timeout value for each function") |
| 58 | newBenchMemscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newBenchMem. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Boolscip-go gomod github.com/golang/go/src go1.13 flag/Bool().("check.bmem", false, "Report memory benchmarks") |
| 59 | newListFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newListFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Boolscip-go gomod github.com/golang/go/src go1.13 flag/Bool().("check.list", false, "List the names of all tests that will be run") |
| 60 | newWorkFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newWorkFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Boolscip-go gomod github.com/golang/go/src go1.13 flag/Bool().("check.work", false, "Display and do not remove the test working directory") |
| 61 | newExcludeFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newExcludeFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Stringscip-go gomod github.com/golang/go/src go1.13 flag/String().("check.exclude", "", "Regular expression to exclude tests to run") |
| 62 | |
| 63 | CustomParallelSuiteFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/CustomParallelSuiteFlag. = flagscip-go gomod github.com/golang/go/src go1.13 flag/.Boolscip-go gomod github.com/golang/go/src go1.13 flag/Bool().("check.p", false, "Run suites in parallel") |
| 64 | ) |
| 65 | |
| 66 | var CustomVerboseFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/CustomVerboseFlag. bool |
| 67 | |
| 68 | // TestingT runs all test suites registered with the Suite function, |
| 69 | // printing results to stdout, and reporting any failures back to |
| 70 | // the "testing" package. |
| 71 | func TestingTscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/TestingT().(testingT *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 72 | l := zapscip-go gomod go.uber.org/zap v1.12.0 `go.uber.org/zap`/.NewAtomicLevelscip-go gomod go.uber.org/zap v1.12.0 `go.uber.org/zap`/NewAtomicLevel().() |
| 73 | if l.UnmarshalTextscip-go gomod go.uber.org/zap v1.12.0 `go.uber.org/zap`/AtomicLevel#UnmarshalText().([]byte(osscip-go gomod github.com/golang/go/src go1.13 os/.Getenvscip-go gomod github.com/golang/go/src go1.13 os/Getenv().("log_level"))) == nil { |
| 74 | logscip-go gomod github.com/pingcap/log b742a5d432e9 `github.com/pingcap/log`/.SetLevelscip-go gomod github.com/pingcap/log b742a5d432e9 `github.com/pingcap/log`/SetLevel().(l.Levelscip-go gomod go.uber.org/zap v1.12.0 `go.uber.org/zap`/AtomicLevel#Level().()) |
| 75 | } |
| 76 | benchTime := *newBenchTimescip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newBenchTime. |
| 77 | if benchTime == 1*timescip-go gomod github.com/golang/go/src go1.13 time/.Secondscip-go gomod github.com/golang/go/src go1.13 time/Second. { |
| 78 | benchTime = *oldBenchTimescip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldBenchTime. |
| 79 | } |
| 80 | conf := &RunConfscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#{ |
| 81 | Filterscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#Filter.: *oldFilterFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldFilterFlag. + *newFilterFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newFilterFlag., |
| 82 | Verbosescip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#Verbose.: *oldVerboseFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldVerboseFlag. || *newVerboseFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newVerboseFlag. || CustomVerboseFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/CustomVerboseFlag., |
| 83 | Streamscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#Stream.: *oldStreamFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldStreamFlag. || *newStreamFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newStreamFlag., |
| 84 | Benchmarkscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#Benchmark.: *oldBenchFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldBenchFlag. || *newBenchFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newBenchFlag., |
| 85 | BenchmarkTimescip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#BenchmarkTime.: benchTime, |
| 86 | MethodTimeoutscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#MethodTimeout.: *methodTimeoutscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/methodTimeout., |
| 87 | BenchmarkMemscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#BenchmarkMem.: *newBenchMemscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newBenchMem., |
| 88 | KeepWorkDirscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#KeepWorkDir.: *oldWorkFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldWorkFlag. || *newWorkFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newWorkFlag., |
| 89 | Excludescip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#Exclude.: *newExcludeFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newExcludeFlag., |
| 90 | } |
| 91 | if *oldListFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/oldListFlag. || *newListFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newListFlag. { |
| 92 | w := bufioscip-go gomod github.com/golang/go/src go1.13 bufio/.NewWriterscip-go gomod github.com/golang/go/src go1.13 bufio/NewWriter().(osscip-go gomod github.com/golang/go/src go1.13 os/.Stdoutscip-go gomod github.com/golang/go/src go1.13 os/Stdout.) |
| 93 | for _, name := range ListAllscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/ListAll().(conf) { |
| 94 | fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Fprintlnscip-go gomod github.com/golang/go/src go1.13 fmt/Fprintln().(w, name) |
| 95 | } |
| 96 | w.Flushscip-go gomod github.com/golang/go/src go1.13 bufio/Writer#Flush().() |
| 97 | return |
| 98 | } |
| 99 | result := RunAllscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunAll().(conf) |
| 100 | println(result.Stringscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#String().()) |
| 101 | if !result.Passedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Passed().() { |
| 102 | testingT.Failscip-go gomod github.com/golang/go/src go1.13 testing/common#Fail().() |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | // RunAll runs all test suites registered with the Suite function, using the |
| 107 | // provided run configuration. |
| 108 | func RunAllscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunAll().(runConf *RunConfscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#) *Resultscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result# { |
| 109 | result := Resultscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#{} |
| 110 | if !*CustomParallelSuiteFlagscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/CustomParallelSuiteFlag. { |
| 111 | // run all suites serially. |
| 112 | for _, suite := range allParallelSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allParallelSuites. { |
| 113 | result.Addscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Add().(Runscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Run().(suite, runConf)) |
| 114 | } |
| 115 | |
| 116 | for _, suite := range allSerialSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allSerialSuites. { |
| 117 | result.Addscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Add().(Runscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Run().(suite, runConf)) |
| 118 | } |
| 119 | return &result |
| 120 | } |
| 121 | |
| 122 | wg := syncscip-go gomod github.com/golang/go/src go1.13 sync/.WaitGroupscip-go gomod github.com/golang/go/src go1.13 sync/WaitGroup#{} |
| 123 | notifyRunningSuitesCh := make(chan struct{}) |
| 124 | suiteRunners := make([]*suiteRunnerscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/suiteRunner#, 0, len(allParallelSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allParallelSuites.)) |
| 125 | for _, suite := range allParallelSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allParallelSuites. { |
| 126 | suiteRunners = append(suiteRunners, parallelRunscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/parallelRun().(suite, runConf, &wg, notifyRunningSuitesCh)) |
| 127 | } |
| 128 | close(notifyRunningSuitesCh) |
| 129 | wg.Waitscip-go gomod github.com/golang/go/src go1.13 sync/WaitGroup#Wait().() |
| 130 | for _, runner := range suiteRunners { |
| 131 | ret := &runner.trackerscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/suiteRunner#tracker..resultscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/resultTracker#result. |
| 132 | result.Addscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Add().(ret) |
| 133 | } |
| 134 | |
| 135 | for _, suite := range allSerialSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allSerialSuites. { |
| 136 | result.Addscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Add().(Runscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Run().(suite, runConf)) |
| 137 | } |
| 138 | return &result |
| 139 | } |
| 140 | |
| 141 | func parallelRunscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/parallelRun().(suite interface{}, runConf *RunConfscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#, wg *syncscip-go gomod github.com/golang/go/src go1.13 sync/.WaitGroupscip-go gomod github.com/golang/go/src go1.13 sync/WaitGroup#, notifyRunningSuitesCh chan struct{}) *suiteRunnerscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/suiteRunner# { |
| 142 | runner := newSuiteRunnerscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newSuiteRunner().(suite, runConf) |
| 143 | runner.asyncRunscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/suiteRunner#asyncRun().(wg, notifyRunningSuitesCh) |
| 144 | return runner |
| 145 | } |
| 146 | |
| 147 | // Run runs the provided test suite using the provided run configuration. |
| 148 | func Runscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Run().(suite interface{}, runConf *RunConfscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#) *Resultscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result# { |
| 149 | runner := newSuiteRunnerscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newSuiteRunner().(suite, runConf) |
| 150 | return runner.runscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/suiteRunner#run().() |
| 151 | } |
| 152 | |
| 153 | // ListAll returns the names of all the test functions registered with the |
| 154 | // Suite function that will be run with the provided run configuration. |
| 155 | func ListAllscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/ListAll().(runConf *RunConfscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#) []string { |
| 156 | var names []string |
| 157 | for _, suite := range allParallelSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allParallelSuites. { |
| 158 | names = append(names, Listscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/List().(suite, runConf)...) |
| 159 | } |
| 160 | |
| 161 | for _, suite := range allSerialSuitesscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/allSerialSuites. { |
| 162 | names = append(names, Listscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/List().(suite, runConf)...) |
| 163 | } |
| 164 | return names |
| 165 | } |
| 166 | |
| 167 | // List returns the names of the test functions in the given |
| 168 | // suite that will be run with the provided run configuration. |
| 169 | func Listscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/List().(suite interface{}, runConf *RunConfscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/RunConf#) []string { |
| 170 | var names []string |
| 171 | runner := newSuiteRunnerscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/newSuiteRunner().(suite, runConf) |
| 172 | for _, t := range runner.testsscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/suiteRunner#tests. { |
| 173 | names = append(names, t.Stringscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/methodType#String().()) |
| 174 | } |
| 175 | return names |
| 176 | } |
| 177 | |
| 178 | // ----------------------------------------------------------------------- |
| 179 | // Result methods. |
| 180 | |
| 181 | func (r *Resultscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#) Addscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Add().(other *Resultscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#) { |
| 182 | r.Succeededscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Succeeded. += other.Succeededscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Succeeded. |
| 183 | r.Skippedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Skipped. += other.Skippedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Skipped. |
| 184 | r.Failedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Failed. += other.Failedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Failed. |
| 185 | r.Panickedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Panicked. += other.Panickedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Panicked. |
| 186 | r.FixturePanickedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#FixturePanicked. += other.FixturePanickedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#FixturePanicked. |
| 187 | r.ExpectedFailuresscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#ExpectedFailures. += other.ExpectedFailuresscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#ExpectedFailures. |
| 188 | r.Missedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Missed. += other.Missedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Missed. |
| 189 | if r.WorkDirscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#WorkDir. != "" && other.WorkDirscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#WorkDir. != "" { |
| 190 | r.WorkDirscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#WorkDir. += ":" + other.WorkDirscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#WorkDir. |
| 191 | } else if other.WorkDirscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#WorkDir. != "" { |
| 192 | r.WorkDirscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#WorkDir. = other.WorkDirscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#WorkDir. |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | func (r *Resultscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#) Passedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Passed().() bool { |
| 197 | return r.Failedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Failed. == 0 && r.Panickedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Panicked. == 0 && |
| 198 | r.FixturePanickedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#FixturePanicked. == 0 && r.Missedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Missed. == 0 && |
| 199 | r.RunErrorscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#RunError. == nil |
| 200 | } |
| 201 | |
| 202 | func (r *Resultscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#) Stringscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#String().() string { |
| 203 | if r.RunErrorscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#RunError. != nil { |
| 204 | return "ERROR: " + r.RunErrorscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#RunError..Error() |
| 205 | } |
| 206 | |
| 207 | var value string |
| 208 | if r.Failedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Failed. == 0 && r.Panickedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Panicked. == 0 && r.FixturePanickedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#FixturePanicked. == 0 && |
| 209 | r.Missedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Missed. == 0 { |
| 210 | value = "OK: " |
| 211 | } else { |
| 212 | value = "OOPS: " |
| 213 | } |
| 214 | value += fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("%d passed", r.Succeededscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Succeeded.) |
| 215 | if r.Skippedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Skipped. != 0 { |
| 216 | value += fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().(", %d skipped", r.Skippedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Skipped.) |
| 217 | } |
| 218 | if r.ExpectedFailuresscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#ExpectedFailures. != 0 { |
| 219 | value += fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().(", %d expected failures", r.ExpectedFailuresscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#ExpectedFailures.) |
| 220 | } |
| 221 | if r.Failedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Failed. != 0 { |
| 222 | value += fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().(", %d FAILED", r.Failedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Failed.) |
| 223 | } |
| 224 | if r.Panickedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Panicked. != 0 { |
| 225 | value += fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().(", %d PANICKED", r.Panickedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Panicked.) |
| 226 | } |
| 227 | if r.Timeoutedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Timeouted. != 0 { |
| 228 | value += fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().(", %d TIMEOUTED", r.Timeoutedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Timeouted.) |
| 229 | } |
| 230 | if r.FixturePanickedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#FixturePanicked. != 0 { |
| 231 | value += fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().(", %d FIXTURE-PANICKED", r.FixturePanickedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#FixturePanicked.) |
| 232 | } |
| 233 | if r.Missedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Missed. != 0 { |
| 234 | value += fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().(", %d MISSED", r.Missedscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#Missed.) |
| 235 | } |
| 236 | if r.WorkDirscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#WorkDir. != "" { |
| 237 | value += "\nWORK=" + r.WorkDirscip-go gomod github.com/pingcap/check . `github.com/pingcap/check`/Result#WorkDir. |
| 238 | } |
| 239 | return value |
| 240 | } |