From c1db69d909cb432e971d33f7c81571ecbb0238da Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 18 Jan 2011 20:00:44 +0000 Subject: One element of the partest situation: Reporting... One element of the partest situation: Reporting and recovering correctly when the compiler crashes. No review. --- src/partest/scala/tools/partest/nest/NestUI.scala | 4 ---- src/partest/scala/tools/partest/nest/Worker.scala | 18 ++++++++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'src/partest') diff --git a/src/partest/scala/tools/partest/nest/NestUI.scala b/src/partest/scala/tools/partest/nest/NestUI.scala index 2bf7cd0667..38110645ba 100644 --- a/src/partest/scala/tools/partest/nest/NestUI.scala +++ b/src/partest/scala/tools/partest/nest/NestUI.scala @@ -116,8 +116,4 @@ object NestUI { println(msg) } } - def shout(msg: String) { - warning("something is wrong:") - println(msg) - } } diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala index f6991b468b..3be3c34a62 100644 --- a/src/partest/scala/tools/partest/nest/Worker.scala +++ b/src/partest/scala/tools/partest/nest/Worker.scala @@ -360,12 +360,15 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor lines foreach (x => NestUI.normal(x + "\n")) } } + def logStackTrace(logFile: File, t: Throwable, msg: String): Boolean = { + SFile(logFile).writeAll(msg, stackTraceString(t)) + outputLogFile(logFile) // if running the test threw an exception, output log file + false + } + def exHandler(logFile: File): PartialFunction[Throwable, Boolean] = exHandler(logFile, "") def exHandler(logFile: File, msg: String): PartialFunction[Throwable, Boolean] = { - case e: Exception => - SFile(logFile).writeAll(msg, stackTraceString(e)) - outputLogFile(logFile) // if running the test threw an exception, output log file - false + case e: Exception => logStackTrace(logFile, e, msg) } /** Runs a list of tests. @@ -966,10 +969,9 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor try processSingleFile(testFile) catch { case t: Throwable => - NestUI.shout("Caught something while invoking processSingleFile(%s)".format(testFile)) - t.printStackTrace - NestUI.normal("There were " + filesRemaining.size + " files remaining: " + filesRemaining.mkString(", ")) - LogContext(null, None) + val logFile = createLogFile(testFile, kind) + logStackTrace(logFile, t, "Possible compiler crash during test of: " + testFile) + LogContext(logFile, None) } parent ! Result(testFile, context) } -- cgit v1.2.3