summaryrefslogtreecommitdiff
path: root/src/partest
diff options
context:
space:
mode:
authorPhilipp Haller <hallerp@gmail.com>2008-09-04 14:45:18 +0000
committerPhilipp Haller <hallerp@gmail.com>2008-09-04 14:45:18 +0000
commit743edeefd44939ada6e81c5936cc04f7c6601931 (patch)
treefaa1315715933d8f2add6d38d4690a47faea4684 /src/partest
parent148f56f1c6758a007d31f8a48b02408886032198 (diff)
downloadscala-743edeefd44939ada6e81c5936cc04f7c6601931.tar.gz
scala-743edeefd44939ada6e81c5936cc04f7c6601931.tar.bz2
scala-743edeefd44939ada6e81c5936cc04f7c6601931.zip
Fixed problem running plugin tests.
Diffstat (limited to 'src/partest')
-rw-r--r--src/partest/scala/tools/partest/nest/CompileManager.scala53
1 files changed, 6 insertions, 47 deletions
diff --git a/src/partest/scala/tools/partest/nest/CompileManager.scala b/src/partest/scala/tools/partest/nest/CompileManager.scala
index 592872fb0c..89a6b87802 100644
--- a/src/partest/scala/tools/partest/nest/CompileManager.scala
+++ b/src/partest/scala/tools/partest/nest/CompileManager.scala
@@ -20,7 +20,6 @@ class ExtConsoleReporter(override val settings: Settings, reader: BufferedReader
}
abstract class SimpleCompiler {
- def compile(file: File, kind: String): Boolean
def compile(out: Option[File], files: List[File], kind: String, log: File): Boolean
}
@@ -93,14 +92,16 @@ class DirectCompiler(val fileManager: FileManager) extends SimpleCompiler {
val toCompile = files.map(_.getPath)
try {
NestUI.verbose("compiling "+toCompile)
- (new global.Run) compile toCompile
+ try {
+ (new global.Run) compile toCompile
+ } catch {
+ case FatalError(msg) =>
+ testRep.error(null, "fatal error: " + msg)
+ }
testRep.printSummary
testRep.writer.flush
testRep.writer.close
} catch {
- case FatalError(msg) =>
- logWriter.write("FatalError: "+msg)
- return false
case e: Exception =>
e.printStackTrace()
return false
@@ -109,37 +110,6 @@ class DirectCompiler(val fileManager: FileManager) extends SimpleCompiler {
}
!testRep.hasErrors
}
-
- def compile(file: File, kind: String): Boolean = {
- val testSettings = newSettings
- val testRep = newReporter(testSettings)
- val args = List.fromArray(fileManager.SCALAC_OPTS.split("\\s"))
- val command = new CompilerCommand(args, testSettings, x => {}, false)
- val global = newGlobal(command.settings, testRep)
-
- val test: TestFile = kind match {
- case "pos" => PosTestFile(file, fileManager, true)
- case "neg" => NegTestFile(file, fileManager, true)
- case "run" => RunTestFile(file, fileManager, true)
- case "jvm" => JvmTestFile(file, fileManager, true)
- case "jvm5" => Jvm5TestFile(file, fileManager, true)
- case "shootout" => ShootoutTestFile(file, fileManager, true)
- }
- test.defineSettings(testSettings)
-
- val toCompile = List(file.getPath)
- try {
- (new global.Run) compile toCompile
- testRep.printSummary
- testRep.writer.flush
- testRep.writer.close
- } catch {
- case e: Exception =>
- e.printStackTrace()
- return false
- }
- !testRep.hasErrors
- }
}
class ReflectiveCompiler(val fileManager: ConsoleFileManager) extends SimpleCompiler {
@@ -167,17 +137,6 @@ class ReflectiveCompiler(val fileManager: ConsoleFileManager) extends SimpleComp
* This exception is handled in the shouldCompile and shouldFailCompile
* methods of class CompileManager.
*/
- def compile(file: File, kind: String): Boolean = {
- val fileArgs: Array[AnyRef] = Array(file, kind)
- val res = sepCompileMethod.invoke(sepCompiler, fileArgs: _*).asInstanceOf[java.lang.Boolean]
- res.booleanValue()
- }
-
- /* This method throws java.lang.reflect.InvocationTargetException
- * if the compiler crashes.
- * This exception is handled in the shouldCompile and shouldFailCompile
- * methods of class CompileManager.
- */
def compile(out: Option[File], files: List[File], kind: String, log: File): Boolean = {
val fileArgs: Array[AnyRef] = Array(out, files, kind, log)
val res = sepCompileMethod2.invoke(sepCompiler, fileArgs: _*).asInstanceOf[java.lang.Boolean]