diff options
author | Peter Andersson <[email protected]> | 2014-06-05 16:44:34 +0200 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2015-04-15 10:13:59 +0200 |
commit | 72d1fe572d3eb3748a86042a818d140f682ebc14 (patch) | |
tree | b792c05acc97e25438a329e155d20fbd5ae64bc1 /lib/common_test/src/ct_framework.erl | |
parent | 0fc485a1b487f0b22daf2178e28b2f3edfdc7919 (diff) | |
download | otp-72d1fe572d3eb3748a86042a818d140f682ebc14.tar.gz otp-72d1fe572d3eb3748a86042a818d140f682ebc14.tar.bz2 otp-72d1fe572d3eb3748a86042a818d140f682ebc14.zip |
Introduce test categories for OTP tests
Diffstat (limited to 'lib/common_test/src/ct_framework.erl')
-rw-r--r-- | lib/common_test/src/ct_framework.erl | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index ea3d7c8218..6ac16fef4d 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -1062,14 +1062,32 @@ get_all_cases1(_, []) -> get_all(Mod, ConfTests) -> case catch apply(Mod, all, []) of - {'EXIT',_} -> + {'EXIT',{undef,[{Mod,all,[],_} | _]}} -> + Reason = list_to_atom(atom_to_list(Mod)++":all/0 is missing"), + %% 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} -> 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") + 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, + list_to_atom(atom_to_list(Mod)++":all/0 failed") end, %% this makes test_server call error_in_suite as first %% (and only) test case so we can report Reason properly |