aboutsummaryrefslogtreecommitdiffstats
path: root/prog/mutation_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-05-17 10:24:13 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-05-18 11:34:42 +0200
commit9d7b583eae5f9d459920d207848863917fc58416 (patch)
tree1937b6ba28dc8f669b769279e8ed2ec95f73d1d7 /prog/mutation_test.go
parentb6fa239fd5e9e120ac2b8e9f3d7f608125a7f986 (diff)
prog: reduce size of -short tests
Reduce size of tests that run for more than 1s in short mode.
Diffstat (limited to 'prog/mutation_test.go')
-rw-r--r--prog/mutation_test.go10
1 files changed, 5 insertions, 5 deletions
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()