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 --- pkg/testutil/norace.go | 9 +++++++++ pkg/testutil/race.go | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 pkg/testutil/norace.go create mode 100644 pkg/testutil/race.go (limited to 'pkg/testutil') 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 -- cgit mrf-deployment