1%%
2%% %CopyrightBegin%
3%%
4%% Copyright Ericsson AB 2015-2018. All Rights Reserved.
5%%
6%% Licensed under the Apache License, Version 2.0 (the "License");
7%% you may not use this file except in compliance with the License.
8%% You may obtain a copy of the License at
9%%
10%%     http://www.apache.org/licenses/LICENSE-2.0
11%%
12%% Unless required by applicable law or agreed to in writing, software
13%% distributed under the License is distributed on an "AS IS" BASIS,
14%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15%% See the License for the specific language governing permissions and
16%% limitations under the License.
17%%
18%% %CopyrightEnd%
19%%
20-module(z_SUITE).
21
22-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
23	 init_per_group/2,end_per_group/2,
24	 loaded/1]).
25
26suite() -> [{ct_hooks,[ts_install_cth]}].
27
28all() ->
29    [loaded].
30
31groups() ->
32    [].
33
34init_per_suite(Config) ->
35    test_lib:recompile(?MODULE),
36    Config.
37
38end_per_suite(_Config) ->
39    ok.
40
41init_per_group(_GroupName, Config) ->
42    Config.
43
44end_per_group(_GroupName, Config) ->
45    Config.
46
47loaded(_Config) ->
48    0 = do_loaded(code:all_loaded(), 0),
49    ok.
50
51do_loaded([{M,_}|Ms], E0) ->
52    E = try
53	    _ = M:module_info(),
54	    _ = M:module_info(functions),
55	    E0
56	catch
57	    C:Error:Stk ->
58		io:format("~p:~p\n~p\n", [C,Error,Stk]),
59		E0 + 1
60	end,
61    do_loaded(Ms, E);
62do_loaded([], E) -> E.
63