Fixed bug in partest that prevented setting per-test classpath.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@16551 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
e39ce0a721
commit
42d886bf60
|
@ -36,7 +36,7 @@ class DirectCompiler(val fileManager: FileManager) extends SimpleCompiler {
|
|||
new Global(settings, reporter)
|
||||
|
||||
def newGlobal(settings: Settings, logWriter: FileWriter): Global = {
|
||||
val rep = new ExtConsoleReporter(new TestSettings(fileManager),
|
||||
val rep = new ExtConsoleReporter(settings,
|
||||
Console.in,
|
||||
new PrintWriter(logWriter))
|
||||
rep.shortname = true
|
||||
|
@ -89,11 +89,11 @@ class DirectCompiler(val fileManager: FileManager) extends SimpleCompiler {
|
|||
case "scalacheck" =>
|
||||
ScalaCheckTestFile(files(0), fileManager, out.isEmpty)
|
||||
}
|
||||
test.defineSettings(testSettings)
|
||||
test.defineSettings(command.settings)
|
||||
out match {
|
||||
case Some(outDir) =>
|
||||
testSettings.outdir.value = outDir.getAbsolutePath
|
||||
testSettings.classpath.value = testSettings.classpath.value+
|
||||
command.settings.outdir.value = outDir.getAbsolutePath
|
||||
command.settings.classpath.value = command.settings.classpath.value+
|
||||
File.pathSeparator+outDir.getAbsolutePath
|
||||
case None =>
|
||||
// do nothing
|
||||
|
|
|
@ -17,7 +17,8 @@ class TestFile(kind: String, val file: File, val fileManager: FileManager, creat
|
|||
|
||||
// @mutates settings
|
||||
protected def baseSettings(settings: Settings) {
|
||||
settings.classpath.value = dirpath
|
||||
settings.classpath.value = settings.classpath.value+
|
||||
File.pathSeparator+dirpath
|
||||
if (createOutDir)
|
||||
settings.outdir.value = {
|
||||
val outDir = new File(dir, fileBase + "-" + kind + ".obj")
|
||||
|
@ -51,55 +52,57 @@ class TestFile(kind: String, val file: File, val fileManager: FileManager, creat
|
|||
case class PosTestFile(override val file: File, override val fileManager: FileManager, createOutDir: Boolean) extends TestFile("pos", file, fileManager, createOutDir) {
|
||||
override def defineSettings(settings: Settings) {
|
||||
baseSettings(settings)
|
||||
settings.classpath.value = fileManager.CLASSPATH
|
||||
//println("settings.classpath.value="+settings.classpath.value)
|
||||
settings.classpath.value = settings.classpath.value+
|
||||
File.pathSeparator+fileManager.CLASSPATH
|
||||
}
|
||||
}
|
||||
|
||||
case class NegTestFile(override val file: File, override val fileManager: FileManager, createOutDir: Boolean) extends TestFile("neg", file, fileManager, createOutDir) {
|
||||
override def defineSettings(settings: Settings) {
|
||||
baseSettings(settings)
|
||||
settings.classpath.value = fileManager.CLASSPATH
|
||||
//println("settings.classpath.value="+settings.classpath.value)
|
||||
settings.classpath.value = settings.classpath.value+
|
||||
File.pathSeparator+fileManager.CLASSPATH
|
||||
}
|
||||
}
|
||||
|
||||
case class RunTestFile(override val file: File, override val fileManager: FileManager, createOutDir: Boolean) extends TestFile("run", file, fileManager, createOutDir) {
|
||||
override def defineSettings(settings: Settings) {
|
||||
baseSettings(settings)
|
||||
settings.classpath.value = fileManager.CLASSPATH
|
||||
settings.classpath.value = settings.classpath.value+
|
||||
File.pathSeparator+fileManager.CLASSPATH
|
||||
}
|
||||
}
|
||||
|
||||
case class ScalaCheckTestFile(override val file: File, override val fileManager: FileManager, createOutDir: Boolean) extends TestFile("scalacheck", file, fileManager, createOutDir) {
|
||||
override def defineSettings(settings: Settings) {
|
||||
baseSettings(settings)
|
||||
settings.classpath.value = fileManager.CLASSPATH
|
||||
settings.classpath.value = settings.classpath.value+
|
||||
File.pathSeparator+fileManager.CLASSPATH
|
||||
}
|
||||
}
|
||||
|
||||
case class JvmTestFile(override val file: File, override val fileManager: FileManager, createOutDir: Boolean) extends TestFile("jvm", file, fileManager, createOutDir) {
|
||||
override def defineSettings(settings: Settings) {
|
||||
baseSettings(settings)
|
||||
settings.classpath.value = fileManager.CLASSPATH
|
||||
//println("settings.classpath.value="+settings.classpath.value)
|
||||
settings.classpath.value = settings.classpath.value+
|
||||
File.pathSeparator+fileManager.CLASSPATH
|
||||
}
|
||||
}
|
||||
|
||||
case class Jvm5TestFile(override val file: File, override val fileManager: FileManager, createOutDir: Boolean) extends TestFile("jvm5", file, fileManager, createOutDir) {
|
||||
override def defineSettings(settings: Settings) {
|
||||
baseSettings(settings)
|
||||
settings.classpath.value = fileManager.CLASSPATH
|
||||
settings.classpath.value = settings.classpath.value+
|
||||
File.pathSeparator+fileManager.CLASSPATH
|
||||
settings.target.value = "jvm-1.5"
|
||||
//println("settings.classpath.value="+settings.classpath.value)
|
||||
}
|
||||
}
|
||||
|
||||
case class ShootoutTestFile(override val file: File, override val fileManager: FileManager, createOutDir: Boolean) extends TestFile("shootout", file, fileManager, createOutDir) {
|
||||
override def defineSettings(settings: Settings) {
|
||||
baseSettings(settings)
|
||||
settings.classpath.value = fileManager.CLASSPATH
|
||||
//println("settings.classpath.value="+settings.classpath.value)
|
||||
settings.classpath.value = settings.classpath.value+
|
||||
File.pathSeparator+fileManager.CLASSPATH
|
||||
settings.outdir.value = file.getParent
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue