From d42a28d07683d95e6dffd27cdb9078ebeb599c15 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Fri, 7 Apr 2017 14:46:17 +0200 Subject: Add ability to only compile run tests --- compiler/test/dotty/tools/vulpix/SummaryReport.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'compiler/test/dotty/tools/vulpix/SummaryReport.java') diff --git a/compiler/test/dotty/tools/vulpix/SummaryReport.java b/compiler/test/dotty/tools/vulpix/SummaryReport.java index 1a7fc2a61..23209eefc 100644 --- a/compiler/test/dotty/tools/vulpix/SummaryReport.java +++ b/compiler/test/dotty/tools/vulpix/SummaryReport.java @@ -10,8 +10,10 @@ import scala.Unit; import dotty.tools.dotc.reporting.TestReporter; import dotty.Properties; -/** Note that while `ParallelTesting` runs in parallel, JUnit tests cannot with - * this class +/** This class adds summary reports to `ParallelTesting` + * + * It is written in Java because we currently cannot explicitly write static + * methods in Scala without SIP-25 (`@static` fields and methods in Scala) */ public class SummaryReport { public final static boolean isInteractive = @@ -20,6 +22,7 @@ public class SummaryReport { private static TestReporter rep = TestReporter.reporter(System.out, -1); private static ArrayDeque failedTests = new ArrayDeque<>(); private static ArrayDeque reproduceInstructions = new ArrayDeque<>(); + private static ArrayDeque startingMessages = new ArrayDeque<>(); private static Supplier cleanup; private static int passed; private static int failed; @@ -40,6 +43,10 @@ public class SummaryReport { reproduceInstructions.offer(msg); } + public final static void addStartingMessage(String msg) { + startingMessages.offer(msg); + } + public final static void addCleanup(Function0 func) { // Wow, look at how neatly we - compose cleanup callbacks: if (cleanup == null) { @@ -61,6 +68,10 @@ public class SummaryReport { rep = TestReporter.reporter(System.out, -1); failedTests = new ArrayDeque<>(); reproduceInstructions = new ArrayDeque<>(); + startingMessages = new ArrayDeque<>(); + cleanup = null; + passed = 0; + failed = 0; } @AfterClass public final static void teardown() { @@ -73,6 +84,10 @@ public class SummaryReport { "\n" ); + startingMessages + .stream() + .forEach(rep::echo); + failedTests .stream() .map(x -> " " + x) -- cgit v1.2.3