diff options
author | Paul Phillips <paulp@improving.org> | 2011-11-07 14:26:52 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-11-07 14:26:52 +0000 |
commit | 5816db58e1f370dd78b3bd9deb47f7d309641294 (patch) | |
tree | 87beda4b8be35a3536c154b1ac103a5424695d09 /src/partest | |
parent | 1c0105dec795bebeb7b12f031b304781d53f5961 (diff) | |
download | scala-5816db58e1f370dd78b3bd9deb47f7d309641294.tar.gz scala-5816db58e1f370dd78b3bd9deb47f7d309641294.tar.bz2 scala-5816db58e1f370dd78b3bd9deb47f7d309641294.zip |
Another round of pleasing the gods of init order.
Moved all the eagerly evaluated bits to the top of the file so I can see
them all at once. Let a dozen vals unroll up front so initialization is
more predictable. No review.
Diffstat (limited to 'src/partest')
-rw-r--r-- | src/partest/scala/tools/partest/DirectTest.scala | 12 | ||||
-rw-r--r-- | src/partest/scala/tools/partest/ReplTest.scala | 6 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/partest/scala/tools/partest/DirectTest.scala b/src/partest/scala/tools/partest/DirectTest.scala index e6e817f96d..6c210f1ac1 100644 --- a/src/partest/scala/tools/partest/DirectTest.scala +++ b/src/partest/scala/tools/partest/DirectTest.scala @@ -24,13 +24,15 @@ abstract class DirectTest extends App { def testOutput = io.Directory(sys.props("partest.output")) // override to add additional settings with strings - def extraSettings: String = "" + def extraSettings = "" // a default Settings object def settings: Settings = newSettings(extraSettings) // a custom Settings object def newSettings(argString: String) = { val s = new Settings - s processArgumentString (argString + " " + debugSettings) + val args = argString + " " + debugSettings + log("newSettings: args = '" + args + "'") + s processArgumentString args s } // compile the code, optionally first adding to the settings @@ -46,8 +48,10 @@ abstract class DirectTest extends App { catch { case t => println(t) ; sys.exit(1) } /** Debugger interest only below this line **/ - protected val isDebug = (sys.props contains "partest.debug") || (sys.env contains "PARTEST_DEBUG") + protected def isDebug = (sys.props contains "partest.debug") || (sys.env contains "PARTEST_DEBUG") protected def debugSettings = sys.props.getOrElse("partest.debug.settings", "") - final def log(msg: => Any) { if (isDebug) Console println msg } + final def log(msg: => Any) { + if (isDebug) Console.err println msg + } } diff --git a/src/partest/scala/tools/partest/ReplTest.scala b/src/partest/scala/tools/partest/ReplTest.scala index 02cf61902a..9c45df9ec5 100644 --- a/src/partest/scala/tools/partest/ReplTest.scala +++ b/src/partest/scala/tools/partest/ReplTest.scala @@ -22,6 +22,10 @@ abstract class ReplTest extends DirectTest { s.Xnojline.value = true transformSettings(s) } - def eval() = ILoop.runForTranscript(code, settings).lines drop 1 + def eval() = { + val s = settings + log("eval(): settings = " + s) + ILoop.runForTranscript(code, s).lines drop 1 + } def show() = eval() foreach println } |