diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-07-13 10:57:31 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-07-15 09:26:23 +0200 |
| commit | 6b24f02a1122b986a5778bcb442ebabed406eeb1 (patch) | |
| tree | fdc6a93975d9ad9717012de219b843451d3f76e2 /pkg | |
| parent | e2f6c0c1b57a838c4c17cb3a2e07c6fbda41a7c6 (diff) | |
pkg/runtest: allow to select a subset of tests to run
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/runtest/run_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/runtest/run_test.go b/pkg/runtest/run_test.go index ede757ee8..d9fdadfab 100644 --- a/pkg/runtest/run_test.go +++ b/pkg/runtest/run_test.go @@ -4,6 +4,7 @@ package runtest import ( + "flag" "os" "path/filepath" "runtime" @@ -16,6 +17,11 @@ import ( _ "github.com/google/syzkaller/sys/test/gen" // pull in the test target ) +// Can be used as: +// go test -v -run=Test/64_fork ./pkg/runtest -filter=nonfailing +// to select a subset of tests to run. +var flagFilter = flag.String("filter", "", "prefix to match test file names") + func Test(t *testing.T) { switch runtime.GOOS { case "openbsd": @@ -74,6 +80,7 @@ func test(t *testing.T, sysTarget *targets.Target) { ctx := &Context{ Dir: filepath.Join("..", "..", "sys", target.OS, "test"), Target: target, + Tests: *flagFilter, Features: features, EnabledCalls: enabledCalls, Requests: requests, |
