From 9d7b583eae5f9d459920d207848863917fc58416 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 17 May 2020 10:24:13 +0200 Subject: prog: reduce size of -short tests Reduce size of tests that run for more than 1s in short mode. --- prog/mutation_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'prog/mutation_test.go') diff --git a/prog/mutation_test.go b/prog/mutation_test.go index a64cc6010..77c049a37 100644 --- a/prog/mutation_test.go +++ b/prog/mutation_test.go @@ -155,9 +155,9 @@ func TestSizeMutateArg(t *testing.T) { target, rs, iters := initRandomTargetTest(t, "test", "64") r := newRand(target, rs) ct := target.DefaultChoiceTable() - for i := 0; i < 100; i++ { + for i := 0; i < iters; i++ { p := target.Generate(rs, 10, ct) - for it := 0; it < iters; it++ { + for it := 0; it < 10; it++ { p1 := p.Clone() ctx := &mutator{ p: p1, @@ -441,9 +441,9 @@ func runMutationTests(t *testing.T, tests [][2]string, valid bool) { t.Fatalf("failed to deserialize the program: %v", err) } want := goal.Serialize() - iters := int(1e6) - if !valid { - iters /= 10 + iters := iterCount() + if valid { + iters = 1e6 // it will stop after reaching the goal } for i := 0; i < iters; i++ { p1 := p.Clone() -- cgit mrf-deployment