diff options
author | michelou <michelou@epfl.ch> | 2007-11-15 16:00:16 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2007-11-15 16:00:16 +0000 |
commit | a7cd73f5f511a8f3e4589a10fd85b69ccb7fe35b (patch) | |
tree | 45804b92095ad2477e9bac7c94eeaea33e659fda | |
parent | 8fc8fb71ac8df99e06c0c64986d6b4922d902d16 (diff) | |
download | scala-a7cd73f5f511a8f3e4589a10fd85b69ccb7fe35b.tar.gz scala-a7cd73f5f511a8f3e4589a10fd85b69ccb7fe35b.tar.bz2 scala-a7cd73f5f511a8f3e4589a10fd85b69ccb7fe35b.zip |
improved code (actor exit problem still pending)
-rw-r--r-- | src/partest/scala/tools/partest/MasterActor.scala | 6 | ||||
-rw-r--r-- | src/partest/scala/tools/partest/TestRunner.scala | 142 | ||||
-rw-r--r-- | src/partest/scala/tools/partest/WorkerActor.scala | 66 | ||||
-rwxr-xr-x | test/partest | 84 |
4 files changed, 177 insertions, 121 deletions
diff --git a/src/partest/scala/tools/partest/MasterActor.scala b/src/partest/scala/tools/partest/MasterActor.scala index 8ead5e5ea8..6f385110ed 100644 --- a/src/partest/scala/tools/partest/MasterActor.scala +++ b/src/partest/scala/tools/partest/MasterActor.scala @@ -27,7 +27,7 @@ import utils.PrintMgr._ class MasterActor(testDir: File, out: PrintStream) extends Actor { import scala.actors.Actor._ - private final val testPathLen = testDir.getPath.length + private final val testPathLen = testDir.getAbsolutePath.length private final val WIDTH = 56 private final val TIMEOUT = 1360000 @@ -129,7 +129,7 @@ class MasterActor(testDir: File, out: PrintStream) extends Actor { } counter += 1 printOutline("testing: ") - val name = file.getPath.substring(testPathLen) + val name = file.getAbsolutePath.substring(testPathLen) print("[...]" + name + List.toString(List.make(WIDTH - name.length, ' ')) + "[") if (succeeded) { printSuccess(" OK ") @@ -143,7 +143,7 @@ class MasterActor(testDir: File, out: PrintStream) extends Actor { out.println(counter - failed) out.close println - exit + System.exit(1) //exit // Help! Philipp. } case msg => diff --git a/src/partest/scala/tools/partest/TestRunner.scala b/src/partest/scala/tools/partest/TestRunner.scala index 36c1d13722..f1edfe2d68 100644 --- a/src/partest/scala/tools/partest/TestRunner.scala +++ b/src/partest/scala/tools/partest/TestRunner.scala @@ -11,7 +11,8 @@ package scala.tools.partest import java.awt.event.{ActionEvent, ActionListener} -import java.io.{File, FilenameFilter, FileOutputStream, PrintStream} +import java.io.{File, FilenameFilter, FileInputStream, FileOutputStream, + PrintStream} import scala.tools.nsc.Settings @@ -23,9 +24,10 @@ import utils.PrintMgr._ * @version 1.0 */ class Test(val kind: String, val file: File) { - val dir = file.getParent + val dir = file.getParentFile + val dirpath = dir.getAbsolutePath protected def baseSettings(settings: Settings) { - settings.classpath.value = dir + settings.classpath.value = dirpath settings.outdir.value = { var outDir = new File(dir, fileBase + "-" + kind + ".obj") outDir.mkdir @@ -60,15 +62,16 @@ case class JVMTest(override val file: File) extends Test("jvm", file) { override def defineSettings(settings: Settings) { baseSettings(settings) settings.target.value = - if (dir endsWith "jvm5") "jvm-1.5" else "jvm-1.4" - settings.classpath.value = System.getProperty("JVMEXTCP") - TestRunner.printVerbose("CLASSPATH="+settings.classpath.value +"\n") + if (dirpath endsWith "jvm5") "jvm-1.5" else "jvm-1.4" + settings.classpath.value = System.getProperty("EXT_CLASSPATH") + TestRunner.printVerbose("CLASSPATH="+settings.classpath.value) } } case class ShootoutTest(override val file: File) extends Test("shootout", file) { override def defineSettings(settings: Settings) { baseSettings(settings) - settings.classpath.value = System.getProperty("JVMEXTCP") + settings.classpath.value = System.getProperty("EXT_CLASSPATH") + TestRunner.printVerbose("CLASSPATH="+settings.classpath.value) } } @@ -77,6 +80,9 @@ case class ShootoutTest(override val file: File) extends Test("shootout", file) * @version 1.0 */ object TestRunner { + private final val version = System.getProperty("java.version", "") + private final val isJava5 = version matches "1.[5|6|7].*" + private var posCheck = false private var negCheck = false private var jvmCheck = false @@ -86,54 +92,120 @@ object TestRunner { private var conservative = false private var verbose = false - private var testDir: File = _ + private val srcDir = { + val dirname = System.getProperty("scalatest.cwd", "") + val dir = if (dirname.isEmpty) { // guess + val libDir = new File(classOf[Test].getResource("/").toURI) + val path = libDir.getAbsolutePath + val parent = libDir.getParentFile + val rootDir = + if (path contains "quick") parent.getParentFile.getParentFile.getParentFile + else if (path contains "dists") parent.getParentFile.getParentFile + else parent + new File(rootDir, "test" + File.separator + "files") + } else + new File(dirname) + dir + } + private val testDir = srcDir.getParentFile + + private var testFiles = new collection.mutable.ListBuffer[File] private val con = new PrintStream(Console.out) private var out = con + private def createTestFile(file: File, suffix: String): File = { + def getBaseName(f: File): String = { + val name = f.getName + val inx = name lastIndexOf '.' + if (inx < 0) name else name.substring(0, inx) + } + def concat(outputFile: File, inputFiles: File*) { + val out = new FileOutputStream(outputFile) + for (f <- inputFiles) { + val in = new FileInputStream(f) + val buf = new Array[Byte](1024) + var len = 0 + while (len != -1) { + out.write(buf, 0, len) + len = in.read(buf) + } + in.close + } + out.close + } + try { + val parent = file.getParentFile + val outDir = new File(parent, getBaseName(file) + "-" + suffix + ".obj") + outDir.mkdir + val testfile = new File(outDir, "test.scala") + val runnerfile = new File(parent, file.getName + ".runner") + concat(testfile, file, runnerfile) + testfile + } + catch { + case e: Exception => + println("Couldn't create test file for \"" + file.getPath + "\"") + file + } + } + private def go { val master = new MasterActor(testDir, out) val filter = new FilenameFilter { def accept(dir: File, name: String): Boolean = name endsWith ".scala" } - def getFiles(kind: String): List[File] = { - val kindDir = "files" + File.separator + kind - val dir = new File(testDir, kindDir) - if (dir.isDirectory) dir.listFiles(filter).toList - else { - println("Directory \"" + testDir.getPath + File.separator + kindDir + "\" not found") + def getFiles(kind: String, doCheck: Boolean): List[File] = { + val dir = new File(srcDir, kind) + if (dir.isDirectory) { + if (! testFiles.isEmpty) { + val dirpath = dir.getAbsolutePath + val files = testFiles filter { _.getParentFile.getAbsolutePath == dirpath } + files.toList + } else if (doCheck) + dir.listFiles(filter).toList + else // skip + Nil + } else { + println("Directory \"" + dir.getPath + "\" not found") Nil } } master.start - if (posCheck) { + val posFiles = getFiles("pos", posCheck) + if (! posFiles.isEmpty) { printOutline("Testing compiler (on files whose compilation should succeed)\n") - for (file <- getFiles("pos")) master ! PosTest(file) + for (file <- posFiles) master ! PosTest(file) } - if (negCheck) { + val negFiles = getFiles("neg", negCheck) + if (! negFiles.isEmpty) { printOutline("Testing compiler (on files whose compilation should fail)\n") - for (file <- getFiles("neg")) master ! NegTest(file) + for (file <- negFiles) master ! NegTest(file) } - if (jvmCheck) { - printOutline("Testing JVM backend\n") - for (file <- getFiles("jvm")) master ! JVMTest(file) - for (file <- getFiles("run")) master ! JVMTest(file) - for (file <- getFiles("jvm5")) master ! JVMTest(file) - } else if (runCheck) { + val jvmFiles = getFiles("jvm", jvmCheck) ::: getFiles("run", jvmCheck) ::: + getFiles("jvm5", jvmCheck && isJava5) + if (! jvmFiles.isEmpty) { printOutline("Testing JVM backend\n") - for (file <- getFiles("run")) master ! JVMTest(file) + for (file <- jvmFiles) master ! JVMTest(file) + } else { + val runFiles = getFiles("run", runCheck) + if (! runFiles.isEmpty) { + printOutline("Testing JVM backend\n") + for (file <- runFiles) master ! JVMTest(file) + } } - if (shootoutCheck) { + val shootFiles = getFiles("shootout", shootoutCheck) + if (! shootFiles.isEmpty) { printOutline("Testing shootout benchmarks\n") - for (file <- getFiles("shootout")) master! ShootoutTest(file) + for (file <- shootFiles) master! ShootoutTest(createTestFile(file, "shootout")) } master ! ("start", conservative) } private def printUsage { - println("Usage: TestRunner [<options>] <testdir> [<resfile>]") + println("Usage: TestRunner [<options>] [<testfile> ..] [<resfile>]") println(" --pos next files test a compilation success") println(" --neg next files test a compilation failure") println(" --jvm next files test the JVM backend") @@ -160,6 +232,11 @@ object TestRunner { } def main(args: Array[String]) { + if (!srcDir.isDirectory) { + println("Test directory \"" + srcDir.getAbsolutePath + "\" not found") + exit(1) + } + printVerbose(srcDir.getAbsolutePath) if (args.length == 0) printUsage else { @@ -174,11 +251,12 @@ object TestRunner { case "--verbose" => verbose = true case "--version" => printVersion case _ => - if (testDir eq null) { - val dir = new File(arg) - if (dir.isDirectory) testDir = dir + if (arg endsWith ".scala") { + val file = new File(arg) + if (file.isFile) + testFiles += file else { - println("Directory \"" + arg + "\" not found") + println("File \"" + arg + "\" not found") exit(1) } } else if (out eq con) { diff --git a/src/partest/scala/tools/partest/WorkerActor.scala b/src/partest/scala/tools/partest/WorkerActor.scala index a76a728f56..88bf957582 100644 --- a/src/partest/scala/tools/partest/WorkerActor.scala +++ b/src/partest/scala/tools/partest/WorkerActor.scala @@ -55,7 +55,12 @@ class WorkerActor(val master: MasterActor, val settings: Settings, var reporter: private val PATH_SEP = java.io.File.pathSeparatorChar private val CLASSPATH = System.getProperty("CLASSPATH", "") - private val EXT_CLASSPATH = System.getProperty("JVMEXTCP", "") + private val EXT_CLASSPATH = System.getProperty("EXT_CLASSPATH", "") + + private val GREP_COMMAND = "grep" + private val GREP_PATTERNS = + List("Console.read", "Scheduler.impl", + "System.exit", "System.out").foldLeft("")((x, y) => x + " -e " + y) def act() { var compiler = newGlobal @@ -68,9 +73,8 @@ class WorkerActor(val master: MasterActor, val settings: Settings, var reporter: var bypassObjectRunner = bypass if (!bypassObjectRunner) { // TODO check the shootout source files for "dangerous" patterns, such as: Console.read, Scheduler.impl, - val dangerousCode = List("Console.read", "Scheduler.impl", "System.exit", "System.out").foldLeft("")((x, y) => x + " -e " + y) - val grepCmd = "grep " + test.file.getPath + " " + dangerousCode - TestRunner.printVerbose("grep cmd: " + grepCmd + "\n") + val grepCmd = GREP_COMMAND + " " + test.file.getPath + " " + GREP_PATTERNS + TestRunner.printVerbose(grepCmd) val grep = Runtime.getRuntime.exec(grepCmd) @@ -101,7 +105,7 @@ class WorkerActor(val master: MasterActor, val settings: Settings, var reporter: compiler = newGlobal(test.logFile) case JVMTest(_) => - //println(test.file.getPath + ": " + test.checkFile.exists + " / " + test.logFile.exists) + TestRunner.printVerbose(test.file.getPath + ": " + test.checkFile.exists + " / " + test.logFile.exists) if (test.checkFile.exists) { var checkReader = new BufferedReader(new FileReader(test.checkFile)) var firstLine = checkReader.readLine @@ -164,24 +168,25 @@ class WorkerActor(val master: MasterActor, val settings: Settings, var reporter: case _ => } - var result = test match { + var success = test match { case NegTest(_) => reporter.hasErrors case _ => !reporter.hasErrors } - (bypassObjectRunner, result, test) match { + (bypassObjectRunner, success, test) match { case (_, _, PosTest(_)) => case (_, _, NegTest(_)) => case (false, true, _) => + /* System.setProperty("scalatest.output", outDir.toString) test match { case ShootoutTest(_) => System.setProperty("scalatest.cwd", test.dir) case _ => {} } - + */ var classpath: List[URL] = outDir.toURL :: - List((new File(test.dir)).toURL) ::: + List(test.dir.toURL) ::: (List.fromString(CLASSPATH, PATH_SEP) map { x => (new File(x)).toURL }) ::: (List.fromString(EXT_CLASSPATH, PATH_SEP) map { x => (new File(x)).toURL }) @@ -194,18 +199,21 @@ class WorkerActor(val master: MasterActor, val settings: Settings, var reporter: out.flush out.close //println(this.toString + " " + "Finished running " + test.fileBase) - } catch { case t => println(t) } + } catch { + case e => + println(e + " (" + test.file.getPath + ")") + } case _ => } - (!bypassObjectRunner && result, test.checkFile.exists, test) match { + (!bypassObjectRunner && success, test.checkFile.exists, test) match { case (_, _, PosTest(_)) => case (true, true, _) => /*var cmd: String = "diff " + test.logFile + " " + test.checkFile //println(this.toString + " Comparing files " + test.fileBase) var proc: Process = Runtime.getRuntime.exec(cmd) proc.waitFor - result = (proc.exitValue == 0)*/ + success = (proc.exitValue == 0)*/ var equalNow = true if (test.checkFile.canRead) { val originStream = new FileInputStream(test.logFile) @@ -216,43 +224,43 @@ class WorkerActor(val master: MasterActor, val settings: Settings, var reporter: for (idx <- 0 until originSize) equalNow = equalNow && (originBuffer(idx) == destBuffer(idx)) if (!equalNow) { - result = false + success = false //println("Diff1: diffs found") } } else { - result = false + success = false //println("Diff1: diffs found") } originSize = originStream.read(originBuffer) } - if (destStream.read(destBuffer) >= 0) result = false + if (destStream.read(destBuffer) >= 0) success = false } case _ => //println("Not testing diff... " + test.test) } - (bypassObjectRunner || !result, test) match { + (bypassObjectRunner || !success, test) match { case (_, PosTest(_)) => case (_, NegTest(_)) => case (true, _) => - result = true + success = true //var javaoptsFile = new File(test.dir, test.fileBase + ".javaopts") //var javaNewOpts = (new BufferedFileReader(javaoptsFile)).readLine //if (javaoptsFile.exists && javaNewOpts != null) {} //Use Runtime.exec to execute the compiled file and pipe the standard system //out and the console out to the logfile - var cmd = - "env JAVACMD=java JAVA_OPTS=-Djava.library.path=\"" + test.dir + "\" " + + val cmd = + "env JAVACMD=java JAVA_OPTS=-Djava.library.path=\"" + test.dirpath + "\" " + System.getProperty("SCALA")+ " -Dscalatest.lib=\"" + System.getProperty("scalatest.lib") + "\" " + - "-Dscalatest.cwd=\"" + test.dir + "\" " + + "-Dscalatest.cwd=\"" + test.dirpath + "\" " + "-Dscalatest.output=" + outDir + " -classpath " + outDir + PATH_SEP + CLASSPATH + PATH_SEP + EXT_CLASSPATH + " Test jvm" - TestRunner.printVerbose("Worker command: " + cmd) + TestRunner.printVerbose(cmd) var execution = Runtime.getRuntime.exec(cmd) @@ -273,7 +281,7 @@ class WorkerActor(val master: MasterActor, val settings: Settings, var reporter: /*var diff = Runtime.getRuntime.exec("diff " + test.logFile + " " + test.checkFile) diff.waitFor - result = (diff.exitValue == 0)*/ + success = (diff.exitValue == 0)*/ var equalNow = true if (test.checkFile.canRead) { val originStream = new FileInputStream(test.logFile) @@ -284,33 +292,33 @@ class WorkerActor(val master: MasterActor, val settings: Settings, var reporter: for (idx <- 0 until originSize) equalNow = equalNow && (originBuffer(idx) == destBuffer(idx)) if (!equalNow) { - result = false + success = false //println("Differences found between the log and check files..") } } else { - result = false + success = false //println("Differences found between the log and check files..") } originSize = originStream.read(originBuffer) } - if (destStream.read(destBuffer) >= 0) result = false + if (destStream.read(destBuffer) >= 0) success = false } //else reportMissing(originFile) case _ => //println("Not Using runtime... " + test.test) } - test.logFile.delete + if (success) test.logFile.delete var end = System.currentTimeMillis //println(test.test + ": " + (end - start)) - //printSuccess(this.toString + " " + fileBase + ": "+ result + "\n") - master ! (test.kind, result, test.file) - dirDelete(outDir) + //println(this.toString + ": "+ success) + master ! (test.kind, success, test.file) + if (success) dirDelete(outDir) } case false => exit diff --git a/test/partest b/test/partest index bcc1c8a84b..4ced476cd9 100755 --- a/test/partest +++ b/test/partest @@ -272,7 +272,7 @@ MSIL="msil" EXE="exe" # Tests the .NET backend. test_run_msil() { - assemblies=`get_os_pathlist $LATEST_ASSEM`; + assemblies=`get_os_pathlist $SCALA_ASSEM`; rm -f "$dstbase".$MSIL && rm -f "$dstbase".$EXE && @@ -431,14 +431,10 @@ test_check_kind() { [ $# -ge 2 ] || abort "internal error"; header="$1"; shift 1; kind="$1"; shift 1; - testdir=`get_os_filename "$TESTROOT"`; + srcdir=`get_os_filename "$SRCDIR"`; resfile=`get_os_filename "$RESFILE"`; if [ "$kind" = "res" ]; then TEST_EXT="res"; else TEST_EXT="scala"; fi; - if [ "$kind" = "pos" -o "$kind" = "neg" ]; then - $SCALA -Dactors.corePoolsize=7 -Dactors.maxPoolSize=8 \ - scala.tools.partest.TestRunner --"$kind" $testdir $resfile 2> /dev/null; - load_results; - elif [ "$kind" = "jvm" ]; then + if [ "$kind" = "testrunner" ]; then javaopts=$JAVA_OPTS; if [ -f "$os_srcbase".javaopts ]; then javaopts="$javaopts `cat "$os_srcbase".javaopts`" @@ -447,43 +443,22 @@ test_check_kind() { javaopts=`echo "$javaopts" | sed -e "s/-Xss[0-9]*[MmKk]//g"` fi; fi; - scala_lib=`get_os_filename "$SCALA_LIB"` && - classpath=`get_os_pathlist $CLASSPATH` && - $SCALA -DSCALA=$SCALA -DJAVA_OPTS="$java_opts -Xss16M" \ - -DJVMEXTCP=$JVM_EXT_CLASSPATH -DCLASSPATH=$classpath \ - -Dactors.corePoolsize=7 -Dactors.maxPoolSize=8 \ - -Dscalatest.lib=$scala_lib -classpath $classpath \ - scala.tools.partest.TestRunner --"$kind" $testdir $resfile 2> /dev/null; - load_results; - elif [ "$kind" = "shootout" ]; then - javaopts=$JAVA_OPTS; - if [ -f "$os_srcbase".javaopts ]; then - javaopts="$javaopts `cat "$os_srcbase".javaopts`" - if [ "$JAVA5" = "false" ]; then - # -Xss option available in Java versions 1.5 or newer - javaopts=`echo "$javaopts" | sed -e "s/-Xss[0-9]*[MmKk]//g"` - fi; + if [ "$TEST_TYPE" = "auto" ]; then + testargs="$FILES_POS $FILES_NEG $FILES_RUN $FILES_JVM $FILES_SHOOTOUT"; + else + testargs=`echo "$TEST_OPTS" --"$TEST_TYPE"` fi; - for file in "" "$@"; do - [ -z "$file" ] && continue; - if [ -d "$file" ]; then - for file2 in "" `find "$file" -name "*.obj" -prune -o -name "*.scala" -a -type f -print`; do - [ -z "$file"/"$file2" ] && continue; - filename=`basename "$file"/"$file2" .scala`; - rm -rf "$file"/"$filename"-"$kind".obj; - mkdir "$file"/"$filename"-"$kind".obj; - cat "$file"/"$filename".scala.runner "$file"/"$filename".scala > "$file"/"$filename"-"$kind".obj/Test.scala 2>/dev/null; - done - fi; - done scala_lib=`get_os_filename "$SCALA_LIB"` && classpath=`get_os_pathlist $CLASSPATH` && - env JAVACMD="$JAVACMDE" $SCALA -DSCALA=$SCALA -DJVMEXTCP=$JVM_EXT_CLASSPATH \ - -Dscalatest.lib=$scala_lib -DCLASSPATH=$classpath \ - -Dactors.corePoolsize=5 -Dactors.maxPoolSize=6 \ - scala.tools.partest.TestRunner --"$kind" $testdir $resfile 2> /dev/null; + $SCALA -DSCALA=$SCALA -DJAVA_OPTS="$javaopts" \ + -DEXT_CLASSPATH=$JVM_EXT_CLASSPATH -DCLASSPATH=$classpath \ + -Dactors.corePoolsize=7 -Dactors.maxPoolSize=8 \ + -Dscalatest.cwd=$srcdir -Dscalatest.lib=$scala_lib \ + -classpath $classpath \ + scala.tools.partest.TestRunner $testargs $resfile 2> /dev/null; load_results; else + [ "$@" ] && printf_outline "$header\\n"; for file in "" "$@"; do [ -z "$file" ] && continue; test_check_file "$file"; @@ -498,12 +473,6 @@ test_check_all() { [ $# = 0 ] || abort "internal error"; test_check_kind "Testing disassembler" \ "dis" $FILES_DIS; - [ "$FILES_JVM" = "" ] || test_check_kind "Testing JVM backend" \ - "jvm" $FILES_RUN $FILES_JVM; - [ "$FILES_POS" = "" ] || test_check_kind "Testing compiler (on files whose compilation should succeed)" \ - "pos" $FILES_POS; - [ "$FILES_NEG" = "" ] || test_check_kind "Testing compiler (on files whose compilation should fail)" \ - "neg" $FILES_NEG; test_check_kind "Testing .NET backend" \ "msil" $FILES_MSIL; test_check_kind "Testing Scala embedded in script files" \ @@ -512,8 +481,8 @@ test_check_all() { "ant" $FILES_ANT; test_check_kind "Testing resident compiler" \ "res" $FILES_RES; - [ "$FILES_SHOOTOUT" = "" ] || test_check_kind "Testing shootout benchmarks" \ - "shootout" $FILES_SHOOTOUT; + test_check_kind "(ignored)" \ + "testrunner" ""; } @@ -625,6 +594,7 @@ OBJDIR=""""; TEST_ALL="true"; TEST_TYPE="auto"; +TEST_OPTS=""; FILES_RUN=""; FILES_JVM=""; FILES_POS=""; @@ -641,6 +611,7 @@ QUICK_LIB="$PREFIX/build/quick/lib/library" QUICK_COMP="$PREFIX/build/quick/lib/compiler" QUICK_ACT="$PREFIX/build/quick/lib/actors" QUICK_PAR="$PREFIX/build/quick/lib/partest" +QUICK_PREDEF="$PREFIX/build/quick/lib/predef.dll" JVM_EXT_CLASSPATH=`get_ext_classpath $TESTROOT/files/lib` @@ -650,22 +621,19 @@ if [ -d "$PREFIX/dists" ]; then LATEST_COMP="$PREFIX/dists/latest/lib/scala-compiler.jar"; LATEST_PAR="$PREFIX/dists/latest/lib/scala-partest.jar"; LATEST_PREDEF="$PREFIX/dists/latest/lib/predef.dll"; - LATEST_ASSEM="$LATEST_PREDEF;$PREFIX/lib/scalaruntime.dll:$PREFIX/lib/mscorlib.dll"; elif [ -d "$PREFIX/build" ]; then LATEST="$QUICK"; LATEST_LIB=$QUICK_LIB LATEST_COMP=$QUICK_COMP LATEST_ACT=$QUICK_ACT LATEST_PAR=$QUICK_PAR - LATEST_PREDEF="$PREFIX/build/quick/lib/predef.dll"; - LATEST_ASSEM="$LATEST_PREDEF:$PREFIX/build/quick/lib/scalaruntime.dll:$PREFIX/build/quick/lib/mscorlib.dll"; + LATEST_PREDEF="$QUICK_PREDEF"; elif [ -d "$PREFIX/bin" ]; then LATEST="$PREFIX/bin"; LATEST_LIB="$PREFIX/lib/scala-library.jar"; LATEST_COMP="$PREFIX/lib/scala-compiler.jar"; LATEST_PAR="$PREFIX/lib/scala-partest.jar"; LATEST_PREDEF="$PREFIX/lib/predef.dll"; - LATEST_ASSEM="$LATEST_PREDEF:$PREFIX/lib/scalaruntime.dll:$PREFIX/lib/mscorlib.dll"; else abort "Scala binaries could not be found"; fi; @@ -676,6 +644,8 @@ SCALA_LIB="$LATEST_LIB"; SCALA_COMP="$LATEST_COMP"; SCALA_ACT="$LATEST_ACT"; SCALA_PAR="$LATEST_PAR"; +SCALA_PREDEF="$LATEST_PREDEF"; +SCALA_RUNTIME="$LATEST_RUNTIME"; [ -x "$JAVACMD" ] || JAVACMD=java; [ -n "$JAVA_OPTS" ] || JAVA_OPTS="-Xmx256M -Xms16M"; @@ -710,7 +680,8 @@ while [ $# -gt 0 ]; do --shootout ) TEST_TYPE="shootout"; shift 1;; --quick ) BIN_DIR="$QUICK/"; SCALA_LIB=$QUICK_LIB; SCALA_COMP=$QUICK_COMP; SCALA_ACT=$QUICK_ACT; - SCALA_PAR=$QUICK_PAR; shift 1;; + SCALA_PAR=$QUICK_PAR; SCALA_PREDEF=$QUICK_PREDEF; + shift 1;; --installed ) BIN_DIR=""; shift 1;; --no-run ) NORUN="true"; shift 1;; --show-log ) SHOWLOG="true"; shift 1;; @@ -726,15 +697,13 @@ while [ $# -gt 0 ]; do --color=* ) COLOR=`expr "$1" : "--color=\(.*\)"`; shift 1;; --objdir=* ) OBJDIR=`expr "$1" : "--objdir=\(.*\)"`; shift 1;; --help| -? ) test_print_help; exit 0;; + --verbose ) TEST_OPTS="--verbose"; shift 1;; --version ) test_print_version; exit 0;; - --profile ) JAVACMDE="$JAVACMD -agentpath:/localhome/thhofer/netbeans-5.5.1/profiler1/lib/deployed/jdk15/linux/libprofilerinterface.so=/localhome/thhofer/netbeans-5.5.1/profiler1/lib,5140"; shift 1;; -* ) abort "unknown option $1";; * ) test_add_file "$1"; shift 1;; esac; done; -[ -x "$JAVACMDE" ] || JAVACMDE=java; - if [ "$JAVA5" = "true" -a "$TEST_TYPE" != "msil" ]; then FLAGS="$FLAGS -target:jvm-1.5" fi; @@ -808,6 +777,7 @@ SCALAC="$SCALAC_CMD $SCALAC_OPTS"; SCALAP="scalap"; CLASSPATH=$SCALA_COMP:$SCALA_ACT:$SCALA_PAR +SCALA_ASSEM=$SCALA_PREDEF:$PREFIX/lib/scalaruntime.dll:$PREFIX/lib/mscorlib.dll RESFILE=`mktemp -t results.XXXXXX`; [ -f "$RESFILE" ] || RESFILE=`get_os_filename "$TESTROOT"/.results.txt` @@ -858,8 +828,8 @@ if [ $TEST_TYPE = "msil" ]; then printf_outline "ILasm version is : $ilasm_version\\n"; mono_version=`$MONO --version | head -1`; printf_outline "Mono version is : $mono_version\\n"; - if [ -f "$LATEST_PREDEF" ]; then - printf_outline "DLL library is : $LATEST_PREDEF\\n"; + if [ -f "$SCALA_PREDEF" ]; then + printf_outline "DLL library is : $SCALA_PREDEF\\n"; else printf_failure "Missing library \"predef.dll\"; run 'ant msil'.\\n"; exit 1; |