changeset 383:475d2625493e

Report: sort test list in HTML and Text output.
author shade
date Mon, 06 Mar 2017 14:18:42 +0100
parents 1911732f6f23
children 020a3bf820bc
files jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/TextReportPrinter.java
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java	Mon Mar 06 13:36:27 2017 +0100
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java	Mon Mar 06 14:18:42 2017 +0100
@@ -61,6 +61,7 @@
 
     public void work() throws FileNotFoundException {
         List<TestResult> byName = ReportUtils.mergedByName(collector.getTestResults());
+        Collections.sort(byName, Comparator.comparing(TestResult::getName));
 
         PrintWriter output = new PrintWriter(resultDir + "/index.html");
 
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/TextReportPrinter.java	Mon Mar 06 13:36:27 2017 +0100
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/TextReportPrinter.java	Mon Mar 06 14:18:42 2017 +0100
@@ -33,9 +33,7 @@
 
 import java.io.FileNotFoundException;
 import java.io.PrintWriter;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 import java.util.function.Predicate;
 
 /**
@@ -61,6 +59,9 @@
         emittedTests.clear();
 
         List<TestResult> byConfig = ReportUtils.mergedByConfig(collector.getTestResults());
+        Collections.sort(byConfig, Comparator
+                .comparing(TestResult::getName)
+                .thenComparing(Comparator.comparing(t -> t.getConfig().jvmArgs.toString())));
 
         pw.println("RUN RESULTS:");
         pw.println("------------------------------------------------------------------------------------------------------------------------");