From da952eb9c08d208dfeef4c78b087486f8489fbe8 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Mon, 11 Jun 2018 17:28:58 +0200 Subject: Make diameter_app_SUITE fail more usefully The badmatch in the grandparent commit is ssl not being installed: === Reason: no match of right hand side value {ssl,non_existing, ["non_existing"]} in function diameter_app_SUITE:app/1 (diameter_app_SUITE.erl, line 266) in call from diameter_app_SUITE:'-xref/1-fun-3-'/2 (diameter_app_SUITE.erl, line 214) in call from lists:'-filter/2-lc$^0/1-0-'/2 (lists.erl, line 1286) in call from diameter_app_SUITE:xref/1 (diameter_app_SUITE.erl, line 214) in call from test_server:ts_tc/3 (test_server.erl, line 1545) in call from test_server:run_test_case_eval1/6 (test_server.erl, line 1063) in call from test_server:run_test_case_eval/9 (test_server.erl, line 995) Tweak the failure a bit more, without fixing it. --- lib/diameter/test/diameter_app_SUITE.erl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/diameter/test/diameter_app_SUITE.erl b/lib/diameter/test/diameter_app_SUITE.erl index 3c1313c296..ef4a28d3f4 100644 --- a/lib/diameter/test/diameter_app_SUITE.erl +++ b/lib/diameter/test/diameter_app_SUITE.erl @@ -208,9 +208,9 @@ xref(Config) -> CTmods = CTmods -- Mods, %% Ensure that runtime modules only call other runtime modules, or - %% applications declared as in runtime_dependencies in the app - %% file. Note that the declared application versions are ignored - %% since we only know what we can see now. + %% applications declared in runtime_dependencies in the app file. + %% The declared application versions are ignored since we only + %% know what we see now. [] = lists:filter(fun(M) -> not lists:member(app(M), Deps) end, RTdeps -- Mods). @@ -261,6 +261,8 @@ app(Mod) -> case code:which(Mod) of preloaded -> "erts"; + Reason when is_atom(Reason) -> + error({Reason, Mod}); Path -> %% match to identify an unexpectedly short path {_, _, [_,_,_|_] = Split} = {Mod, Path, filename:split(Path)}, -- cgit v1.2.3