summaryrefslogtreecommitdiff
path: root/mbld
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-01-21 21:31:43 -0800
committerOri Bernstein <ori@eigenstate.org>2016-01-21 21:31:43 -0800
commitd910afb413459ce9a11c5cd2c8b4e32f1d649cc3 (patch)
tree1829ea11d77c216633f5aff6b276a857ec91e89c /mbld
parente89d14c5f41b12f9e3ff6fb2bf9dd4d35db049d9 (diff)
downloadmc-d910afb413459ce9a11c5cd2c8b4e32f1d649cc3.tar.gz
Exit with success status of operations.
Diffstat (limited to 'mbld')
-rw-r--r--mbld/main.myr18
-rw-r--r--mbld/test.myr5
2 files changed, 14 insertions, 9 deletions
diff --git a/mbld/main.myr b/mbld/main.myr
index d29daa7..d7a1c24 100644
--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -23,6 +23,7 @@ const main = {args : byte[:][:]
var tmp
var cmd
var tags
+ var st
cmd = std.optparse(args, &[
.argdesc = "[inputs...]",
@@ -111,17 +112,20 @@ const main = {args : byte[:][:]
else
for c in cmd.args
match c
- | "all": bld.buildall(b)
- | "gen": bld.genall(b)
- | "clean": bld.cleanall(b)
- | "install": bld.install(b)
- | "uninstall": bld.uninstall(b)
- | "test": bld.test(b)
- | target: bld.buildtarg(b, target)
+ | "all": st = bld.buildall(b)
+ | "gen": st = bld.genall(b)
+ | "clean": st = bld.cleanall(b)
+ | "install": st = bld.install(b)
+ | "uninstall": st = bld.uninstall(b)
+ | "test": st = bld.test(b)
+ | target: st = bld.buildtarg(b, target)
;;
;;
;;
;;
+ if (!st)
+ std.exit(1)
+ ;;
}
const buildimm = {b, targ, inputs, bintarg, cleanfirst
diff --git a/mbld/test.myr b/mbld/test.myr
index 920a8a0..83c78e6 100644
--- a/mbld/test.myr
+++ b/mbld/test.myr
@@ -11,7 +11,7 @@ use "util.use"
use "config.use"
pkg bld =
- const test : (b : build# -> void)
+ const test : (b : build# -> bool)
;;
const test = {b
@@ -69,7 +69,7 @@ const test = {b
;;
std.slfree(tests)
if tests.len == 0
- -> void
+ -> true
;;
printfailed(failed)
@@ -82,6 +82,7 @@ const test = {b
else
std.put("TESTS FAILED\n")
;;
+ -> ok
}
const printfailed : (f : byte[:][:] -> void) = {failed