changeset 333:744601228ec7

Runners: reconsider the default mode handling, make mode options overridable.
author shade
date Fri, 21 Oct 2016 20:20:06 +0200
parents acec859bce0e
children 20e3489cdc20
files jcstress-core/src/main/java/org/openjdk/jcstress/Options.java
diffstat 1 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/Options.java	Fri Oct 21 20:11:53 2016 +0200
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/Options.java	Fri Oct 21 20:20:06 2016 +0200
@@ -195,22 +195,22 @@
             this.batchSize = 20;
         } else
         if (this.mode.equalsIgnoreCase("quick")) {
-            this.time = 300;
+            this.time = 200;
             this.iters = 5;
             this.forks = 1;
-            this.batchSize = orDefault(set.valueOf(batchSize), 20);
+            this.batchSize = 20;
         } else
         if (this.mode.equalsIgnoreCase("default")) {
-            this.time = orDefault(set.valueOf(time), 1000);
-            this.iters = orDefault(set.valueOf(iters), 5);
-            this.forks = orDefault(set.valueOf(forks), 1);
-            this.batchSize = orDefault(set.valueOf(batchSize), 5);
+            this.time = 1000;
+            this.iters = 5;
+            this.forks = 1;
+            this.batchSize = 5;
         } else
         if (this.mode.equalsIgnoreCase("tough")) {
             this.time = 1000;
             this.iters = 10;
             this.forks = 10;
-            this.batchSize = 1;
+            this.batchSize = 5;
         } else
         if (this.mode.equalsIgnoreCase("stress")) {
             this.time = 1000;
@@ -224,6 +224,12 @@
             return false;
         }
 
+        // override these, if present
+        this.time = orDefault(set.valueOf(time), this.time);
+        this.iters = orDefault(set.valueOf(iters), this.iters);
+        this.forks = orDefault(set.valueOf(forks), this.forks);
+        this.batchSize = orDefault(set.valueOf(batchSize), this.batchSize);
+
         if (set.hasArgument(optJvmArgs)) {
             try {
                 List<String> vals = optJvmArgs.values(set);