changeset 391:9849fb5331b5

Runner: print the overall status for tests, capturing VM errors.
author shade
date Wed, 15 Mar 2017 11:54:55 +0100
parents b64aaf61b6be
children 9f21d933addf
files jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/ReportUtils.java
diffstat 2 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java	Wed Mar 08 20:52:43 2017 +0100
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java	Wed Mar 15 11:54:55 2017 +0100
@@ -411,6 +411,17 @@
             o.println("</tr>");
         }
 
+        o.println("<tr>");
+        o.println("<td></td>");
+        for (TestResult r : sorted) {
+            String color = ReportUtils.statusToPassed(r) ? "green" : "red";
+            String label = ReportUtils.statusToLabel(r);
+            o.println("<td align='center' bgColor='" + color + " '>" + label + "</td>");
+        }
+        o.println("<td></td>");
+        o.println("<td></td>");
+        o.println("</tr>");
+
         o.println("</table>");
 
         o.println("<h3>Auxiliary data</h3>");
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/ReportUtils.java	Wed Mar 08 20:52:43 2017 +0100
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/ReportUtils.java	Wed Mar 15 11:54:55 2017 +0100
@@ -195,4 +195,19 @@
                 throw new IllegalStateException("Illegal status: " + result.status());
         }
     }
+
+    public static boolean statusToPassed(TestResult result) {
+        switch (result.status()) {
+            case TIMEOUT_ERROR:
+            case CHECK_TEST_ERROR:
+            case TEST_ERROR:
+            case VM_ERROR:
+            case API_MISMATCH:
+                return false;
+            case NORMAL:
+                return result.grading().isPassed;
+            default:
+                throw new IllegalStateException("Illegal status: " + result.status());
+        }
+    }
 }