summaryrefslogtreecommitdiff
path: root/mbld/test.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-08-24 06:07:30 -0700
committerOri Bernstein <ori@eigenstate.org>2018-08-24 06:07:30 -0700
commite54af86927ced66fb7fa8ad744cfb609390f04d8 (patch)
treebb297c1f908ef83ee6544a0bd1c7a424be0ae7c4 /mbld/test.myr
parent93cff6aba077499c3693896cba43b1ceaaca7a62 (diff)
downloadmc-e54af86927ced66fb7fa8ad744cfb609390f04d8.tar.gz
Add -v option, make it print test output.
Diffstat (limited to 'mbld/test.myr')
-rw-r--r--mbld/test.myr10
1 files changed, 8 insertions, 2 deletions
diff --git a/mbld/test.myr b/mbld/test.myr
index bf666fd..a6d703e 100644
--- a/mbld/test.myr
+++ b/mbld/test.myr
@@ -89,8 +89,13 @@ const runtest = {b, n, targs, isbench, failed
| `std.Err m:
std.fatal("\nunable to run test: {}\n", m)
| `std.Ok (pid, infd, outfd):
- log = std.strcat(std.basename(n.lbl), ".log")
- logfd = std.try(std.openmode(log, std.Owrite | std.Ocreat, 0o644))
+ if opt_verbosity >= 1
+ log = ""
+ logfd = std.try(std.dup(std.Out))
+ else
+ log = std.strcat(std.basename(n.lbl), ".log")
+ logfd = std.try(std.openmode(log, std.Owrite | std.Ocreat, 0o644))
+ ;;
sub = showsub(b, n.lbl, outfd, logfd, failed)
std.slfree(log)
std.close(infd)
@@ -118,6 +123,7 @@ const runtest = {b, n, targs, isbench, failed
if !res
std.slpush(failed, std.fmt("{j= }", n.cmd))
;;
+ std.close(logfd)
;;
-> res
}