diff options
author | Paul Phillips <paulp@improving.org> | 2013-05-10 10:14:42 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-05-10 10:14:42 -0700 |
commit | 4de985c463e51538aa1fd27e5c33ce625b020179 (patch) | |
tree | 5a7de2a24b232c56eb4f6a49c0b36c7cfe1473a9 | |
parent | 9a2f6c75cce22565b994c0b8bd2af8acc6e6f178 (diff) | |
parent | c31e44fc4e532446136c6900fa645f549d15b409 (diff) | |
download | scala-4de985c463e51538aa1fd27e5c33ce625b020179.tar.gz scala-4de985c463e51538aa1fd27e5c33ce625b020179.tar.bz2 scala-4de985c463e51538aa1fd27e5c33ce625b020179.zip |
Merge pull request #2489 from som-snytt/issue/partest-show-diff
Partest can --show-diff again after incremental report.
-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) |