summaryrefslogtreecommitdiff
path: root/src/partest
diff options
context:
space:
mode:
authorPhilipp Haller <hallerp@gmail.com>2008-09-01 17:42:43 +0000
committerPhilipp Haller <hallerp@gmail.com>2008-09-01 17:42:43 +0000
commitcfe1ba4c34795b190a8610889c822d782aa8b1ed (patch)
tree20ecb517bdac5565382338c37e8e0d64b63de768 /src/partest
parente1cb4b5d15a1cc7c73d74a4c997aab45e394ba63 (diff)
downloadscala-cfe1ba4c34795b190a8610889c822d782aa8b1ed.tar.gz
scala-cfe1ba4c34795b190a8610889c822d782aa8b1ed.tar.bz2
scala-cfe1ba4c34795b190a8610889c822d782aa8b1ed.zip
Fixes #1312.
Diffstat (limited to 'src/partest')
-rw-r--r--src/partest/scala/tools/partest/nest/ConsoleRunner.scala21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
index d2f1c7b76e..e5ed9442fb 100644
--- a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
+++ b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
@@ -29,8 +29,6 @@ class ConsoleRunner extends DirectRunner with RunnerUtils {
private var runAll = false
private var testFiles: List[File] = List()
- private val con = new PrintStream(Console.out)
- private var out = con
private val errors =
Integer.parseInt(System.getProperty("scalatest.errors", "0"))
@@ -74,7 +72,10 @@ class ConsoleRunner extends DirectRunner with RunnerUtils {
} else // auto detection, see ConsoleFileManager.findLatest
new ConsoleFileManager
- if (!args.exists(denotesTestSet(_)) && !args.exists(_.endsWith(".scala"))) runAll = true
+ if (!args.exists(denotesTestSet(_)) &&
+ !args.exists(_.endsWith(".scala")) &&
+ !args.exists(_.endsWith(".res"))) runAll = true
+
for (arg <- args) {
arg match {
case "--all" => runAll = true
@@ -95,7 +96,7 @@ class ConsoleRunner extends DirectRunner with RunnerUtils {
case "--version" => //todo: printVersion
case "--ansi" => NestUI.initialize(NestUI.MANY)
case _ =>
- if (arg endsWith ".scala") {
+ if (arg.endsWith(".scala") || arg.endsWith(".res")) {
val file = new File(arg)
if (file.isFile) {
NestUI.verbose("adding test file "+file)
@@ -104,16 +105,10 @@ class ConsoleRunner extends DirectRunner with RunnerUtils {
NestUI.failure("File \"" + arg + "\" not found\n")
System.exit(1)
}
- } else if (out eq con) {
- val file = new File(arg)
- if (file.isFile || file.createNewFile)
- out = new PrintStream(new FileOutputStream(file))
- else {
- NestUI.failure("Result file \"" + arg + "\" not found\n")
- System.exit(1)
- }
- } else
+ } else {
+ NestUI.failure("Invalid option \""+arg+"\"\n")
NestUI.usage()
+ }
}
}