diff options
author | Philipp Haller <hallerp@gmail.com> | 2008-10-13 15:56:11 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2008-10-13 15:56:11 +0000 |
commit | 19f4c0652bc32d982453390fac43d411463fc218 (patch) | |
tree | 8284a406fc832c411d312ee21e99e9d97b46ffec | |
parent | ea2ceda18b13f083f5b300e1fbe542fc102fa3eb (diff) | |
download | scala-19f4c0652bc32d982453390fac43d411463fc218.tar.gz scala-19f4c0652bc32d982453390fac43d411463fc218.tar.bz2 scala-19f4c0652bc32d982453390fac43d411463fc218.zip |
ant task for partest now supports multi-file te...
ant task for partest now supports multi-file tests.
-rw-r--r-- | src/partest/scala/tools/partest/PartestTask.scala | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/partest/scala/tools/partest/PartestTask.scala b/src/partest/scala/tools/partest/PartestTask.scala index f62cd732bf..56e9c29f4a 100644 --- a/src/partest/scala/tools/partest/PartestTask.scala +++ b/src/partest/scala/tools/partest/PartestTask.scala @@ -85,14 +85,27 @@ class PartestTask extends Task { private var scalacOpts: Option[String] = None private var timeout: Option[String] = None - private def getPosFiles: Array[File] = - if (!posFiles.isEmpty) { - val files = posFiles.get - (files.getDirectoryScanner(getProject).getIncludedFiles map { fs => new File(files.getDir(getProject), fs) }) + private def getFilesAndDirs(fileSet: Option[FileSet]): Array[File] = + if (!fileSet.isEmpty) { + val files = fileSet.get + val dir = files.getDir(getProject) + val singleFileTests = (files.getDirectoryScanner(getProject).getIncludedFiles map { fs => + new File(dir, fs) }) + // add directories + val dirTests = dir.listFiles(new java.io.FileFilter { + def accept(file: File) = + file.isDirectory && (!file.getName().equals(".svn")) && + (!file.getName().endsWith(".obj")) + }) + (dirTests ++ singleFileTests).toArray } else Array() + + private def getPosFiles: Array[File] = + getFilesAndDirs(posFiles) + private def getNegFiles: Array[File] = if (!negFiles.isEmpty) { val files = negFiles.get @@ -102,12 +115,7 @@ class PartestTask extends Task { Array() private def getRunFiles: Array[File] = - if (!runFiles.isEmpty) { - val files = runFiles.get - (files.getDirectoryScanner(getProject).getIncludedFiles map { fs => new File(files.getDir(getProject), fs) }) - } - else - Array() + getFilesAndDirs(runFiles) private def getResidentFiles: Array[File] = if (!residentFiles.isEmpty) { |