@@ -219,10 +219,10 @@ check_modules(Config) ->
219219 ct :pal (" code:get_path() -> ~p " , [code :get_path ()]),
220220
221221 ? assertEqual (RootDir ++ " _build/default/plugins/lib/rp_a/ebin" , rp_a :f ()),
222- ct :pal (" ~p " , [try file : list_dir (RootDir ++ " _build/default/lib/" ) catch _ : _ -> error end ]),
223- ct :pal (" ~p " , [try file : list_dir (RootDir ++ " _build/default/lib/rp_b/" ) catch _ : _ -> error end ]),
224- ct :pal (" ~p " , [try file : list_dir (RootDir ++ " _build/default/lib/rp_b/ebin" ) catch _ : _ -> error end ]),
225- ct :pal (" ~p " , [try b : module_info () catch _ : _ -> error end ]),
222+ ct :pal (" ~p " , [safe_list_dir (RootDir ++ " _build/default/lib/" )]),
223+ ct :pal (" ~p " , [safe_list_dir (RootDir ++ " _build/default/lib/rp_b/" )]),
224+ ct :pal (" ~p " , [safe_list_dir (RootDir ++ " _build/default/lib/rp_b/ebin" )]),
225+ ct :pal (" ~p " , [safe_module_info ( b ) ]),
226226 ? assertEqual (RootDir ++ " _build/default/lib/rp_b/ebin" , rp_b :f ()),
227227 ? assertEqual (RootDir ++ " _build/default/lib/rp_c/ebin" , rp_c :f ()),
228228 ? assertEqual (RootDir ++ " _build/default/lib/rp_d/ebin" , rp_d :f ()),
@@ -294,3 +294,13 @@ apps_to_str([]) ->
294294apps_to_str (Apps ) ->
295295 AppsStr = unicode :characters_to_list (lists :join (" , " , Apps )),
296296 " stdlib, kernel, " ++ AppsStr .
297+
298+ safe_list_dir (Path ) ->
299+ try file :list_dir (Path )
300+ catch Class :Reason -> {Path , {Class , Reason }}
301+ end .
302+
303+ safe_module_info (Mod ) ->
304+ try Mod :module_info ()
305+ catch Class :Reason -> {Mod , {Class , Reason }}
306+ end .
0 commit comments