diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-02-23 16:09:06 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-02-23 16:15:11 -0600 |
commit | 073d5a06c07c85c0d1794c4a15d564e8463b31fc (patch) | |
tree | dfb53af9f24d8cec55f41ea7024de1060be07c36 /src/main/scala/org/perl8/test/harness/TAPReporter.scala | |
parent | 18854928e8697f733d2758d274151999bcc4a238 (diff) | |
download | scala-test-more-073d5a06c07c85c0d1794c4a15d564e8463b31fc.tar.gz scala-test-more-073d5a06c07c85c0d1794c4a15d564e8463b31fc.zip |
tests shouldn't produce anything other than tap
the harness can parse the tap to figure out whatever it needs from that
Diffstat (limited to 'src/main/scala/org/perl8/test/harness/TAPReporter.scala')
-rw-r--r-- | src/main/scala/org/perl8/test/harness/TAPReporter.scala | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/main/scala/org/perl8/test/harness/TAPReporter.scala b/src/main/scala/org/perl8/test/harness/TAPReporter.scala index e478880..574dd39 100644 --- a/src/main/scala/org/perl8/test/harness/TAPReporter.scala +++ b/src/main/scala/org/perl8/test/harness/TAPReporter.scala @@ -1,9 +1,25 @@ package org.perl8.test.harness +import java.io.ByteArrayOutputStream + +import org.perl8.test.tap import org.perl8.test.Test import Utils._ class TAPReporter extends Reporter { - def run (testName: String): Int = - newInstance[Test](testName).run + def run (testName: String): Int = { + val out = new ByteArrayOutputStream + Console.withOut(out) { + Console.withErr(out) { + newInstance[Test](testName).run + } + } + + // XXX this is wrong: it sends everything to stdout + // need to write a tee-like outputstream to fix it + print(out) + + val result = tap.Consumer.parse(out) + result.exitCode + } } |