changeset 53:b63e0544fd19

Presets provide the defaults only, allowing users to override the parts of the presets.
author shade
date Thu, 03 Oct 2013 13:12:25 +0400
parents 8c75606aa741
children ba3be59cfe06
files harness/src/main/java/org/openjdk/jcstress/Options.java
diffstat 1 files changed, 30 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/harness/src/main/java/org/openjdk/jcstress/Options.java	Fri Sep 27 14:17:28 2013 +0400
+++ b/harness/src/main/java/org/openjdk/jcstress/Options.java	Thu Oct 03 13:12:25 2013 +0400
@@ -147,6 +147,36 @@
             return false;
         }
 
+        mode = orDefault(modeStr.value(set), "default");
+        if (this.mode.equalsIgnoreCase("sanity")) {
+            this.time = 50;
+            this.iters = 1;
+            this.forks = 0;
+        } else
+        if (this.mode.equalsIgnoreCase("quick")) {
+            this.time = 300;
+            this.iters = 5;
+            this.forks = 0;
+        } else
+        if (this.mode.equalsIgnoreCase("default")) {
+            // do nothing
+        } else
+        if (this.mode.equalsIgnoreCase("tough")) {
+            this.time = 5000;
+            this.iters = 10;
+            this.forks = 10;
+        } else
+        if (this.mode.equalsIgnoreCase("stress")) {
+            this.time = 1000;
+            this.iters = 5;
+            this.forks = 100;
+        } else {
+            System.err.println("Unknown test mode: " + this.mode);
+            System.err.println();
+            parser.printHelpOn(System.err);
+            return false;
+        }
+
         this.resultDir = orDefault(set.valueOf(result), "results/");
         if (!resultDir.endsWith("/")) {
             resultDir += "/";
@@ -193,36 +223,6 @@
         this.userYield = set.has(shouldYield);
         this.shouldYield = orDefault(set.valueOf(shouldYield), forceYield);
 
-        mode = orDefault(modeStr.value(set), "default");
-        if (this.mode.equalsIgnoreCase("sanity")) {
-            this.time = 50;
-            this.iters = 1;
-            this.forks = 0;
-        } else
-        if (this.mode.equalsIgnoreCase("quick")) {
-            this.time = 300;
-            this.iters = 5;
-            this.forks = 0;
-        } else
-        if (this.mode.equalsIgnoreCase("default")) {
-            // do nothing
-        } else
-        if (this.mode.equalsIgnoreCase("tough")) {
-            this.time = 5000;
-            this.iters = 10;
-            this.forks = 10;
-        } else
-        if (this.mode.equalsIgnoreCase("stress")) {
-            this.time = 1000;
-            this.iters = 5;
-            this.forks = 100;
-        } else {
-            System.err.println("Unknown test mode: " + this.mode);
-            System.err.println();
-            parser.printHelpOn(System.err);
-            return false;
-        }
-
         return true;
     }