summaryrefslogtreecommitdiff
path: root/test/rebar_test_utils.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/rebar_test_utils.erl')
-rw-r--r--test/rebar_test_utils.erl22
1 files changed, 13 insertions, 9 deletions
diff --git a/test/rebar_test_utils.erl b/test/rebar_test_utils.erl
index 8d999b4..7c52a18 100644
--- a/test/rebar_test_utils.erl
+++ b/test/rebar_test_utils.erl
@@ -48,15 +48,19 @@ run_and_check(Config, RebarConfig, Command, Expect) ->
%% Assumes init_rebar_state has run first
AppDir = ?config(apps, Config),
State = ?config(state, Config),
- Res = rebar3:run(rebar_state:new(State, RebarConfig, AppDir), Command),
- case Expect of
- {error, Reason} ->
- ?assertEqual({error, Reason}, Res);
- {ok, Expected} ->
- {ok, _} = Res,
- check_results(AppDir, Expected);
- return ->
- Res
+ try
+ Res = rebar3:run(rebar_state:new(State, RebarConfig, AppDir), Command),
+ case Expect of
+ {error, Reason} ->
+ ?assertEqual({error, Reason}, Res);
+ {ok, Expected} ->
+ {ok, _} = Res,
+ check_results(AppDir, Expected);
+ return ->
+ Res
+ end
+ catch
+ rebar_abort when Expect =:= rebar_abort -> rebar_abort
end.
%% @doc Creates a dummy application including: