summaryrefslogtreecommitdiff
path: root/src/partest
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-18 20:00:44 +0000
committerPaul Phillips <paulp@improving.org>2011-01-18 20:00:44 +0000
commitc1db69d909cb432e971d33f7c81571ecbb0238da (patch)
treeb279264bfb7daae10c1b9fe33510d2c7de4b4030 /src/partest
parent8c713da3d02131bb3931c152a6bda9785e1f464e (diff)
downloadscala-c1db69d909cb432e971d33f7c81571ecbb0238da.tar.gz
scala-c1db69d909cb432e971d33f7c81571ecbb0238da.tar.bz2
scala-c1db69d909cb432e971d33f7c81571ecbb0238da.zip
One element of the partest situation: Reporting...
One element of the partest situation: Reporting and recovering correctly when the compiler crashes. No review.
Diffstat (limited to 'src/partest')
-rw-r--r--src/partest/scala/tools/partest/nest/NestUI.scala4
-rw-r--r--src/partest/scala/tools/partest/nest/Worker.scala18
2 files changed, 10 insertions, 12 deletions
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)
}