From 61936307866445588e3912c98f87e8ae1a4e5ddf Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 13 Feb 2019 11:35:37 +0100 Subject: 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. --- pkg/runtest/run.go | 8 +++++++- pkg/runtest/run_test.go | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'pkg') 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) -- cgit mrf-deployment