diff options
Diffstat (limited to 'src/partest')
4 files changed, 24 insertions, 13 deletions
diff --git a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala index cc6961f1bf..e33e12af4c 100644 --- a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala +++ b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala @@ -277,7 +277,7 @@ else def getFiles(kind: String, doCheck: Boolean, filter: Option[(String, Boolean)]): List[File] = { val dir = new File(srcDir, kind) NestUI.verbose("look in "+dir+" for tests") - if (dir.isDirectory) { + val files = if (dir.isDirectory) { if (!testFiles.isEmpty) { val dirpath = dir.getAbsolutePath testFiles filter { _.getParentFile.getAbsolutePath == dirpath } @@ -296,11 +296,15 @@ else } dir.listFiles(filter).toList } else // skip - Nil + Nil } else { NestUI.failure("Directory \"" + dir.getPath + "\" not found") Nil } + if (failed) + files filter { logFileExists(_, kind) } + else + files } def getFiles(kind: String, doCheck: Boolean): List[File] = diff --git a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala index 513aee5350..1a2cfd6580 100644 --- a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala +++ b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala @@ -23,8 +23,6 @@ class ConsoleRunner extends DirectRunner with RunnerUtils { List( TestSet("pos", fileFilter, "pos", "Testing compiler (on files whose compilation should succeed)"), - TestSet("pos5", fileFilter, "pos", - "Testing compiler (on files whose compilation should succeed on 1.5 JVM)"), TestSet("neg", fileFilter, "neg", "Testing compiler (on files whose compilation should fail)"), TestSet("run", fileFilter, "run", "Testing JVM backend"), @@ -179,10 +177,11 @@ class ConsoleRunner extends DirectRunner with RunnerUtils { val TestSet(loc, filter, kind, msg) = testSet val files = fileManager.getFiles(loc, true, filter) if (!files.isEmpty) { + NestUI.verbose("test files: "+files) NestUI.outline("\n"+msg+"\n") runTestsForFiles(files, kind) } else { - NestUI.failure("test dir empty\n") + NestUI.verbose("test dir empty\n") (0, 0) } } diff --git a/src/partest/scala/tools/partest/nest/FileManager.scala b/src/partest/scala/tools/partest/nest/FileManager.scala index 625173b767..9c87e7ed6d 100644 --- a/src/partest/scala/tools/partest/nest/FileManager.scala +++ b/src/partest/scala/tools/partest/nest/FileManager.scala @@ -65,4 +65,18 @@ trait FileManager { var JAVA_OPTS = System.getProperty("scalatest.java_opts", "") var timeout = "1200000" + + def getLogFile(dir: File, fileBase: String, kind: String): LogFile = + new LogFile(dir, fileBase + "-" + kind + ".log") + + def getLogFile(file: File, kind: String): LogFile = { + val dir = file.getParentFile + val fileBase = basename(file.getName) + getLogFile(dir, fileBase, kind) + } + + def logFileExists(file: File, kind: String): Boolean = { + val logFile = getLogFile(file, kind) + logFile.exists && logFile.canRead + } } diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala index cc664e37ae..22fb6d606e 100644 --- a/src/partest/scala/tools/partest/nest/Worker.scala +++ b/src/partest/scala/tools/partest/nest/Worker.scala @@ -92,18 +92,12 @@ class Worker(val fileManager: FileManager) extends Actor { var createdLogFiles: List[LogFile] = List() var createdOutputDirs: List[File] = List() - def createLogFile(dir: File, fileBase: String, kind: String): LogFile = { - val logFile = new LogFile(dir, fileBase + "-" + kind + ".log") + def createLogFile(file: File, kind: String): LogFile = { + val logFile = fileManager.getLogFile(file, kind) createdLogFiles = logFile :: createdLogFiles logFile } - def createLogFile(file: File, kind: String): LogFile = { - val dir = file.getParentFile - val fileBase = basename(file.getName) - createLogFile(dir, fileBase, kind) - } - def createOutputDir(dir: File, fileBase: String, kind: String): File = { val outDir = new File(dir, fileBase + "-" + kind + ".obj") if (!outDir.exists) |