From d62be7809cc2ee034ae2d22665d79cb13a910582 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Thu, 5 Sep 2019 19:40:50 +0200 Subject: runtest: add a flag to specify tests to run --- pkg/runtest/run.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg') diff --git a/pkg/runtest/run.go b/pkg/runtest/run.go index 46a3f09cb..e380ad490 100644 --- a/pkg/runtest/run.go +++ b/pkg/runtest/run.go @@ -59,6 +59,7 @@ type Context struct { LogFunc func(text string) Retries int // max number of test retries to deal with flaky tests Verbose bool + Tests string // prefix to match test file names } func (ctx *Context) log(msg string, args ...interface{}) { @@ -172,6 +173,9 @@ func (ctx *Context) generatePrograms(progs chan *RunRequest) error { if strings.HasSuffix(file.Name(), ".swp") { continue } + if !strings.HasPrefix(file.Name(), ctx.Tests) { + continue + } p, requires, results, err := ctx.parseProg(file.Name()) if err != nil { return err -- cgit mrf-deployment