diff options
author | Som Snytt <som.snytt@gmail.com> | 2013-05-02 23:56:38 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2013-05-03 00:01:31 -0700 |
commit | c31e44fc4e532446136c6900fa645f549d15b409 (patch) | |
tree | 576786d35073234e114fd7d48542f6a64e1d12b7 /src/partest | |
parent | 4a627e7f279231853f361bbd31032642eabe565c (diff) | |
download | scala-c31e44fc4e532446136c6900fa645f549d15b409.tar.gz scala-c31e44fc4e532446136c6900fa645f549d15b409.tar.bz2 scala-c31e44fc4e532446136c6900fa645f549d15b409.zip |
Partest can --show-diff again after incremental report.
A flag is set in NestUI to look for "diff" in the transcript
of failing tests.
Diffstat (limited to 'src/partest')
-rw-r--r-- | src/partest/scala/tools/partest/nest/ConsoleRunner.scala | 1 | ||||
-rw-r--r-- | src/partest/scala/tools/partest/nest/NestUI.scala | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala index e5ace20062..5717aabb6a 100644 --- a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala +++ b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala @@ -95,6 +95,7 @@ class ConsoleRunner extends DirectRunner { if (parsed isSet "--debug") NestUI.setDebug() if (parsed isSet "--verbose") NestUI.setVerbose() if (parsed isSet "--terse") NestUI.setTerse() + if (parsed isSet "--show-diff") NestUI.setDiffOnFail() // Early return on no args, version, or invalid args if (parsed isSet "--version") return echo(versionMsg) diff --git a/src/partest/scala/tools/partest/nest/NestUI.scala b/src/partest/scala/tools/partest/nest/NestUI.scala index 87ffb0fed2..564270e531 100644 --- a/src/partest/scala/tools/partest/nest/NestUI.scala +++ b/src/partest/scala/tools/partest/nest/NestUI.scala @@ -84,7 +84,13 @@ object NestUI { dotCount += 1 } } - else echo(statusLine(state)) + else { + echo(statusLine(state)) + if (!state.isOk && isDiffy) { + val differ = bold(red("% ")) + "diff " + state.transcript find (_ startsWith differ) foreach (echo(_)) + } + } } def echo(message: String): Unit = synchronized { @@ -172,10 +178,12 @@ object NestUI { var _verbose = false var _debug = false var _terse = false + var _diff = false def isVerbose = _verbose def isDebug = _debug def isTerse = _terse + def isDiffy = _diff def setVerbose() { _verbose = true @@ -186,6 +194,9 @@ object NestUI { def setTerse() { _terse = true } + def setDiffOnFail() { + _diff = true + } def verbose(msg: String) { if (isVerbose) System.err.println(msg) |