diff options
author | Jon Meredith <jon.hg@jonmeredith.com> | 2009-12-04 07:58:21 -0700 |
---|---|---|
committer | Jon Meredith <jon.hg@jonmeredith.com> | 2009-12-04 07:58:21 -0700 |
commit | 63d4968e36275e4d8ab4698d002b0e5db6d0d7a1 (patch) | |
tree | 37e9ee0c8fe91aa2e1b09139115bc5be7147f7f6 | |
parent | 048179ab83ddff502091dd7d031a57d0a01dd060 (diff) |
Added check for suite compilation failures to rebar_ct.
-rw-r--r-- | src/rebar_ct.erl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl index 2cb2f8f..007e09f 100644 --- a/src/rebar_ct.erl +++ b/src/rebar_ct.erl @@ -102,13 +102,21 @@ clear_log(RawLog) -> %% calling ct with erl does not return non-zero on failure - have to check %% log results check_log(RawLog) -> - Msg = os:cmd("grep 'TEST COMPLETE' " ++ RawLog), - case string:str(Msg, ", 0 failed") of - 0 -> + Msg = os:cmd("grep -e 'TEST COMPLETE' -e '{error,make_failed}' " ++ RawLog), + MakeFailed = string:str(Msg, "{error,make_failed}") =/= 0, + RunFailed = string:str(Msg, ", 0 failed") =:= 0, + if + MakeFailed -> + show_log(RawLog), + ?ERROR("Building tests failed\n",[]), + ?FAIL; + + RunFailed -> show_log(RawLog), ?ERROR("One or more tests failed\n",[]), ?FAIL; - _ -> + + true -> ?CONSOLE("DONE. ~s\n", [Msg]) end. |