diff options
author | Peter Andersson <[email protected]> | 2015-05-04 16:11:57 +0200 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2015-05-04 16:11:57 +0200 |
commit | 60f7491d074b77d30bb3582c54262aa315c625cb (patch) | |
tree | 8bd3bb033c4bd1ee9091e47e966f9973531a26f5 /lib/common_test/src/ct_framework.erl | |
parent | 1fc847019eadb0190997dfe4fc4f9d97a688b887 (diff) | |
parent | 985215ccba444132fb8e01e72968493402b976a8 (diff) | |
download | otp-60f7491d074b77d30bb3582c54262aa315c625cb.tar.gz otp-60f7491d074b77d30bb3582c54262aa315c625cb.tar.bz2 otp-60f7491d074b77d30bb3582c54262aa315c625cb.zip |
Merge remote-tracking branch 'origin/peppe/common_test/improve_suite_error_reports'
* origin/peppe/common_test/improve_suite_error_reports:
Add missing events and hook function calls
Improve error reports in log when suite compilation fails
OTP-10816
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r-- | lib/common_test/src/ct_framework.erl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index a699ec3438..91368d3137 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -113,6 +113,7 @@ init_tc1(?MODULE,_,error_in_suite,[Config0]) when is_list(Config0) -> ct_event:notify(#event{name=tc_start, node=node(), data={?MODULE,error_in_suite}}), + ct_suite_init(?MODULE, error_in_suite, [], Config0), case ?val(error, Config0) of undefined -> {fail,"unknown_error_in_suite"}; @@ -635,7 +636,20 @@ try_set_default(Name,Key,Info,Where) -> end_tc(Mod, Fun, Args) -> %% Have to keep end_tc/3 for backwards compatibility issues end_tc(Mod, Fun, Args, '$end_tc_dummy'). -end_tc(?MODULE,error_in_suite,_, _) -> % bad start! +end_tc(?MODULE,error_in_suite,{Result,[Args]},Return) -> + %% this clause gets called if CT has encountered a suite that + %% can't be executed + FinalNotify = + case ct_hooks:end_tc(?MODULE, error_in_suite, Args, Result, Return) of + '$ct_no_change' -> + Result; + HookResult -> + HookResult + end, + Event = #event{name=tc_done, + node=node(), + data={?MODULE,error_in_suite,tag(FinalNotify)}}, + ct_event:sync_notify(Event), ok; end_tc(Mod,Func,{TCPid,Result,[Args]}, Return) when is_pid(TCPid) -> end_tc(Mod,Func,TCPid,Result,Args,Return); @@ -1310,6 +1324,8 @@ report(What,Data) -> end, ct_logs:unregister_groupleader(ReportingPid), case {Func,Result} of + {error_in_suite,_} when Suite == ?MODULE -> + ok; {init_per_suite,_} -> ok; {end_per_suite,_} -> |