diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-02-13 11:35:37 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-02-13 15:58:42 +0100 |
| commit | 61936307866445588e3912c98f87e8ae1a4e5ddf (patch) | |
| tree | dcfbdbcb2c5d90b40eb4a013be7969b37672182d /pkg | |
| parent | 982ed4be0bd2d246ee3a5bcdf61fca4b7dce8c0e (diff) | |
pkg/runtest: don't print skipped/broken tests by default
SKIP/BROKEN distract too much attention from FAIL tests
and are not usually interesting. Add Verbose flag that
controls printing of SKIP/BROKEN tests. Enable it in
pkf/runtest/run_test.go by default and disable in tools/syz-runtest.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/runtest/run.go | 8 | ||||
| -rw-r--r-- | pkg/runtest/run_test.go | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/pkg/runtest/run.go b/pkg/runtest/run.go index 0e9c31a98..0af03158e 100644 --- a/pkg/runtest/run.go +++ b/pkg/runtest/run.go @@ -56,6 +56,7 @@ type Context struct { EnabledCalls map[string]map[*prog.Syscall]bool Requests chan *RunRequest LogFunc func(text string) + Verbose bool } func (ctx *Context) log(msg string, args ...interface{}) { @@ -77,12 +78,15 @@ func (ctx *Context) Run() error { os.Remove(req.Bin) } result := "" + verbose := false if req.broken != "" { broken++ result = fmt.Sprintf("BROKEN (%v)", req.broken) + verbose = true } else if req.skip != "" { skip++ result = fmt.Sprintf("SKIP (%v)", req.skip) + verbose = true } else { if req.Err == nil { req.Err = checkResult(req) @@ -100,7 +104,9 @@ func (ctx *Context) Run() error { result = "OK" } } - ctx.log("%-38v: %v", req.name, result) + if !verbose || ctx.Verbose { + ctx.log("%-38v: %v", req.name, result) + } } if err := <-errc; err != nil { return err diff --git a/pkg/runtest/run_test.go b/pkg/runtest/run_test.go index 21ca38b83..5cbf2b831 100644 --- a/pkg/runtest/run_test.go +++ b/pkg/runtest/run_test.go @@ -73,6 +73,7 @@ func test(t *testing.T, sysTarget *targets.Target) { t.Helper() t.Logf(text) }, + Verbose: true, } if err := ctx.Run(); err != nil { t.Fatal(err) |
