summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/partest/README8
-rw-r--r--src/partest/scala/tools/partest/nest/AntRunner.scala4
-rw-r--r--src/partest/scala/tools/partest/nest/CompileManager.scala2
-rw-r--r--src/partest/scala/tools/partest/nest/ConsoleFileManager.scala11
-rw-r--r--src/partest/scala/tools/partest/nest/FileManager.scala6
-rw-r--r--src/partest/scala/tools/partest/nest/Worker.scala17
-rw-r--r--src/partest/scala/tools/partest/package.scala18
7 files changed, 32 insertions, 34 deletions
diff --git a/src/partest/README b/src/partest/README
index 27159ca078..81876fc810 100644
--- a/src/partest/README
+++ b/src/partest/README
@@ -1,11 +1,11 @@
How partest choses the compiler / library:
- * ''-Dscalatest.build=build/four-pack'' -> will search for libraries in
+ * ''-Dpartest.build=build/four-pack'' -> will search for libraries in
''lib'' directory of given path
- * ''--pack'' -> will set ''scalatest.build=build/pack'', and run all tests.
+ * ''--pack'' -> will set ''partest.build=build/pack'', and run all tests.
add ''--[kind]'' to run a selected set of tests.
* auto detection:
- - scalatest.build property -> ''bin'' / ''lib'' directories
+ - partest.build property -> ''bin'' / ''lib'' directories
- distribution (''dists/latest'')
- supersabbus pack (''build/pack'')
- sabbus quick (''build/quick'')
@@ -27,6 +27,6 @@ Other arguments:
* --buildmanager next files test the build manager
* --shootout next files are shootout tests
* --script next files test the script runner
- * ''-Dscalatest.scalac_opts=...'' -> add compiler options
+ * ''-Dpartest.scalac_opts=...'' -> add compiler options
* ''--verbose'' -> print verbose messages
* ''-Dpartest.debug=true'' -> print debug messages
diff --git a/src/partest/scala/tools/partest/nest/AntRunner.scala b/src/partest/scala/tools/partest/nest/AntRunner.scala
index 16a7141653..cb819720fc 100644
--- a/src/partest/scala/tools/partest/nest/AntRunner.scala
+++ b/src/partest/scala/tools/partest/nest/AntRunner.scala
@@ -12,6 +12,7 @@ package scala.tools.partest
package nest
import java.io.File
+import scala.tools.nsc.io.{ Directory }
class AntRunner extends DirectRunner {
@@ -20,7 +21,8 @@ class AntRunner extends DirectRunner {
var JAVAC_CMD: String = "javac"
var CLASSPATH: String = _
var LATEST_LIB: String = _
- val TESTROOT: String = ""
+ val testRootPath: String = "test"
+ val testRootDir: Directory = Directory(testRootPath)
}
def reflectiveRunTestsForFiles(kindFiles: Array[File], kind: String) =
diff --git a/src/partest/scala/tools/partest/nest/CompileManager.scala b/src/partest/scala/tools/partest/nest/CompileManager.scala
index b3c6e9b4df..9e58cfbf36 100644
--- a/src/partest/scala/tools/partest/nest/CompileManager.scala
+++ b/src/partest/scala/tools/partest/nest/CompileManager.scala
@@ -65,7 +65,7 @@ class DirectCompiler(val fileManager: FileManager) extends SimpleCompiler {
val args = (path substring 9 split pathSeparator).toList
val plugins = args map (arg =>
if (new File(arg).isAbsolute) arg
- else fileManager.TESTROOT+File.separator+arg
+ else fileManager.testRootPath+File.separator+arg
)
plugins
}
diff --git a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala
index 3277db2ba7..e2d28abba8 100644
--- a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala
+++ b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala
@@ -51,26 +51,23 @@ class ConsoleFileManager extends FileManager {
SCALAC_OPTS = SCALAC_OPTS+" "+moreOpts
}
- val testRootDir = PathSettings.testRoot
- val srcDir = PathSettings.srcDir
+ val srcDir = PathSettings.srcDir
+ val testRootDir = PathSettings.testRoot
+ val testRootPath = testRootDir.toAbsolute.path
+ def testParent = testRootDir.parent
var CLASSPATH = PartestDefaults.classPath
var JAVACMD = PartestDefaults.javaCmd
var JAVAC_CMD = PartestDefaults.javacCmd
- val TESTROOT = testRootDir.toAbsolute.path
- def testParent = testRootDir.parent
NestUI.verbose("CLASSPATH: "+CLASSPATH)
-
if (!srcDir.isDirectory) {
NestUI.failure("Source directory \"" + srcDir.path + "\" not found")
exit(1)
}
- LIB_DIR = (testParent / "lib").normalize.path
-
CLASSPATH = {
val libs = (srcDir / Directory("lib")).files filter (_ hasExtension "jar") map (_.normalize.path)
diff --git a/src/partest/scala/tools/partest/nest/FileManager.scala b/src/partest/scala/tools/partest/nest/FileManager.scala
index 092b9ccba7..12a4fdf40f 100644
--- a/src/partest/scala/tools/partest/nest/FileManager.scala
+++ b/src/partest/scala/tools/partest/nest/FileManager.scala
@@ -33,14 +33,14 @@ trait FileManager {
if (res startsWith "No") "" else res
}
+ def testRootDir: Directory
+ def testRootPath: String
+
var JAVACMD: String
var JAVAC_CMD: String
var CLASSPATH: String
var LATEST_LIB: String
- var LIB_DIR: String = ""
-
- val TESTROOT: String
var showDiff = false
var showLog = false
diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala
index 2e2bcf2271..84fe413301 100644
--- a/src/partest/scala/tools/partest/nest/Worker.scala
+++ b/src/partest/scala/tools/partest/nest/Worker.scala
@@ -139,9 +139,9 @@ class Worker(val fileManager: FileManager) extends Actor {
// fileManager.synchronized {
// withOutputRedirected(logWriter) {
// System.setProperty("java.library.path", logFile.getParentFile.getCanonicalFile.getAbsolutePath)
- // System.setProperty("scalatest.output", outDir.getCanonicalFile.getAbsolutePath)
- // System.setProperty("scalatest.lib", LATEST_LIB)
- // System.setProperty("scalatest.cwd", outDir.getParent)
+ // System.setProperty("partest.output", outDir.getCanonicalFile.getAbsolutePath)
+ // System.setProperty("partest.lib", LATEST_LIB)
+ // System.setProperty("partest.cwd", outDir.getParent)
// ObjectRunner.run(classpath, "Test", List("jvm"))
// }
// }
@@ -234,15 +234,15 @@ class Worker(val fileManager: FileManager) extends Actor {
// because when an option is repeated to java only the last one wins.
// That means until now all the .javaopts files were being ignored because
// they all attempt to change options which are also defined in
- // scalatest.java_opts, leading to debug output like:
+ // partest.java_opts, leading to debug output like:
//
// debug: Found javaopts file 'files/shootout/message.scala-2.javaopts', using options: '-Xss32k'
// debug: java -Xss32k -Xss2m -Xms256M -Xmx1024M -classpath [...]
val propertyOptions = List(
"-Djava.library.path="+logFile.getParentFile.getAbsolutePath,
- "-Dscalatest.output="+outDir.getAbsolutePath,
- "-Dscalatest.lib="+LATEST_LIB,
- "-Dscalatest.cwd="+outDir.getParent,
+ "-Dpartest.output="+outDir.getAbsolutePath,
+ "-Dpartest.lib="+LATEST_LIB,
+ "-Dpartest.cwd="+outDir.getParent,
"-Djavacmd="+JAVACMD,
"-Duser.language=en -Duser.country=US"
) ::: (
@@ -452,8 +452,7 @@ class Worker(val fileManager: FileManager) extends Actor {
NestUI.verbose("compilation of "+file+" succeeded\n")
- val libs = new File(fileManager.LIB_DIR)
- val scalacheckURL = (new File(libs, "ScalaCheck.jar")).toURI.toURL
+ val scalacheckURL = (fileManager.testRootDir.parent / "lib" / "ScalaCheck.jar").toURL
val outURL = outDir.getCanonicalFile.toURI.toURL
val classpath: List[URL] =
List(outURL, scalacheckURL, latestCompFile.toURI.toURL, latestLibFile.toURI.toURL, latestPartestFile.toURI.toURL).distinct
diff --git a/src/partest/scala/tools/partest/package.scala b/src/partest/scala/tools/partest/package.scala
index 68598f6594..d7fcb79235 100644
--- a/src/partest/scala/tools/partest/package.scala
+++ b/src/partest/scala/tools/partest/package.scala
@@ -22,20 +22,20 @@ package object partest {
private def wrapAccessControl[T](body: => Option[T]): Option[T] =
try body catch { case _: java.security.AccessControlException => None }
- def testRootName = propOrNone("scalatest.root")
+ def testRootName = propOrNone("partest.root")
def srcDirName = propOrElse("partest.srcdir", "files")
def testRootDir = testRootName map (x => Directory(x))
def classPath = PathResolver.Environment.javaUserClassPath // XXX
- def javaCmd = propOrElse("scalatest.javacmd", "java")
- def javacCmd = propOrElse("scalatest.javac_cmd", "javac")
- def javaOpts = propOrElse("scalatest.java_opts", "")
- def scalacOpts = propOrElse("scalatest.scalac_opts", "-deprecation")
+ def javaCmd = propOrElse("partest.javacmd", "java")
+ def javacCmd = propOrElse("partest.javac_cmd", "javac")
+ def javaOpts = propOrElse("partest.java_opts", "")
+ def scalacOpts = propOrElse("partest.scalac_opts", "-deprecation")
- def testBuild = propOrNone("scalatest.build")
- def errorCount = propOrElse("scalatest.errors", "0").toInt
- def numActors = propOrElse("scalatest.actors", "8").toInt
+ def testBuild = propOrNone("partest.build")
+ def errorCount = propOrElse("partest.errors", "0").toInt
+ def numActors = propOrElse("partest.actors", "8").toInt
def poolSize = wrapAccessControl(propOrNone("actors.corePoolSize"))
def timeout = "1200000"
@@ -56,5 +56,5 @@ package object partest {
NestUI.verbose(allPropertiesString)
}
- def isPartestDebug = List("partest.debug", "scalatest.debug") map propOrEmpty contains "true"
+ def isPartestDebug = propOrEmpty("partest.debug") == "true"
} \ No newline at end of file