summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-11-25 08:38:12 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-11-25 08:38:12 -0500
commitc88ae0814f322f82e8daf53b19086326bbca0327 (patch)
tree9980c074464ca3688aa51e7c131e13d787d84146
parent41b0fd58713cba30bcb8cdf964fa9a526a5ab20d (diff)
Exit code of 1 on compilation failure
-rw-r--r--src/compiler.sml6
-rw-r--r--tests/bad.ur1
-rw-r--r--tests/bad.urp2
3 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 6fd107a7..c4000e84 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -928,16 +928,16 @@ fun compileC {cname, oname, ename, libs, profile, debug, link = link'} =
val link = foldl (fn (s, link) => link ^ " " ^ s) link link'
in
if not (OS.Process.isSuccess (OS.Process.system compile)) then
- print "C compilation failed\n"
+ OS.Process.exit OS.Process.failure
else if not (OS.Process.isSuccess (OS.Process.system link)) then
- print "C linking failed\n"
+ OS.Process.exit OS.Process.failure
else
()
end
fun compile job =
case run toChecknest job of
- NONE => print "Ur compilation failed\n"
+ NONE => OS.Process.exit OS.Process.failure
| SOME file =>
let
val job = valOf (run (transform parseUrp "parseUrp") job)
diff --git a/tests/bad.ur b/tests/bad.ur
new file mode 100644
index 00000000..60419db7
--- /dev/null
+++ b/tests/bad.ur
@@ -0,0 +1 @@
+fun main $ = 0
diff --git a/tests/bad.urp b/tests/bad.urp
new file mode 100644
index 00000000..3e17f350
--- /dev/null
+++ b/tests/bad.urp
@@ -0,0 +1,2 @@
+
+bad