aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2021-12-21 14:39:55 +0100
committerDmitry Vyukov <dvyukov@google.com>2021-12-21 18:52:46 +0100
commit6caa12e443d9f79aa2df67d44cdc6163eaa1e97f (patch)
tree284c3292b2088e672f2dcd9f47a8020cd2d138df
parent0c5d23c580291085a478b056348c28ac3bc510a0 (diff)
pkg/runtest: don't run all tests in race mode
Update #2886
-rw-r--r--pkg/runtest/run_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/runtest/run_test.go b/pkg/runtest/run_test.go
index d02cc24e6..adafedab2 100644
--- a/pkg/runtest/run_test.go
+++ b/pkg/runtest/run_test.go
@@ -14,6 +14,7 @@ import (
"github.com/google/syzkaller/pkg/csource"
"github.com/google/syzkaller/pkg/host"
"github.com/google/syzkaller/pkg/osutil"
+ "github.com/google/syzkaller/pkg/testutil"
"github.com/google/syzkaller/prog"
"github.com/google/syzkaller/sys/targets"
_ "github.com/google/syzkaller/sys/test/gen" // pull in the test target
@@ -100,7 +101,12 @@ func test(t *testing.T, sysTarget *targets.Target) {
func TestParsing(t *testing.T) {
t.Parallel()
+ // Test only one target in race mode (we have gazillion of auto-generated Linux test).
+ raceTarget := targets.Get(targets.TestOS, targets.TestArch64)
for OS, arches := range targets.List {
+ if testutil.RaceEnabled && OS != raceTarget.OS {
+ continue
+ }
dir := filepath.Join("..", "..", "sys", OS, "test")
if !osutil.IsExist(dir) {
continue
@@ -110,6 +116,9 @@ func TestParsing(t *testing.T) {
t.Fatal(err)
}
for arch := range arches {
+ if testutil.RaceEnabled && arch != raceTarget.Arch {
+ continue
+ }
target, err := prog.GetTarget(OS, arch)
if err != nil {
t.Fatal(err)