diff options
Diffstat (limited to 'src/partest')
-rw-r--r-- | src/partest/scala/tools/partest/PartestTask.scala | 41 | ||||
-rw-r--r-- | src/partest/scala/tools/partest/nest/DirectRunner.scala | 5 |
2 files changed, 13 insertions, 33 deletions
diff --git a/src/partest/scala/tools/partest/PartestTask.scala b/src/partest/scala/tools/partest/PartestTask.scala index 1a75621d4d..611321a285 100644 --- a/src/partest/scala/tools/partest/PartestTask.scala +++ b/src/partest/scala/tools/partest/PartestTask.scala @@ -76,7 +76,7 @@ class PartestTask extends Task with CompilationPathProperty { def setSrcDir(input: String) { - srcDir = Some(input) + setProp("partest.srcdir", input) } def setClasspath(input: Path) { @@ -96,11 +96,11 @@ class PartestTask extends Task with CompilationPathProperty { } def setShowLog(input: Boolean) { - showLog = input + antFileManager.showLog = input } def setShowDiff(input: Boolean) { - showDiff = input + antFileManager.showDiff = input } def setErrorOnFailed(input: Boolean) { @@ -108,19 +108,19 @@ class PartestTask extends Task with CompilationPathProperty { } def setJavaCmd(input: File) { - javacmd = Some(input) + antFileManager.JAVACMD = input.getAbsolutePath } def setJavacCmd(input: File) { - javaccmd = Some(input) + antFileManager.JAVAC_CMD = input.getAbsolutePath } def setScalacOpts(opts: String) { - scalacOpts = Some(opts) + antFileManager.SCALAC_OPTS = opts } def setTimeout(delay: String) { - timeout = Some(delay) + antFileManager.timeout = delay } def setDebug(input: Boolean) { @@ -131,13 +131,10 @@ class PartestTask extends Task with CompilationPathProperty { jUnitReportDir = Some(input) } + val antRunner = new scala.tools.partest.nest.AntRunner + val antFileManager = antRunner.fileManager + 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 - private var showLog: Boolean = false - private var runFailed: Boolean = false private var posFiles: Option[FileSet] = None private var negFiles: Option[FileSet] = None private var runFiles: Option[FileSet] = None @@ -151,8 +148,6 @@ class PartestTask extends Task with CompilationPathProperty { private var specializedFiles: Option[FileSet] = None private var presentationFiles: Option[FileSet] = None private var errorOnFailed: Boolean = false - private var scalacOpts: Option[String] = None - private var timeout: Option[String] = None private var jUnitReportDir: Option[File] = None private var debug = false @@ -212,8 +207,6 @@ class PartestTask extends Task with CompilationPathProperty { nest.NestUI._verbose = true } - srcDir foreach (x => setProp("partest.srcdir", x)) - val classpath = this.compilationPath getOrElse sys.error("Mandatory attribute 'compilationPath' is not set.") val scalaLibrary = { @@ -226,21 +219,9 @@ class PartestTask extends Task with CompilationPathProperty { } } getOrElse sys.error("Provided classpath does not contain a Scala library.") - val antRunner = new scala.tools.partest.nest.AntRunner - val antFileManager = antRunner.fileManager - - antFileManager.showDiff = showDiff - antFileManager.showLog = showLog - antFileManager.failed = runFailed antFileManager.CLASSPATH = ClassPath.join(classpath.list: _*) antFileManager.LATEST_LIB = scalaLibrary.getAbsolutePath - javacmd foreach (x => antFileManager.JAVACMD = x.getAbsolutePath) - javaccmd foreach (x => antFileManager.JAVAC_CMD = x.getAbsolutePath) - scalacOpts foreach (antFileManager.SCALAC_OPTS = _) - timeout foreach (antFileManager.timeout = _) - - type TFSet = (Array[File], String, String) val testFileSets = List( (getPosFiles, "pos", "Compiling files that are expected to build"), (getNegFiles, "neg", "Compiling files that are expected to fail"), @@ -256,7 +237,7 @@ class PartestTask extends Task with CompilationPathProperty { (getPresentationFiles, "presentation", "Running presentation compiler test files") ) - def runSet(set: TFSet): (Int, Int, Iterable[String]) = { + def runSet(set: (Array[File], String, String)): (Int, Int, Iterable[String]) = { val (files, name, msg) = set if (files.isEmpty) (0, 0, List()) else { diff --git a/src/partest/scala/tools/partest/nest/DirectRunner.scala b/src/partest/scala/tools/partest/nest/DirectRunner.scala index 4246fce4c4..811e0c46ba 100644 --- a/src/partest/scala/tools/partest/nest/DirectRunner.scala +++ b/src/partest/scala/tools/partest/nest/DirectRunner.scala @@ -8,9 +8,8 @@ package scala.tools.partest package nest -import java.io.{ File } -import java.util.StringTokenizer -import scala.util.Properties.{ setProp } +import java.io.File +import scala.util.Properties.setProp import scala.tools.nsc.util.ScalaClassLoader import scala.tools.nsc.io.Path import scala.collection.{ mutable, immutable } |