Permalink
Browse files

Partest can --show-diff again after incremental report.

A flag is set in NestUI to look for "diff" in the transcript
of failing tests.
  • Loading branch information...
1 parent 4a627e7 commit c31e44fc4e532446136c6900fa645f549d15b409 @som-snytt som-snytt committed May 3, 2013
@@ -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)
@@ -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)

0 comments on commit c31e44f

Please sign in to comment.