aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2015-04-15 10:52:29 +0200
committerPeter Andersson <[email protected]>2015-04-15 10:52:29 +0200
commitdf823580d5030835bbef089d73f833070419d0ff (patch)
tree9722f15ab09a45e7c53b5adcab1389cbae475b6b /lib/common_test
parent104f74b2b860f2d82547052ed65acca176ebe34c (diff)
downloadotp-df823580d5030835bbef089d73f833070419d0ff.tar.gz
otp-df823580d5030835bbef089d73f833070419d0ff.tar.bz2
otp-df823580d5030835bbef089d73f833070419d0ff.zip
Update handling of failing all/0 function in test suites
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/src/ct_framework.erl37
1 files changed, 18 insertions, 19 deletions
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index 6ac16fef4d..a699ec3438 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -1063,35 +1063,34 @@ get_all_cases1(_, []) ->
get_all(Mod, ConfTests) ->
case catch apply(Mod, all, []) of
{'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");
_ ->
- 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")
+ 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} ->