Skip to content

Commit 06bf1b5

Browse files
phalleradriaanm
authored andcommitted
Simplified classpath handling
1 parent 8efa99d commit 06bf1b5

File tree

6 files changed

+21
-23
lines changed

6 files changed

+21
-23
lines changed

scala/tools/partest/nest/ConsoleFileManager.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ else
4040
testroot.getAbsolutePath
4141
}
4242

43-
var EXT_CLASSPATH = {
43+
CLASSPATH = CLASSPATH + File.pathSeparator + {
4444
val libs = new File(TESTROOT, "files/lib")
45-
// add all jars in libs to EXT_CLASSPATH
45+
// add all jars in libs
4646
(libs.listFiles(new FilenameFilter {
4747
def accept(dir: File, name: String) = name endsWith ".jar"
4848
}) map {file => file.getCanonicalFile.getAbsolutePath}).mkString(""+File.pathSeparator)

scala/tools/partest/nest/FileManager.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ trait FileManager {
4747
var JAVACMD: String
4848

4949
var CLASSPATH: String
50-
var EXT_CLASSPATH: String
5150
var LATEST_LIB: String
5251

5352
var showDiff = false

scala/tools/partest/nest/NestUI.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,17 @@ object NestUI {
6161

6262
def usage() {
6363
println("Usage: NestRunner [<options>] [<testfile> ..] [<resfile>]")
64+
println("version Mar3")
6465
println(" --pos next files test a compilation success")
6566
println(" --neg next files test a compilation failure")
66-
println(" --jvm next files test the JVM backend")
6767
println(" --run next files test the interpreter and all backends")
68+
println(" --jvm next files test the JVM backend")
69+
println(" --jvm5 next files test the JVM backend")
70+
println(" --res next files test the resident compiler")
71+
println(" --shootout next files are shootout tests")
72+
println(" --script next files test the script runner")
6873
println(" --verbose display progress information")
69-
println(" --version output version information and exit")
74+
//println(" --version display version information")
7075
println
7176
println("Send bugs to <[email protected]>")
7277
exit(1)

scala/tools/partest/nest/ReflectiveRunner.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ class ReflectiveRunner {
3939

4040
def main(args: String) {
4141
val cargs: Array[AnyRef] = Array(args)
42+
val debug = System.getProperty("partest.debug", "false") equals "true"
43+
if (debug) {
44+
println("Loading classes from:")
45+
sepUrls foreach { url => println(url) }
46+
}
4247
sepMainMethod.invoke(sepRunner, cargs)
4348
}
4449
}

scala/tools/partest/nest/TestFile.scala

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,60 +49,49 @@ class TestFile(kind: String, val file: File, val fileManager: FileManager) {
4949
}
5050

5151
case class PosTestFile(override val file: File, override val fileManager: FileManager) extends TestFile("pos", file, fileManager) {
52-
import fileManager.CLASSPATH
53-
5452
override def defineSettings(settings: Settings) {
5553
baseSettings(settings)
56-
settings.classpath.value = CLASSPATH
54+
settings.classpath.value = fileManager.CLASSPATH
5755
//println("settings.classpath.value="+settings.classpath.value)
5856
}
5957
}
6058

6159
case class NegTestFile(override val file: File, override val fileManager: FileManager) extends TestFile("neg", file, fileManager) {
62-
import fileManager.CLASSPATH
63-
6460
override def defineSettings(settings: Settings) {
6561
baseSettings(settings)
66-
settings.classpath.value = CLASSPATH
62+
settings.classpath.value = fileManager.CLASSPATH
6763
//println("settings.classpath.value="+settings.classpath.value)
6864
}
6965
}
7066

7167
case class RunTestFile(override val file: File, override val fileManager: FileManager) extends TestFile("run", file, fileManager) {
72-
import fileManager.CLASSPATH
7368
override def defineSettings(settings: Settings) {
7469
baseSettings(settings)
75-
settings.classpath.value = CLASSPATH
70+
settings.classpath.value = fileManager.CLASSPATH
7671
}
7772
}
7873

7974
case class JvmTestFile(override val file: File, override val fileManager: FileManager) extends TestFile("jvm", file, fileManager) {
80-
import fileManager.{CLASSPATH, EXT_CLASSPATH}
81-
8275
override def defineSettings(settings: Settings) {
8376
baseSettings(settings)
84-
settings.classpath.value = CLASSPATH+File.pathSeparatorChar+EXT_CLASSPATH
77+
settings.classpath.value = fileManager.CLASSPATH
8578
//println("settings.classpath.value="+settings.classpath.value)
8679
}
8780
}
8881

8982
case class Jvm5TestFile(override val file: File, override val fileManager: FileManager) extends TestFile("jvm5", file, fileManager) {
90-
import fileManager.{CLASSPATH, EXT_CLASSPATH}
91-
9283
override def defineSettings(settings: Settings) {
9384
baseSettings(settings)
94-
settings.classpath.value = CLASSPATH+File.pathSeparatorChar+EXT_CLASSPATH
85+
settings.classpath.value = fileManager.CLASSPATH
9586
settings.target.value = "jvm-1.5"
9687
//println("settings.classpath.value="+settings.classpath.value)
9788
}
9889
}
9990

10091
case class ShootoutTestFile(override val file: File, override val fileManager: FileManager) extends TestFile("shootout", file, fileManager) {
101-
import fileManager.CLASSPATH
102-
10392
override def defineSettings(settings: Settings) {
10493
baseSettings(settings)
105-
settings.classpath.value = CLASSPATH
94+
settings.classpath.value = fileManager.CLASSPATH
10695
//println("settings.classpath.value="+settings.classpath.value)
10796
settings.outdir.value = file.getParent
10897
}

scala/tools/partest/nest/Worker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class Worker(val fileManager: FileManager) extends Actor {
122122
def execTest(outDir: File, logFile: File) {
123123
val cmd =
124124
JAVACMD+
125-
" -classpath "+outDir+File.pathSeparatorChar+CLASSPATH+File.pathSeparatorChar+EXT_CLASSPATH+
125+
" -classpath "+outDir+File.pathSeparatorChar+CLASSPATH+
126126
" -Djava.library.path="+logFile.getParentFile.getAbsolutePath+
127127
" -Dscalatest.output="+outDir.getAbsolutePath+
128128
" -Dscalatest.lib="+LATEST_LIB+

0 commit comments

Comments
 (0)