summaryrefslogtreecommitdiff
path: root/src/partest
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-04-06 04:33:27 +0000
committerPaul Phillips <paulp@improving.org>2011-04-06 04:33:27 +0000
commite830a7ce9e1c90b4653c0dfed7992c28410ef6ab (patch)
tree404880e5d68e63ab5b94214c935e75a95ec3b375 /src/partest
parent9c776fda54b5efb0422ef3fe2aaf9b4cd586c72c (diff)
downloadscala-e830a7ce9e1c90b4653c0dfed7992c28410ef6ab.tar.gz
scala-e830a7ce9e1c90b4653c0dfed7992c28410ef6ab.tar.bz2
scala-e830a7ce9e1c90b4653c0dfed7992c28410ef6ab.zip
Fixed a failure output regression I introduced ...
Fixed a failure output regression I introduced working around a process bug. Unrolled the code I'd put in to work around the now-fixed process bug. No review.
Diffstat (limited to 'src/partest')
-rw-r--r--src/partest/scala/tools/partest/nest/Worker.scala30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala
index 2697db475b..301fe5e32b 100644
--- a/src/partest/scala/tools/partest/nest/Worker.scala
+++ b/src/partest/scala/tools/partest/nest/Worker.scala
@@ -285,25 +285,7 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor
*/
def runCommand(command: String, outFile: File): Boolean = {
NestUI.verbose("running command:\n"+command)
-
- // This is laboriously avoiding #> since it swallows exit failure code.
- // To be revisited. XXX.
- val out = new StringBuilder
- val err = new StringBuilder
- val errorLogger = ProcessLogger(x => err append (x + "\n"))
- val pio = BasicIO(
- false,
- x => out append (x + "\n"),
- Some(errorLogger)
- )
- val process = Process(command) run pio
- val code = process.exitValue()
- SFile(outFile) writeAll out.toString
-
- (code == 0) || {
- SFile(outFile).appendAll(command + " failed with code: " + code + "\n", err.toString)
- false
- }
+ (command #> outFile !) == 0
}
def execTest(outDir: File, logFile: File, classpathPrefix: String = ""): Boolean = {
@@ -947,10 +929,12 @@ class Worker(val fileManager: FileManager, params: TestRunParams) extends Actor
wr.flush()
swr.flush()
NestUI.normal(swr.toString)
- if (isFail && (fileManager.showDiff || isPartestDebug) && diff != "")
- NestUI.normal(diff)
- if (isFail && fileManager.showLog)
- showLog(logFile)
+ if (isFail) {
+ if ((fileManager.showDiff || isPartestDebug) && diff != "")
+ NestUI.normal(diff)
+ else if (fileManager.showLog)
+ showLog(logFile)
+ }
}
cleanup()
}