From ad097c94a04025c865b3956566ea5da7670ed437 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 21 Dec 2021 14:23:50 +0100 Subject: 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 --- prog/mutation_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'prog/mutation_test.go') diff --git a/prog/mutation_test.go b/prog/mutation_test.go index 6dfa15d63..a14719065 100644 --- a/prog/mutation_test.go +++ b/prog/mutation_test.go @@ -8,6 +8,8 @@ import ( "fmt" "math/rand" "testing" + + "github.com/google/syzkaller/pkg/testutil" ) func TestMutationFlags(t *testing.T) { @@ -81,7 +83,7 @@ mutate_integer(0x0, 0x1, 0x1, 0x1, 0x0, 0x1, 0x0, 0x0, 0x1)`, } func TestMutateArgument(t *testing.T) { - if raceEnabled { + if testutil.RaceEnabled { t.Skip("skipping in race mode, too slow") } tests := [][2]string{ @@ -391,7 +393,7 @@ func BenchmarkGenerate(b *testing.B) { } func runMutationTests(t *testing.T, tests [][2]string, valid bool) { - if raceEnabled { + if testutil.RaceEnabled { t.Skip("skipping in race mode, too slow") } target := initTargetTest(t, "test", "64") -- cgit mrf-deployment