aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2015-05-04 16:11:57 +0200
committerPeter Andersson <[email protected]>2015-05-04 16:11:57 +0200
commit60f7491d074b77d30bb3582c54262aa315c625cb (patch)
tree8bd3bb033c4bd1ee9091e47e966f9973531a26f5 /lib/test_server
parent1fc847019eadb0190997dfe4fc4f9d97a688b887 (diff)
parent985215ccba444132fb8e01e72968493402b976a8 (diff)
downloadotp-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/test_server')
-rw-r--r--lib/test_server/src/test_server_ctrl.erl18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl
index bef0658b6d..d0c8a1ebe8 100644
--- a/lib/test_server/src/test_server_ctrl.erl
+++ b/lib/test_server/src/test_server_ctrl.erl
@@ -4776,17 +4776,25 @@ collect_case_subcases(Mod, Case, SubCases, St0, Mode) ->
collect_files(Dir, Pattern, St, Mode) ->
{ok,Cwd} = file:get_cwd(),
Dir1 = filename:join(Cwd, Dir),
- Wc = filename:join([Dir1,Pattern++code:objfile_extension()]),
+ Wc = filename:join([Dir1,Pattern++"{.erl,"++code:objfile_extension()++"}"]),
case catch filelib:wildcard(Wc) of
{'EXIT', Reason} ->
io:format("Could not collect files: ~p~n", [Reason]),
{error,{collect_fail,Dir,Pattern}};
- Mods0 ->
- Mods = [{path_to_module(Mod),all} || Mod <- lists:sort(Mods0)],
- collect_cases(Mods, St, Mode)
+ Files ->
+ %% convert to module names and remove duplicates
+ Mods = lists:foldl(fun(File, Acc) ->
+ Mod = fullname_to_mod(File),
+ case lists:member(Mod, Acc) of
+ true -> Acc;
+ false -> [Mod | Acc]
+ end
+ end, [], Files),
+ Tests = [{Mod,all} || Mod <- lists:sort(Mods)],
+ collect_cases(Tests, St, Mode)
end.
-path_to_module(Path) when is_list(Path) ->
+fullname_to_mod(Path) when is_list(Path) ->
%% If this is called with a binary, then we are probably in +fnu
%% mode and have found a beam file with name encoded as latin1. We
%% will let this crash since it can not work to load such a module