@@ -406,8 +406,12 @@ trait ParallelTesting {
406
406
407
407
private final class RunTest (testSources : List [TestSource ], times : Int , threadLimit : Option [Int ], suppressAllOutput : Boolean )
408
408
extends Test (testSources, times, threadLimit, suppressAllOutput) {
409
-
410
409
private def runMain (dir : JFile , testSource : TestSource ): Array [String ] = {
410
+ def renderStackTrace (ex : Throwable ): String =
411
+ ex.getStackTrace
412
+ .takeWhile(_.getMethodName != " invoke0" )
413
+ .mkString(" " , " \n " , " " )
414
+
411
415
import java .io .ByteArrayOutputStream
412
416
import java .net .{ URL , URLClassLoader }
413
417
@@ -424,15 +428,15 @@ trait ParallelTesting {
424
428
}
425
429
catch {
426
430
case ex : NoSuchMethodException =>
427
- echo(s " test in ' $dir' did not contain method: ${ex.getMessage} " )
431
+ echo(s " test in ' $dir' did not contain method: ${ex.getMessage}\n ${renderStackTrace(ex.getCause)} " )
428
432
failTestSource(testSource)
429
433
430
434
case ex : ClassNotFoundException =>
431
- echo(s " test in ' $dir' did not contain class: ${ex.getMessage} " )
435
+ echo(s " test in ' $dir' did not contain class: ${ex.getMessage}\n ${renderStackTrace(ex.getCause)} " )
432
436
failTestSource(testSource)
433
437
434
438
case ex : InvocationTargetException =>
435
- echo(s " An exception ocurred when running main: ${ex.getCause} " )
439
+ echo(s " An exception ocurred when running main: ${ex.getCause}\n ${renderStackTrace(ex.getCause)} " )
436
440
failTestSource(testSource)
437
441
}
438
442
printStream.toString(" utf-8" ).lines.toArray
0 commit comments