From c8b96646e564d36999bda16b79f72a027332224c Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Thu, 18 Sep 2008 09:01:38 +0000 Subject: Boot class path and ext dirs are now set proper... Boot class path and ext dirs are now set properly when creating compilers to be tested. partest runner script now reads PARTEST_DEBUG env. var (setting it to true enables debug output). --- src/partest/scala/tools/partest/nest/CompileManager.scala | 11 +++++++++-- src/partest/scala/tools/partest/nest/ReflectiveRunner.scala | 11 +++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'src/partest') diff --git a/src/partest/scala/tools/partest/nest/CompileManager.scala b/src/partest/scala/tools/partest/nest/CompileManager.scala index 29981bcac4..87c3a7db85 100644 --- a/src/partest/scala/tools/partest/nest/CompileManager.scala +++ b/src/partest/scala/tools/partest/nest/CompileManager.scala @@ -23,12 +23,19 @@ abstract class SimpleCompiler { def compile(out: Option[File], files: List[File], kind: String, log: File): Boolean } +class TestSettings extends { + override val bootclasspathDefault = + System.getProperty("sun.boot.class.path", "") + override val extdirsDefault = + System.getProperty("java.ext.dirs", "") +} with Settings(x => ()) + class DirectCompiler(val fileManager: FileManager) extends SimpleCompiler { def newGlobal(settings: Settings, reporter: Reporter): Global = new Global(settings, reporter) def newGlobal(settings: Settings, logWriter: FileWriter): Global = { - val rep = new ExtConsoleReporter(new Settings(x => ()), + val rep = new ExtConsoleReporter(new TestSettings, Console.in, new PrintWriter(logWriter)) rep.shortname = true @@ -36,7 +43,7 @@ class DirectCompiler(val fileManager: FileManager) extends SimpleCompiler { } def newSettings = { - val settings = new Settings(x => ()) + val settings = new TestSettings settings.deprecation.value = true settings.nowarnings.value = false settings.encoding.value = "iso-8859-1" diff --git a/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala b/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala index 7aec84a30e..e99019822c 100644 --- a/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala +++ b/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala @@ -52,6 +52,17 @@ class ReflectiveRunner extends RunnerUtils { } try { + val newClasspath = sepUrls.mkString(java.io.File.pathSeparator) + System.setProperty("java.class.path", newClasspath) + System.setProperty("env.classpath", newClasspath) + System.setProperty("scala.home", "") + if (fileManager.debug) { + println("java.class.path: "+System.getProperty("java.class.path")) + println("env.classpath: "+System.getProperty("env.classpath")) + println("sun.boot.class.path: "+System.getProperty("sun.boot.class.path")) + println("java.ext.dirs: "+System.getProperty("java.ext.dirs")) + } + val sepRunnerClass = sepLoader.loadClass("scala.tools.partest.nest.ConsoleRunner") -- cgit v1.2.3