diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2017-04-07 14:46:17 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2017-04-12 11:31:15 +0200 |
commit | d42a28d07683d95e6dffd27cdb9078ebeb599c15 (patch) | |
tree | 3907a8a0d59a99b23f3ce483cb5006c137373eba /compiler/test/dotty/tools/vulpix/SummaryReport.java | |
parent | 55803b2657a473a1ebbebfd9ab7ba4c1b4e27d38 (diff) | |
download | dotty-d42a28d07683d95e6dffd27cdb9078ebeb599c15.tar.gz dotty-d42a28d07683d95e6dffd27cdb9078ebeb599c15.tar.bz2 dotty-d42a28d07683d95e6dffd27cdb9078ebeb599c15.zip |
Add ability to only compile run tests
Diffstat (limited to 'compiler/test/dotty/tools/vulpix/SummaryReport.java')
-rw-r--r-- | compiler/test/dotty/tools/vulpix/SummaryReport.java | 19 |
1 files changed, 17 insertions, 2 deletions
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<String> failedTests = new ArrayDeque<>(); private static ArrayDeque<String> reproduceInstructions = new ArrayDeque<>(); + private static ArrayDeque<String> startingMessages = new ArrayDeque<>(); private static Supplier<Void> 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<Unit> 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) |