changeset 75:d84afc598b71

Print the aggregated test result into stdout in verbose mode.
author shade
date Mon, 03 Feb 2014 16:34:46 +0400
parents e906859b74e6
children 6a01a6075975
files jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/ConsoleReportPrinter.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/ConsoleReportPrinter.java	Mon Feb 03 15:23:57 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/ConsoleReportPrinter.java	Mon Feb 03 16:34:46 2014 +0400
@@ -104,10 +104,10 @@
         }
         observedCount.addAndGet(totalCount);
 
-        printResult(output, r, verbose);
+        printResult(r, verbose);
     }
 
-    private void printResult(PrintWriter output, TestResult r, boolean isVerbose) {
+    public void printResult(TestResult r, boolean isVerbose) {
         switch (r.status()) {
             case TIMEOUT_ERROR:
                 printLine(output, "TIMEOUT", r);
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java	Mon Feb 03 15:23:57 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java	Mon Feb 03 16:34:46 2014 +0400
@@ -64,9 +64,14 @@
     private final InProcessCollector collector;
     private int cellStyle = 1;
 
+    private final ConsoleReportPrinter printer;
+    private final boolean verbose;
+
     public HTMLReportPrinter(Options opts, InProcessCollector collector) throws JAXBException, FileNotFoundException {
         this.collector = collector;
-        resultDir = opts.getResultDest();
+        this.printer = new ConsoleReportPrinter(opts, new PrintWriter(System.out, true), 0);
+        this.resultDir = opts.getResultDest();
+        this.verbose = opts.isVerbose();
         new File(resultDir).mkdirs();
     }
 
@@ -258,6 +263,13 @@
         output.println("</html>");
 
         output.close();
+
+        if (verbose) {
+            for (String k : results.keySet()) {
+                TestResult result = results.get(k);
+                printer.add(result);
+            }
+        }
     }
 
     private void printFailedTests(Map<String, TestResult> results, Multimap<String, String> packages, PrintWriter output) throws FileNotFoundException, JAXBException {