aboutsummaryrefslogtreecommitdiffstats
path: root/prog/export_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2022-12-17 13:09:15 +0100
committerDmitry Vyukov <dvyukov@google.com>2022-12-22 10:11:08 +0100
commit71d483814b0f74e465d40e0059c0d733f0017cad (patch)
treef797746ee6c449a77f314084663fc45a03b0f8ce /prog/export_test.go
parent4067838e6b16173af08e062ce434ecfc46d45bda (diff)
pkg/testutil: move iterCount from prog package
Diffstat (limited to 'prog/export_test.go')
-rw-r--r--prog/export_test.go15
1 files changed, 2 insertions, 13 deletions
diff --git a/prog/export_test.go b/prog/export_test.go
index e544103c1..54992dba1 100644
--- a/prog/export_test.go
+++ b/prog/export_test.go
@@ -23,20 +23,9 @@ var (
initTargetTest = InitTargetTest
)
-func iterCount() int {
- iters := 1000
- if testing.Short() {
- iters /= 10
- }
- if testutil.RaceEnabled {
- iters /= 10
- }
- return iters
-}
-
func initRandomTargetTest(t *testing.T, os, arch string) (*Target, rand.Source, int) {
target := initTargetTest(t, os, arch)
- return target, testutil.RandSource(t), iterCount()
+ return target, testutil.RandSource(t), testutil.IterCount()
}
func initTest(t *testing.T) (*Target, rand.Source, int) {
@@ -58,7 +47,7 @@ func testEachTarget(t *testing.T, fn func(t *testing.T, target *Target)) {
func testEachTargetRandom(t *testing.T, fn func(t *testing.T, target *Target, rs rand.Source, iters int)) {
t.Parallel()
targets := AllTargets()
- iters := iterCount()
+ iters := testutil.IterCount()
iters /= len(targets)
if iters < 3 {
iters = 3