aboutsummaryrefslogtreecommitdiff
path: root/compiler/test/dotty/tools/dotc/ParallelTesting.scala
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/test/dotty/tools/dotc/ParallelTesting.scala')
-rw-r--r--compiler/test/dotty/tools/dotc/ParallelTesting.scala12
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/test/dotty/tools/dotc/ParallelTesting.scala b/compiler/test/dotty/tools/dotc/ParallelTesting.scala
index 6fedfe379..c01c444b2 100644
--- a/compiler/test/dotty/tools/dotc/ParallelTesting.scala
+++ b/compiler/test/dotty/tools/dotc/ParallelTesting.scala
@@ -406,8 +406,12 @@ trait ParallelTesting {
private final class RunTest(testSources: List[TestSource], times: Int, threadLimit: Option[Int], suppressAllOutput: Boolean)
extends Test(testSources, times, threadLimit, suppressAllOutput) {
-
private def runMain(dir: JFile, testSource: TestSource): Array[String] = {
+ def renderStackTrace(ex: Throwable): String =
+ ex.getStackTrace
+ .takeWhile(_.getMethodName != "invoke0")
+ .mkString(" ", "\n ", "")
+
import java.io.ByteArrayOutputStream
import java.net.{ URL, URLClassLoader }
@@ -424,15 +428,15 @@ trait ParallelTesting {
}
catch {
case ex: NoSuchMethodException =>
- echo(s"test in '$dir' did not contain method: ${ex.getMessage} ")
+ echo(s"test in '$dir' did not contain method: ${ex.getMessage}\n${renderStackTrace(ex.getCause)}")
failTestSource(testSource)
case ex: ClassNotFoundException =>
- echo(s"test in '$dir' did not contain class: ${ex.getMessage} ")
+ echo(s"test in '$dir' did not contain class: ${ex.getMessage}\n${renderStackTrace(ex.getCause)}")
failTestSource(testSource)
case ex: InvocationTargetException =>
- echo(s"An exception ocurred when running main: ${ex.getCause} ")
+ echo(s"An exception ocurred when running main: ${ex.getCause}\n${renderStackTrace(ex.getCause)}")
failTestSource(testSource)
}
printStream.toString("utf-8").lines.toArray