diff options
author | Philipp Haller <hallerp@gmail.com> | 2008-03-12 14:39:17 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2008-03-12 14:39:17 +0000 |
commit | 328363d628a1e2443eb13c524fbb5c5d8a11e6ef (patch) | |
tree | cfecf8ce34afb73503e95130ab936ae073938e86 | |
parent | da97d90a01a2c76e30a2308f531ed5aecaa36e3b (diff) | |
download | scala-328363d628a1e2443eb13c524fbb5c5d8a11e6ef.tar.gz scala-328363d628a1e2443eb13c524fbb5c5d8a11e6ef.tar.bz2 scala-328363d628a1e2443eb13c524fbb5c5d8a11e6ef.zip |
Obtaining Scala compiler version is more robust.
3 files changed, 9 insertions, 15 deletions
diff --git a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala index a2fd159d63..f4b960751b 100644 --- a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala +++ b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala @@ -14,7 +14,7 @@ class ConsoleFileManager extends FileManager { var CLASSPATH = System.getProperty("java.class.path", ".") NestUI.verbose("CLASSPATH: "+CLASSPATH) - val SCALAHOME = System.getProperty("scala.home", ".") + val SCALAHOME = System.getProperty("scala.home", "..") NestUI.verbose("SCALAHOME: "+SCALAHOME) var JAVACMD = System.getProperty("scalatest.javacmd", "java") val PREFIX = (new File(SCALAHOME)).getAbsolutePath @@ -50,7 +50,7 @@ else }) map {file => file.getCanonicalFile.getAbsolutePath}).mkString(""+File.pathSeparator) } if (debug) { - println("CLASSPATH:") + println("CLASSPATH (" + this + "):") println(CLASSPATH) } diff --git a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala index 350104267f..b4612495c8 100644 --- a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala +++ b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala @@ -108,17 +108,12 @@ class ConsoleRunner extends DirectRunner { NestUI.outline("Source directory is : "+fileManager.srcDir.getAbsolutePath+"\n") NestUI.outline("Scala binaries in : "+fileManager.BIN_DIR+"\n") - // obtain scalac version - val cmd = fileManager.SCALAC_CMD+" -version" - NestUI.verbose("running "+cmd) - val proc = Runtime.getRuntime.exec(cmd) - val in = proc.getInputStream - val err = proc.getErrorStream - val exitCode = proc.waitFor() - NestUI.verbose("exit code: "+exitCode) - val scalaVersion = StreamAppender.appendToString(in, err) - - NestUI.outline("Scala version is : "+scalaVersion) + val scalaVersion = "Scala compiler "+ + scala.tools.nsc.Properties.versionString+ + " -- "+ + scala.tools.nsc.Properties.copyrightString + + NestUI.outline("Scala version is : "+scalaVersion+"\n") NestUI.outline("Scalac options are : "+fileManager.SCALAC_OPTS+"\n") val vmBin = System.getProperty("java.home", "")+File.separator+"bin" diff --git a/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala b/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala index 4b06d677ac..6b0bd9d457 100644 --- a/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala +++ b/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala @@ -29,8 +29,7 @@ class ReflectiveRunner { latestFjbgFile.toURL) val sepLoader = new java.net.URLClassLoader(sepUrls, null) - val debug = System.getProperty("partest.debug", "false") equals "true" - if (debug) { + if (fileManager.debug) { println("Loading classes from:") sepUrls foreach { url => println(url) } } |