summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.xml29
-rw-r--r--src/partest/scala/tools/partest/PartestTask.scala13
-rw-r--r--src/partest/scala/tools/partest/nest/ConsoleFileManager.scala6
-rw-r--r--test/debug/buildmanager/.gitignore0
-rw-r--r--test/debug/jvm/.gitignore0
-rw-r--r--test/debug/neg/.gitignore0
-rw-r--r--test/debug/pos/.gitignore0
-rw-r--r--test/debug/res/.gitignore0
-rw-r--r--test/debug/run/.gitignore0
-rw-r--r--test/debug/scalacheck/.gitignore0
-rw-r--r--test/debug/scalap/.gitignore0
-rw-r--r--test/debug/shootout/.gitignore0
12 files changed, 33 insertions, 15 deletions
diff --git a/build.xml b/build.xml
index 396a263769..4d3413e545 100644
--- a/build.xml
+++ b/build.xml
@@ -1392,6 +1392,13 @@ BOOTRAPING TEST AND TEST SUITE
<exclude name="*.complete"/>
</same>
</target>
+
+ <!-- this target will run only those tests found in test/debug -->
+ <target name="test.debug">
+ <antcall target="test.suite">
+ <param name="partest.srcdir" value="debug" />
+ </antcall>
+ </target>
<target name="test.run" depends="pack.done">
<partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java"
@@ -1409,24 +1416,26 @@ BOOTRAPING TEST AND TEST SUITE
</target>
<target name="test.suite" depends="pack.done">
+ <property name="partest.srcdir" value="files" />
<partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java"
- timeout="2400000" javaccmd="${javac.cmd}"
+ timeout="2400000" javaccmd="${javac.cmd}"
+ srcdir="${partest.srcdir}"
scalacopts="${scalac.args.optimise}">
<compilationpath>
<path refid="pack.classpath"/>
<fileset dir="${partest.dir}/files/lib" includes="*.jar" />
</compilationpath>
- <postests dir="${partest.dir}/files/pos" includes="*.scala"/>
- <negtests dir="${partest.dir}/files/neg" includes="*.scala"/>
- <runtests dir="${partest.dir}/files">
+ <postests dir="${partest.dir}/${partest.srcdir}/pos" includes="*.scala"/>
+ <negtests dir="${partest.dir}/${partest.srcdir}/neg" includes="*.scala"/>
+ <runtests dir="${partest.dir}/${partest.srcdir}">
<include name="run/**/*.scala"/>
</runtests>
- <jvmtests dir="${partest.dir}/files/jvm" includes="*.scala"/>
- <scalachecktests dir="${partest.dir}/files/scalacheck" includes="**/*.scala"/>
- <residenttests dir="${partest.dir}/files/res" includes="*.res"/>
- <buildmanagertests dir="${partest.dir}/files/buildmanager" includes="*"/>
- <scalaptests dir="${partest.dir}/files/scalap" includes="**/*.scala"/>
- <!-- <scripttests dir="${partest.dir}/files/script" includes="*.scala"/> -->
+ <jvmtests dir="${partest.dir}/${partest.srcdir}/jvm" includes="*.scala"/>
+ <scalachecktests dir="${partest.dir}/${partest.srcdir}/scalacheck" includes="**/*.scala"/>
+ <residenttests dir="${partest.dir}/${partest.srcdir}/res" includes="*.res"/>
+ <buildmanagertests dir="${partest.dir}/${partest.srcdir}/buildmanager" includes="*"/>
+ <scalaptests dir="${partest.dir}/${partest.srcdir}/scalap" includes="**/*.scala"/>
+ <!-- <scripttests dir="${partest.dir}/${partest.srcdir}/script" includes="*.scala"/> -->
</partest>
</target>
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
diff --git a/test/debug/buildmanager/.gitignore b/test/debug/buildmanager/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/debug/buildmanager/.gitignore
diff --git a/test/debug/jvm/.gitignore b/test/debug/jvm/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/debug/jvm/.gitignore
diff --git a/test/debug/neg/.gitignore b/test/debug/neg/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/debug/neg/.gitignore
diff --git a/test/debug/pos/.gitignore b/test/debug/pos/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/debug/pos/.gitignore
diff --git a/test/debug/res/.gitignore b/test/debug/res/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/debug/res/.gitignore
diff --git a/test/debug/run/.gitignore b/test/debug/run/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/debug/run/.gitignore
diff --git a/test/debug/scalacheck/.gitignore b/test/debug/scalacheck/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/debug/scalacheck/.gitignore
diff --git a/test/debug/scalap/.gitignore b/test/debug/scalap/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/debug/scalap/.gitignore
diff --git a/test/debug/shootout/.gitignore b/test/debug/shootout/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/debug/shootout/.gitignore