diff options
author | Paul Phillips <paulp@improving.org> | 2011-01-12 02:49:08 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-01-12 02:49:08 +0000 |
commit | 5bada810b4c7eda186aa40b94a78326520b3fa92 (patch) | |
tree | eee2227bf7f53a6b04e9732d887961b403975ab5 /src/partest | |
parent | 566fefb05abe31e90f765d1fb0a89b264302d9ce (diff) | |
download | scala-5bada810b4c7eda186aa40b94a78326520b3fa92.tar.gz scala-5bada810b4c7eda186aa40b94a78326520b3fa92.tar.bz2 scala-5bada810b4c7eda186aa40b94a78326520b3fa92.zip |
Imported sbt.Process into trunk, in the guise o...
Imported sbt.Process into trunk, in the guise of package
scala.sys.process. It is largely indistinguishable from the version in
sbt, at least from the outside.
Also, I renamed package system to sys. I wanted to do that from the
beginning and the desire has only grown since then. Sometimes a short
identifier is just critical to usability: with a function like error("")
called from hundreds of places, the difference between system.error and
sys.error is too big. sys.error and sys.exit have good vibes (at least
as good as the vibes can be for functions which error and exit.)
Note: this is just the first cut. I need to check this in to finish
fixing partest. I will be going over it with a comb and writing
documentation which will leave you enchanted, as well as removing other
bits which are now redundant or inferior. No review.
Diffstat (limited to 'src/partest')
5 files changed, 10 insertions, 10 deletions
diff --git a/src/partest/scala/tools/partest/PartestTask.scala b/src/partest/scala/tools/partest/PartestTask.scala index 043c48e968..7b9f5ff457 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 system.error("Mandatory attribute 'compilationPath' is not set.") + val classpath = this.compilationPath getOrElse sys.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 system.error("Provided classpath does not contain a Scala library.") + } getOrElse sys.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) (system error _) else log(_: String) + def f = if (errorOnFailed && allFailures > 0) (sys 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 01b4d848f8..e108db0c97 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") - system.exit(1) + sys.exit(1) } CLASSPATH = { diff --git a/src/partest/scala/tools/partest/nest/NestUI.scala b/src/partest/scala/tools/partest/nest/NestUI.scala index df8f1a5f74..38110645ba 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)") - system.exit(1) + sys.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 ea44d30613..888df04dec 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 system.error("user.dir property not set") + private def cwd = Directory.Current getOrElse sys.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 system.error("Directory 'test' not found.") + candidates find isPartestDir getOrElse sys.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 system.error("Neither 'build' nor 'target' dir found under test root " + testRoot + ".") + dirs.headOption getOrElse sys.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 { - system.error("No scalacheck jar found in '%s' or '%s'".format(buildPackLibDir, srcLibDir)) + sys.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 ef0a1e910c..7aa4ccc546 100644 --- a/src/partest/scala/tools/partest/nest/Worker.scala +++ b/src/partest/scala/tools/partest/nest/Worker.scala @@ -144,7 +144,7 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor def currentFileElapsed = (System.currentTimeMillis - currentFileStart) / 1000 def forceTimeout() = { println("Let's see what them threads are doing before I kill that test.") - system.allThreads foreach { t => + sys.allThreads foreach { t => println(t) t.getStackTrace foreach println println("") |