aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/testutil
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2021-12-21 14:23:50 +0100
committerDmitry Vyukov <dvyukov@google.com>2021-12-21 18:52:46 +0100
commitad097c94a04025c865b3956566ea5da7670ed437 (patch)
tree12a7efa8c65fa8fef91f33fb12d34d8f8f2023d7 /pkg/testutil
parentc6f13480f3e562921f700b3e4f878ca5d54d958f (diff)
pkg/testutil: add package
Add package with RaceEnabled const that can be used in test to skip long tests in race mode. Switch existing tests to use the new package. Update #2886
Diffstat (limited to 'pkg/testutil')
-rw-r--r--pkg/testutil/norace.go9
-rw-r--r--pkg/testutil/race.go9
2 files changed, 18 insertions, 0 deletions
diff --git a/pkg/testutil/norace.go b/pkg/testutil/norace.go
new file mode 100644
index 000000000..ceb03928f
--- /dev/null
+++ b/pkg/testutil/norace.go
@@ -0,0 +1,9 @@
+// Copyright 2018 syzkaller project authors. All rights reserved.
+// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+//go:build !race
+// +build !race
+
+package testutil
+
+const RaceEnabled = false
diff --git a/pkg/testutil/race.go b/pkg/testutil/race.go
new file mode 100644
index 000000000..96a9043bb
--- /dev/null
+++ b/pkg/testutil/race.go
@@ -0,0 +1,9 @@
+// Copyright 2018 syzkaller project authors. All rights reserved.
+// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+//go:build race
+// +build race
+
+package testutil
+
+const RaceEnabled = true