aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_framework.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2015-05-04 16:04:24 +0200
committerPeter Andersson <[email protected]>2015-05-04 16:04:24 +0200
commit1fc847019eadb0190997dfe4fc4f9d97a688b887 (patch)
treef87b9f3548137de99c0d210d4cfdc7f61e18a382 /lib/common_test/src/ct_framework.erl
parentd766187ac01d8b5a73926f2a32bdac44e5933a7a (diff)
parent1378dee07e847c8af91aef1afc66ad0026a8cefb (diff)
downloadotp-1fc847019eadb0190997dfe4fc4f9d97a688b887.tar.gz
otp-1fc847019eadb0190997dfe4fc4f9d97a688b887.tar.bz2
otp-1fc847019eadb0190997dfe4fc4f9d97a688b887.zip
Merge remote-tracking branch 'origin/peppe/common_test/test_categories'
* origin/peppe/common_test/test_categories: Reintroduce functions for backwards compatibility Update handling of failing all/0 function in test suites Add tests for the get_testspec_terms functionality Introduce test categories for OTP tests OTP-11962
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r--lib/common_test/src/ct_framework.erl21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index ea3d7c8218..a699ec3438 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -1062,18 +1062,35 @@ get_all_cases1(_, []) ->
get_all(Mod, ConfTests) ->
case catch apply(Mod, all, []) of
- {'EXIT',_} ->
+ {'EXIT',{undef,[{Mod,all,[],_} | _]}} ->
Reason =
case code:which(Mod) of
non_existing ->
list_to_atom(atom_to_list(Mod)++
- " can not be compiled or loaded");
+ " can not be compiled or loaded");
_ ->
list_to_atom(atom_to_list(Mod)++":all/0 is missing")
end,
%% this makes test_server call error_in_suite as first
%% (and only) test case so we can report Reason properly
[{?MODULE,error_in_suite,[[{error,Reason}]]}];
+ {'EXIT',ExitReason} ->
+ case ct_util:get_testdata({error_in_suite,Mod}) of
+ undefined ->
+ ErrStr = io_lib:format("~n*** ERROR *** "
+ "~w:all/0 failed: ~p~n",
+ [Mod,ExitReason]),
+ io:format(user, ErrStr, []),
+ %% save the error info so it doesn't get printed twice
+ ct_util:set_testdata_async({{error_in_suite,Mod},
+ ExitReason});
+ _ExitReason ->
+ ct_util:delete_testdata({error_in_suite,Mod})
+ end,
+ Reason = list_to_atom(atom_to_list(Mod)++":all/0 failed"),
+ %% this makes test_server call error_in_suite as first
+ %% (and only) test case so we can report Reason properly
+ [{?MODULE,error_in_suite,[[{error,Reason}]]}];
AllTCs when is_list(AllTCs) ->
case catch save_seqs(Mod,AllTCs) of
{error,What} ->