From acd270dbf92ea52348feed813e6410b8c2af2f63 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Tue, 24 Jul 2018 15:00:50 +0200 Subject: [PATCH 1/2] Fix the reproduction script for testFromTasty tests --- .../dotty/tools/vulpix/ParallelTesting.scala | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala index 57a5bad60079..19eca4930d12 100644 --- a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala +++ b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala @@ -1274,9 +1274,30 @@ trait ParallelTesting extends RunnerOrchestration { self => case None => files } + class JointCompilationSourceFromTasty( + name: String, + file: JFile, + flags: TestFlags, + outDir: JFile, + fromTasty: Boolean = false, + decompilation: Boolean = false + ) extends JointCompilationSource(name, Array(file), flags, outDir, fromTasty, decompilation) { + + override def buildInstructions(errors: Int, warnings: Int): String = { + s"""| + |Test '$title' compiled with $errors error(s) and $warnings warning(s), + |the test can be reproduced by running: + | + | sbt "testFromTasty $file" + | + |""".stripMargin + } + + } + val targets = filteredFiles.map { f => val classpath = createOutputDirsForFile(f, sourceDir, outDir) - JointCompilationSource(testGroup.name, Array(f), flags.withClasspath(classpath.getPath), classpath, fromTasty = true) + new JointCompilationSourceFromTasty(testGroup.name, f, flags.withClasspath(classpath.getPath), classpath, fromTasty = true) } // TODO add SeparateCompilationSource from tasty? @@ -1285,7 +1306,7 @@ trait ParallelTesting extends RunnerOrchestration { self => .filter(f => decompilationFilter.accept(f.getName)) .map { f => val classpath = createOutputDirsForFile(f, sourceDir, outDir) - JointCompilationSource(testGroup.name, Array(f), flags.withClasspath(classpath.getPath), classpath, decompilation = true) + new JointCompilationSourceFromTasty(testGroup.name, f, flags.withClasspath(classpath.getPath), classpath, decompilation = true) } // Create a CompilationTest and let the user decide whether to execute a pos or a neg test From 5edcee6bf13ce6a05a026c6d164b9293ebd4299f Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Wed, 25 Jul 2018 21:04:12 +0200 Subject: [PATCH 2/2] Add blacklisting instructions --- compiler/test/dotty/tools/vulpix/ParallelTesting.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala index 19eca4930d12..ece7054e4e2d 100644 --- a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala +++ b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala @@ -1284,12 +1284,16 @@ trait ParallelTesting extends RunnerOrchestration { self => ) extends JointCompilationSource(name, Array(file), flags, outDir, fromTasty, decompilation) { override def buildInstructions(errors: Int, warnings: Int): String = { + val runOrPos = if (file.getPath.startsWith("tests/run/")) "run" else "pos" + val listName = if (fromTasty) "from-tasty" else "decompilation" s"""| |Test '$title' compiled with $errors error(s) and $warnings warning(s), |the test can be reproduced by running: | | sbt "testFromTasty $file" | + |This tests can be disabled by adding `${file.getName}` to `compiler/test/dotc/$runOrPos-$listName.blacklist` + | |""".stripMargin }