diff options
author | Tristan Sloughter <tristan.sloughter@gmail.com> | 2014-12-04 20:29:10 -0600 |
---|---|---|
committer | Tristan Sloughter <tristan.sloughter@gmail.com> | 2014-12-04 20:29:10 -0600 |
commit | fcd2ec662b7c275956ef0b996566307307e6d8a8 (patch) | |
tree | a0a61246a51ff01171c1002a9b27ceb33ee02d41 /src | |
parent | 1a88cc285375e5558b12de502b515ef2ce503028 (diff) | |
parent | b649d3e254a6883596474e88c5d54e7c7a4877c1 (diff) |
Merge pull request #38 from omarkj/omarkj-support-ct-repeates
Support a list of ct_run results
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_common_test.erl | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl index 3d64517..20d554e 100644 --- a/src/rebar_prv_common_test.erl +++ b/src/rebar_prv_common_test.erl @@ -38,11 +38,11 @@ do(State) -> Opts1 = transform_opts(Opts), ok = create_dirs(Opts1), expand_test_deps(filename:join(rebar_dir:profile_dir(State), ?DEFAULT_DEPS_DIR)), - case ct:run_test(Opts1) of - {_, 0, _} -> {ok, State}; - {_, FailedCount, _} -> {error, {?MODULE, {failures_running_tests, - FailedCount}}}; - {error, Reason} -> {error, {?MODULE, {error_running_tests, Reason}}} + case handle_results(ct:run_test(Opts1)) of + {error, Reason} -> + {error, {?MODULE, Reason}}; + ok -> + {ok, State} end. -spec format_error(any()) -> iolist(). @@ -240,3 +240,19 @@ help(ct_hooks) -> ""; help(userconfig) -> "". + +handle_results([Result]) -> + handle_results(Result); +handle_results([Result|Results]) when is_list(Results) -> + case handle_results(Result) of + ok -> + handle_results(Results); + Error -> + Error + end; +handle_results({_, 0, _}) -> + ok; +handle_results({_, FailedCount, _}) -> + {error, {failures_running_tests, FailedCount}}; +handle_results({error, Reason}) -> + {error, {error_running_tests, Reason}}. |