summaryrefslogtreecommitdiff
path: root/src/partest
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-03-08 19:58:10 +0000
committerPaul Phillips <paulp@improving.org>2010-03-08 19:58:10 +0000
commit5e6367cca24d2d6c2f4a122b06463fb6f1fe0046 (patch)
tree49f697ca940a4d300e16a13f0c957197e830eaca /src/partest
parent1c795cdd5d2d05f51ad4abe4687c1a2f378412b7 (diff)
downloadscala-5e6367cca24d2d6c2f4a122b06463fb6f1fe0046.tar.gz
scala-5e6367cca24d2d6c2f4a122b06463fb6f1fe0046.tar.bz2
scala-5e6367cca24d2d6c2f4a122b06463fb6f1fe0046.zip
Added test.debug target to build.xml.
tests you have placed in the test/debug directories - critically for those of us stuck debugging ant, this lets one run a small selection of tests by way of ant instead of the console runner. (Sorry about the empty .gitignore files, but one of git's quirks is that it won't acknowledge the existence of an empty directory.) No review.
Diffstat (limited to 'src/partest')
-rw-r--r--src/partest/scala/tools/partest/PartestTask.scala13
-rw-r--r--src/partest/scala/tools/partest/nest/ConsoleFileManager.scala6
2 files changed, 14 insertions, 5 deletions
diff --git a/src/partest/scala/tools/partest/PartestTask.scala b/src/partest/scala/tools/partest/PartestTask.scala
index 4546b58541..afe685a443 100644
--- a/src/partest/scala/tools/partest/PartestTask.scala
+++ b/src/partest/scala/tools/partest/PartestTask.scala
@@ -69,6 +69,10 @@ class PartestTask extends Task with CompilationPathProperty {
scalapFiles = Some(input)
}
+ def setSrcDir(input: String) {
+ srcDir = Some(input)
+ }
+
def setClasspath(input: Path) {
if (classpath.isEmpty)
classpath = Some(input)
@@ -122,6 +126,7 @@ class PartestTask extends Task with CompilationPathProperty {
}
private var classpath: Option[Path] = None
+ private var srcDir: Option[String] = None
private var javacmd: Option[File] = None
private var javaccmd: Option[File] = None
private var showDiff: Boolean = false
@@ -157,8 +162,10 @@ class PartestTask extends Task with CompilationPathProperty {
private def getFilesAndDirs(fileSet: Option[FileSet]): Array[File] = fileSet match {
case None => Array()
case Some(fs) =>
- val fileTests = getFiles(Some(fs))
- val dirTests: Iterator[io.Path] = fileSetToDir(fs).dirs filterNot (x => (x hasExtension "svn") || (x hasExtension "obj"))
+ def shouldExclude(name: String) = (name endsWith ".obj") || (name startsWith ".")
+
+ val fileTests = getFiles(Some(fs)) filterNot (x => shouldExclude(x.getName))
+ val dirTests: Iterator[io.Path] = fileSetToDir(fs).dirs filterNot (x => shouldExclude(x.name))
val dirResult = dirTests.toList.toArray map (_.jfile)
dirResult ++ fileTests
@@ -179,6 +186,8 @@ class PartestTask extends Task with CompilationPathProperty {
if (isPartestDebug)
setProp("partest.debug", "true")
+ srcDir foreach (x => setProp("partest.srcdir", x))
+
val classpath = this.compilationPath getOrElse error("Mandatory attribute 'compilationPath' is not set.")
val scalaLibrary = {
diff --git a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala
index 4fa20c4c13..cd22300500 100644
--- a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala
+++ b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala
@@ -48,9 +48,9 @@ class ConsoleFileManager extends FileManager {
SCALAC_OPTS = SCALAC_OPTS+" "+moreOpts
}
- val srcDir = PathSettings.srcDir
- val testRootDir = PathSettings.testRoot
- val testRootPath = testRootDir.toAbsolute.path
+ lazy val srcDir = PathSettings.srcDir
+ lazy val testRootDir = PathSettings.testRoot
+ lazy val testRootPath = testRootDir.toAbsolute.path
def testParent = testRootDir.parent
var CLASSPATH = PartestDefaults.classPath