diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-05 02:56:08 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-05 02:56:08 +0000 |
commit | 77eb8fefec3e62ead95c7d409ec5a28f30289ec3 (patch) | |
tree | 5e035714a7e6363d1ae7f712d5b1f73c1d27d79e /src/partest | |
parent | 626e38940b72f5e8445ecbece4d41996b5e2842e (diff) | |
download | scala-77eb8fefec3e62ead95c7d409ec5a28f30289ec3.tar.gz scala-77eb8fefec3e62ead95c7d409ec5a28f30289ec3.tar.bz2 scala-77eb8fefec3e62ead95c7d409ec5a28f30289ec3.zip |
Mopping up after the deprecation of exit and er...
Mopping up after the deprecation of exit and error. It is decidedly
non-trivial (at least for the IDE-impaired) to be completely sure of
which error function was being called when there were about twenty with
the same signature in trunk and they are being variously inherited,
imported, shadowed, etc. So although I was careful, the possibility
exists that something is now calling a different "error" function than
before. Caveat programmer.
(And let's all make it our policy not to name anything "error" or "exit"
from here on out....) No review.
Diffstat (limited to 'src/partest')
5 files changed, 13 insertions, 13 deletions
diff --git a/src/partest/scala/tools/partest/PartestTask.scala b/src/partest/scala/tools/partest/PartestTask.scala index 4f829a99ed..043c48e968 100644 --- a/src/partest/scala/tools/partest/PartestTask.scala +++ b/src/partest/scala/tools/partest/PartestTask.scala @@ -192,7 +192,7 @@ class PartestTask extends Task with CompilationPathProperty { srcDir foreach (x => setProp("partest.srcdir", x)) - val classpath = this.compilationPath getOrElse error("Mandatory attribute 'compilationPath' is not set.") + val classpath = this.compilationPath getOrElse system.error("Mandatory attribute 'compilationPath' is not set.") val scalaLibrary = { (classpath.list map { fs => new File(fs) }) find { f => @@ -202,7 +202,7 @@ class PartestTask extends Task with CompilationPathProperty { case _ => false } } - } getOrElse error("Provided classpath does not contain a Scala library.") + } getOrElse system.error("Provided classpath does not contain a Scala library.") val antRunner = new scala.tools.partest.nest.AntRunner val antFileManager = antRunner.fileManager @@ -262,7 +262,7 @@ class PartestTask extends Task with CompilationPathProperty { val allFailures = _results map (_._2) sum val allFailedPaths = _results flatMap (_._3) - def f = if (errorOnFailed && allFailures > 0) error(_) else log(_: String) + def f = if (errorOnFailed && allFailures > 0) (system error _) else log(_: String) def s = if (allFailures > 1) "s" else "" val msg = if (allFailures > 0) diff --git a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala index 58d16a3f45..01b4d848f8 100644 --- a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala +++ b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala @@ -62,7 +62,7 @@ class ConsoleFileManager extends FileManager { if (!srcDir.isDirectory) { NestUI.failure("Source directory \"" + srcDir.path + "\" not found") - exit(1) + system.exit(1) } CLASSPATH = { diff --git a/src/partest/scala/tools/partest/nest/NestUI.scala b/src/partest/scala/tools/partest/nest/NestUI.scala index 4a632a98d5..df8f1a5f74 100644 --- a/src/partest/scala/tools/partest/nest/NestUI.scala +++ b/src/partest/scala/tools/partest/nest/NestUI.scala @@ -98,7 +98,7 @@ object NestUI { println println(utils.Properties.versionString) println("maintained by Philipp Haller (EPFL)") - exit(1) + system.exit(1) } var _verbose = false diff --git a/src/partest/scala/tools/partest/nest/PathSettings.scala b/src/partest/scala/tools/partest/nest/PathSettings.scala index 5ae1ed05ce..ea44d30613 100644 --- a/src/partest/scala/tools/partest/nest/PathSettings.scala +++ b/src/partest/scala/tools/partest/nest/PathSettings.scala @@ -15,14 +15,14 @@ import java.net.URLClassLoader object PathSettings { import PartestDefaults.{ testRootDir, srcDirName } - private def cwd = Directory.Current getOrElse error("user.dir property not set") + private def cwd = Directory.Current getOrElse system.error("user.dir property not set") private def isPartestDir(d: Directory) = (d.name == "test") && (d / srcDirName isDirectory) // Directory <root>/test lazy val testRoot: Directory = testRootDir getOrElse { val candidates: List[Directory] = (cwd :: cwd.parents) flatMap (d => List(d, Directory(d / "test"))) - candidates find isPartestDir getOrElse error("Directory 'test' not found.") + candidates find isPartestDir getOrElse system.error("Directory 'test' not found.") } // Directory <root>/test/files @@ -38,7 +38,7 @@ object PathSettings { // but in the postmodern "sbt" build, it is called target. Look for both. val dirs = Path.onlyDirs(bases flatMap (x => List(x / "build", x / "target"))) - dirs.headOption getOrElse error("Neither 'build' nor 'target' dir found under test root " + testRoot + ".") + dirs.headOption getOrElse system.error("Neither 'build' nor 'target' dir found under test root " + testRoot + ".") } // Directory <root>/build/pack/lib @@ -46,7 +46,7 @@ object PathSettings { lazy val scalaCheck: File = buildPackLibDir.files ++ srcLibDir.files find (_.name startsWith "scalacheck") getOrElse { - error("No scalacheck jar found in '%s' or '%s'".format(buildPackLibDir, srcLibDir)) + system.error("No scalacheck jar found in '%s' or '%s'".format(buildPackLibDir, srcLibDir)) } } diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala index cac6f2dafa..8d4a8f1a5b 100644 --- a/src/partest/scala/tools/partest/nest/Worker.scala +++ b/src/partest/scala/tools/partest/nest/Worker.scala @@ -115,7 +115,7 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor else fileManager.JAVAC_CMD - def error(msg: String): Unit = reporter.error( + def workerError(msg: String): Unit = reporter.error( FakePos("scalac"), msg + "\n scalac -help gives more information" ) @@ -618,7 +618,7 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor val logConsoleWriter = new PrintWriter(logWriter) // create proper settings for the compiler - val settings = new Settings(error) + val settings = new Settings(workerError) settings.outdir.value = outDir.getCanonicalFile.getAbsolutePath settings.sourcepath.value = sourcepath settings.classpath.value = fileManager.CLASSPATH @@ -753,7 +753,7 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor val logConsoleWriter = new PrintWriter(new OutputStreamWriter(logOut)) // create compiler - val settings = new Settings(error) + val settings = new Settings(workerError) settings.sourcepath.value = sourcepath settings.classpath.value = fileManager.CLASSPATH reporter = new ConsoleReporter(settings, scala.Console.in, logConsoleWriter) @@ -767,7 +767,7 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor NestUI.verbose("compiling "+line) val cmdArgs = (line split ' ').toList map (fs => new File(dir, fs).getAbsolutePath) NestUI.verbose("cmdArgs: "+cmdArgs) - val sett = new Settings(error) + val sett = new Settings(workerError) sett.sourcepath.value = sourcepath val command = new CompilerCommand(cmdArgs, sett) (new compiler.Run) compile command.files |