changeset 253:8ad4e15435b4

Runners: add passed/failed/err rates to the progress line.
author shade
date Fri, 13 May 2016 20:33:50 +0300
parents fadb4c21e3c8
children f1bedd45376f
files jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/ConsoleReportPrinter.java
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/ConsoleReportPrinter.java	Fri May 13 20:18:55 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/ConsoleReportPrinter.java	Fri May 13 20:33:50 2016 +0300
@@ -62,6 +62,11 @@
     private long firstTest;
     private int progressLen;
 
+    private long passed;
+    private long failed;
+    private long softErrors;
+    private long hardErrors;
+
     public ConsoleReportPrinter(Options opts, PrintWriter pw, int expectedTests, int expectedConfigs) throws FileNotFoundException {
         this.opts = opts;
         this.output = pw;
@@ -90,6 +95,7 @@
         switch (r.status()) {
             case TIMEOUT_ERROR:
                 printLine("TIMEOUT", r);
+                hardErrors++;
                 return;
             case CHECK_TEST_ERROR:
             case TEST_ERROR:
@@ -99,6 +105,7 @@
                     output.println(data);
                 }
                 output.println();
+                hardErrors++;
                 return;
             case VM_ERROR:
                 output.println();
@@ -107,9 +114,11 @@
                     output.println(data);
                 }
                 output.println();
+                hardErrors++;
                 return;
             case API_MISMATCH:
                 printLine("SKIPPED", r);
+                softErrors++;
                 return;
             case NORMAL:
                 TestInfo test = TestList.getInfo(r.getName());
@@ -121,10 +130,12 @@
                     TestGrading grading = new TestGrading(r, test);
                     if (grading.isPassed) {
                         printLine("OK", r);
+                        passed++;
                     } else {
                         output.println();
                         printLine("FAILED", r);
                         isVerbose = true;
+                        failed++;
                     }
                 }
                 break;
@@ -223,12 +234,12 @@
     }
 
     private void printProgress() {
-        String line = String.format("(ETA: %10s) (Rate: %s samples/sec) (Tests: %4d of %d) (Forks: %2d of %d) (Iterations: %2d of %d) ",
+        String line = String.format("(ETA: %10s) (Rate: %s samples/sec) (Tests: %d of %d) (Forks: %2d of %d) (Iterations: %2d of %d; %d passed, %d failed, %d soft errs, %d hard errs) ",
                 computeETA(),
                 computeSpeed(),
                 observedTests.size(), expectedTests,
                 observedConfigs.size(), expectedConfigs,
-                observedIterations, expectedIterations
+                observedIterations, expectedIterations, passed, failed, softErrors, hardErrors
         );
         progressLen = line.length();
         output.print(line);