ref: b77533cb3d625cd5bc7a8779a07f033d4b81b687
parent: 232a0351a3ab39812140fe74499b1330e5e0f514
author: Ori Bernstein <[email protected]>
date: Tue Apr 21 07:24:47 EDT 2015
Don't say tests passed/failed if we didn't run any.
--- a/mbld/test.myr
+++ b/mbld/test.myr
@@ -15,11 +15,13 @@
;;
const test = {b
- var ok, bin
+ var ok, bin, hastest
/* no implicit tests to run */
ok = true
+ hastest = false
if std.fexists("test")
+ hastest = true
for tn in b.all
match gettarg(b.targs, tn)
| `Bin bt:
@@ -37,6 +39,7 @@
for tn in b.all
match gettarg(b.targs, tn)
| `Test t:
+ hastest = true
if t.incpath.len == 0 || !std.sleq(t.incpath[0], ".")
t.incpath = std.slput(t.incpath, 0, std.sldup("."))
;;
@@ -50,11 +53,13 @@
/* skip */
;;
;;
- if ok
- std.put("TESTS PASSED\n")
- else
- std.put("TESTS FAILED\n")
- std.exit(1)
+ if hastest
+ if ok
+ std.put("TESTS PASSED\n")
+ else
+ std.put("TESTS FAILED\n")
+ std.exit(1)
+ ;;
;;
}