diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-04-06 19:46:34 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-04-07 12:10:13 +0200 |
commit | 8ccea1c2c756d8bc548ee6ba3e10f5a583aca7e7 (patch) | |
tree | db703599c096483483796be01982d5a1bf75c072 /lib | |
parent | 146dfa9ddc3b31649ef581d65f3cb00ef95af10f (diff) | |
download | otp-8ccea1c2c756d8bc548ee6ba3e10f5a583aca7e7.tar.gz otp-8ccea1c2c756d8bc548ee6ba3e10f5a583aca7e7.tar.bz2 otp-8ccea1c2c756d8bc548ee6ba3e10f5a583aca7e7.zip |
Modernize use of timetraps
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tools/test/cover_SUITE.erl | 19 | ||||
-rw-r--r-- | lib/tools/test/cprof_SUITE.erl | 29 | ||||
-rw-r--r-- | lib/tools/test/emem_SUITE.erl | 43 | ||||
-rw-r--r-- | lib/tools/test/eprof_SUITE.erl | 29 | ||||
-rw-r--r-- | lib/tools/test/fprof_SUITE.erl | 46 | ||||
-rw-r--r-- | lib/tools/test/instrument_SUITE.erl | 40 | ||||
-rw-r--r-- | lib/tools/test/lcnt_SUITE.erl | 52 | ||||
-rw-r--r-- | lib/tools/test/make_SUITE.erl | 2 | ||||
-rw-r--r-- | lib/tools/test/tools_SUITE.erl | 34 | ||||
-rw-r--r-- | lib/tools/test/xref_SUITE.erl | 52 |
10 files changed, 66 insertions, 280 deletions
diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl index 50d9f99497..421957315c 100644 --- a/lib/tools/test/cover_SUITE.erl +++ b/lib/tools/test/cover_SUITE.erl @@ -23,7 +23,8 @@ -include_lib("common_test/include/ct.hrl"). -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}]. all() -> NoStartStop = [eif,otp_5305,otp_5418,otp_7095,otp_8273, @@ -42,21 +43,12 @@ all() -> [coverage|NoStartStop++[coverage_analysis]] end. -groups() -> - []. - init_per_suite(Config) -> [{ct_is_running_cover,whereis(cover_server) =/= undefined}|Config]. end_per_suite(_Config) -> ok. -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - init_per_testcase(TC, Config) when TC =:= misc; TC =:= compile; TC =:= analyse; @@ -950,16 +942,13 @@ export_import(Config) when is_list(Config) -> otp_5031(suite) -> []; otp_5031(Config) when is_list(Config) -> - - Dog = ?t:timetrap(?t:seconds(10)), + ct:timetrap({seconds, 10}), {ok,N1} = ?t:start_node(cover_SUITE_otp_5031,slave,[]), {ok,[N1]} = cover:start(N1), {error,not_main_node} = rpc:call(N1,cover,modules,[]), cover:stop(), ?t:stop_node(N1), - - ?t:timetrap_cancel(Dog), ok. eif(doc) -> @@ -1846,7 +1835,7 @@ cover_which_nodes(Expected) -> case cover:which_nodes() of Expected -> ok; _ -> - ?t:sleep(100), + timer:sleep(100), Retry() end end), diff --git a/lib/tools/test/cprof_SUITE.erl b/lib/tools/test/cprof_SUITE.erl index 1dd4634303..404b2fe738 100644 --- a/lib/tools/test/cprof_SUITE.erl +++ b/lib/tools/test/cprof_SUITE.erl @@ -64,25 +64,23 @@ config(data_dir, _) -> "cprof_SUITE_data". -else. %% When run in test server. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2, +-export([all/0, suite/0, init_per_testcase/2, end_per_testcase/2, not_run/1]). -export([basic/1, on_load/1, modules/1]). init_per_testcase(_Case, Config) -> - Dog=test_server:timetrap(test_server:seconds(30)), - [{watchdog, Dog}|Config]. + Config. -end_per_testcase(_Case, Config) -> +end_per_testcase(_Case, _Config) -> erlang:trace_pattern({'_','_','_'}, false, [local,meta,call_count]), erlang:trace_pattern(on_load, false, [local,meta,call_count]), erlang:trace(all, false, [all]), - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), ok. -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap,{seconds,30}}]. all() -> case test_server:is_native(cprof_SUITE) of @@ -90,21 +88,6 @@ all() -> false -> [basic, on_load, modules] end. -groups() -> - []. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - not_run(Config) when is_list(Config) -> {skipped,"Native code"}. diff --git a/lib/tools/test/emem_SUITE.erl b/lib/tools/test/emem_SUITE.erl index 06e07b28f2..7865c91f31 100644 --- a/lib/tools/test/emem_SUITE.erl +++ b/lib/tools/test/emem_SUITE.erl @@ -19,15 +19,11 @@ %% -module(emem_SUITE). -%%-define(line_trace, 1). - --export([init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0, + init_per_testcase/2, end_per_testcase/2, + init_per_suite/1, end_per_suite/1, receive_and_save_trace/2, send_trace/2]). - --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, - init_per_testcase/2, end_per_testcase/2]). - -export([live_node/1, 'sparc_sunos5.8_32b_emt2.0'/1, 'pc_win2000_32b_emt2.0'/1, @@ -42,11 +38,8 @@ 'sparc_sunos5.8_64b_emt1.0'/1]). -include_lib("kernel/include/file.hrl"). - -include_lib("common_test/include/ct.hrl"). --define(DEFAULT_TIMEOUT, ?t:minutes(5)). - -define(EMEM_64_32_COMMENT, "64 bit trace; this build of emem can only handle 32 bit traces"). @@ -62,28 +55,19 @@ exit_code}). %% -%% %% Exported suite functions %% -%% -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap,{minutes,5}}]. all() -> case is_debug_compiled() of - true -> {skip, "Not run when debug compiled"}; - false -> test_cases() + true -> {skip, "Not run when debug compiled"}; + false -> test_cases() end. -groups() -> - []. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - test_cases() -> [live_node, 'sparc_sunos5.8_32b_emt2.0', @@ -99,22 +83,17 @@ test_cases() -> init_per_testcase(Case, Config) when is_list(Config) -> case maybe_skip(Config) of - {skip, _}=Skip -> Skip; + {skip, _}=Skip -> + Skip; ok -> - Dog = ?t:timetrap(?DEFAULT_TIMEOUT), - %% Until emem is completely stable we run these tests in a working %% directory with an ignore_core_files file which will make the %% search for core files ignore cores generated by this suite. - ignore_cores:setup(?MODULE, - Case, - [{watchdog, Dog}, {testcase, Case} | Config]) + ignore_cores:setup(?MODULE, Case, [{testcase, Case}|Config]) end. end_per_testcase(_Case, Config) when is_list(Config) -> ignore_cores:restore(Config), - Dog = ?config(watchdog, Config), - ?t:timetrap_cancel(Dog), ok. maybe_skip(Config) -> diff --git a/lib/tools/test/eprof_SUITE.erl b/lib/tools/test/eprof_SUITE.erl index 6274eabc37..a8de8ff921 100644 --- a/lib/tools/test/eprof_SUITE.erl +++ b/lib/tools/test/eprof_SUITE.erl @@ -21,32 +21,16 @@ -include_lib("common_test/include/ct.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2]). - +-export([all/0, suite/0]). -export([tiny/1,eed/1,basic/1,basic_option/1]). -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap,{seconds,60}}]. all() -> [basic, basic_option, tiny, eed]. -groups() -> - []. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - - basic(suite) -> []; basic(Config) when is_list(Config) -> @@ -184,7 +168,6 @@ tiny(Config) when is_list(Config) -> {ok, OldCurDir} = file:get_cwd(), Datadir = ?config(data_dir, Config), Privdir = ?config(priv_dir, Config), - TTrap=?t:timetrap(60*1000), % (Trace)Compile to priv_dir and make sure the correct version is loaded. {ok,eprof_suite_test} = compile:file(filename:join(Datadir, "eprof_suite_test"), @@ -200,7 +183,6 @@ tiny(Config) when is_list(Config) -> ok = eprof:analyze(total), ok = eprof:log("eprof_SUITE_logfile"), stopped = eprof:stop(), - ?t:timetrap_cancel(TTrap), ok = file:set_cwd(OldCurDir), ok. @@ -209,7 +191,7 @@ eed(Config) when is_list(Config) -> ensure_eprof_stopped(), Datadir = ?config(data_dir, Config), Privdir = ?config(priv_dir, Config), - TTrap=?t:timetrap(5*60*1000), + ct:timetrap({minutes, 5}), %% (Trace)Compile to priv_dir and make sure the correct version is loaded. code:purge(eed), @@ -236,7 +218,6 @@ eed(Config) when is_list(Config) -> ok = eprof:analyze(total), ok = eprof:log("eprof_SUITE_logfile"), stopped = eprof:stop(), - ?t:timetrap_cancel(TTrap), try S = lists:flatten(io_lib:format("~p times slower", [10*(T3-T2)/(T2-T1)])), diff --git a/lib/tools/test/fprof_SUITE.erl b/lib/tools/test/fprof_SUITE.erl index 0a2b85ff45..de946a609a 100644 --- a/lib/tools/test/fprof_SUITE.erl +++ b/lib/tools/test/fprof_SUITE.erl @@ -22,8 +22,7 @@ -include_lib("common_test/include/ct.hrl"). %% Test server framework exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2, not_run/1]). +-export([all/0, suite/0, not_run/1]). %% Test suites -export([stack_seq/1, tail_seq/1, create_file_slow/1, spawn_simple/1, @@ -33,14 +32,10 @@ %% Other exports -export([create_file_slow/2]). - %% Debug exports -export([parse/1, verify/2]). -export([spawn_simple_test/3]). - --define(line_trace,true). - %-define(debug,true). -ifdef(debug). -define(dbg(Str,Args), io:format(Str,Args)). @@ -49,14 +44,14 @@ -endif. - %%%--------------------------------------------------------------------- %%% Test suites %%%--------------------------------------------------------------------- - -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap,{seconds,60}}]. all() -> case test_server:is_native(fprof_SUITE) of @@ -67,21 +62,6 @@ all() -> cpu_create_file_slow] end. -groups() -> - []. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - not_run(Config) when is_list(Config) -> {skipped, "Native code"}. @@ -93,7 +73,6 @@ stack_seq(doc) -> stack_seq(suite) -> []; stack_seq(Config) when is_list(Config) -> - Timetrap = ?t:timetrap(?t:seconds(20)), PrivDir = ?config(priv_dir, Config), TraceFile = filename:join(PrivDir, ?MODULE_STRING"_stack_seq.trace"), @@ -131,7 +110,6 @@ stack_seq(Config) when is_list(Config) -> ets:delete(T), file:delete(TraceFile), file:delete(AnalysisFile), - ?t:timetrap_cancel(Timetrap), Acc1 = ts_sub(TS1, TS0), Acc2 = ts_sub(TS2, TS1), io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc1, Acc2]), @@ -144,7 +122,6 @@ tail_seq(doc) -> tail_seq(suite) -> []; tail_seq(Config) when is_list(Config) -> - Timetrap = ?t:timetrap(?t:seconds(10)), PrivDir = ?config(priv_dir, Config), TraceFile = filename:join(PrivDir, ?MODULE_STRING"_tail_seq.trace"), @@ -184,7 +161,6 @@ tail_seq(Config) when is_list(Config) -> ets:delete(T), file:delete(TraceFile), file:delete(AnalysisFile), - ?t:timetrap_cancel(Timetrap), Acc1 = ts_sub(TS1, TS0), Acc2 = ts_sub(TS2, TS1), io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc2, Acc1]), @@ -203,7 +179,6 @@ create_file_slow(Config) -> end. do_create_file_slow(Config) -> - Timetrap = ?t:timetrap(?t:seconds(40)), PrivDir = ?config(priv_dir, Config), TraceFile = filename:join(PrivDir, ?MODULE_STRING"_create_file_slow.trace"), @@ -244,7 +219,6 @@ do_create_file_slow(Config) -> file:delete(DataFile), file:delete(TraceFile), file:delete(AnalysisFile), - ?t:timetrap_cancel(Timetrap), Acc1 = ts_sub(TS1, TS0), Acc3 = ts_sub(TS3, TS2), io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc3, Acc1]), @@ -259,7 +233,6 @@ spawn_simple(doc) -> spawn_simple(suite) -> []; spawn_simple(Config) when is_list(Config) -> - Timetrap = ?t:timetrap(?t:seconds(30)), PrivDir = ?config(priv_dir, Config), TraceFile = filename:join(PrivDir, ?MODULE_STRING"_spawn_simple.trace"), @@ -321,7 +294,6 @@ spawn_simple(Config) when is_list(Config) -> ets:delete(T), file:delete(TraceFile), file:delete(AnalysisFile), - ?t:timetrap_cancel(Timetrap), Acc1 = ts_sub(TS1, TS0), Acc2 = ts_sub(TS2, TS1), io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc2, Acc1]), @@ -355,7 +327,6 @@ imm_tail_seq(doc) -> imm_tail_seq(suite) -> []; imm_tail_seq(Config) when is_list(Config) -> - Timetrap = ?t:timetrap(?t:seconds(10)), PrivDir = ?config(priv_dir, Config), AnalysisFile = filename:join(PrivDir, ?MODULE_STRING"_imm_tail_seq.analysis"), @@ -402,7 +373,6 @@ imm_tail_seq(Config) when is_list(Config) -> %% ets:delete(T), file:delete(AnalysisFile), - ?t:timetrap_cancel(Timetrap), Acc1 = ts_sub(TS1, TS0), Acc3 = ts_sub(TS3, TS2), Acc5 = ts_sub(TS5, TS4), @@ -419,7 +389,6 @@ imm_create_file_slow(doc) -> imm_create_file_slow(suite) -> []; imm_create_file_slow(Config) when is_list(Config) -> - Timetrap = ?t:timetrap(?t:seconds(60)), PrivDir = ?config(priv_dir, Config), DataFile = filename:join(PrivDir, ?MODULE_STRING"_imm_create_file_slow.data"), @@ -456,7 +425,6 @@ imm_create_file_slow(Config) when is_list(Config) -> ets:delete(T), file:delete(DataFile), file:delete(AnalysisFile), - ?t:timetrap_cancel(Timetrap), Acc1 = ts_sub(TS1, TS0), Acc3 = ts_sub(TS3, TS2), io:format("ts:~w, fprof:~w, bare:~w.~n", [Acc, Acc3, Acc1]), @@ -470,7 +438,7 @@ imm_compile(doc) -> imm_compile(suite) -> []; imm_compile(Config) when is_list(Config) -> - Timetrap = ?t:timetrap(?t:minutes(20)), + ct:timetrap({minutes, 20}), DataDir = ?config(data_dir, Config), SourceFile = filename:join(DataDir, "foo.erl"), PrivDir = ?config(priv_dir, Config), @@ -519,7 +487,6 @@ imm_compile(Config) when is_list(Config) -> %% ets:delete(T), file:delete(AnalysisFile), - ?t:timetrap_cancel(Timetrap), io:format("~p (plain), ~p (eprof), ~p (fprof), ~p(cpu)~n", [Acc1/1000, Acc3/1000, Acc5/1000, Acc/1000]), {comment, io_lib:format("~p/~p (fprof/eprof) times slower", @@ -532,7 +499,6 @@ cpu_create_file_slow(doc) -> cpu_create_file_slow(suite) -> []; cpu_create_file_slow(Config) when is_list(Config) -> - Timetrap = ?t:timetrap(?t:seconds(40)), PrivDir = ?config(priv_dir, Config), TraceFile = filename:join(PrivDir, ?MODULE_STRING"_cpu_create_file_slow.trace"), @@ -587,11 +553,9 @@ cpu_create_file_slow(Config) when is_list(Config) -> _ -> test_server:fail(Result) end, - ?t:timetrap_cancel(Timetrap), TestResult. - %%%--------------------------------------------------------------------- %%% Functions to test %%%--------------------------------------------------------------------- diff --git a/lib/tools/test/instrument_SUITE.erl b/lib/tools/test/instrument_SUITE.erl index bf541023ed..b4ace283d6 100644 --- a/lib/tools/test/instrument_SUITE.erl +++ b/lib/tools/test/instrument_SUITE.erl @@ -19,43 +19,18 @@ %% -module(instrument_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2, - init_per_testcase/2,end_per_testcase/2]). - +-export([all/0, suite/0]). -export(['+Mim true'/1, '+Mis true'/1]). -include_lib("common_test/include/ct.hrl"). -init_per_testcase(_Case, Config) -> - Dog=?t:timetrap(10000), - [{watchdog, Dog}|Config]. - -end_per_testcase(_Case, Config) -> - Dog=?config(watchdog, Config), - ?t:timetrap_cancel(Dog), - ok. - -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap,{seconds,10}}]. all() -> ['+Mim true', '+Mis true']. -groups() -> - []. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - '+Mim true'(doc) -> ["Check that memory data can be read and processed"]; '+Mim true'(suite) -> []; @@ -78,9 +53,7 @@ end_per_group(_GroupName, Config) -> N when is_integer(N) -> N = lists:foldl(fun ({_,_,Size,_}, Sum) -> Size+Sum - end, - 0, - AL), + end, 0, AL), N =< S3; Other -> ?t:fail(Other) @@ -115,8 +88,7 @@ end_per_group(_GroupName, Config) -> ASL = lists:map(fun ({_,A,S,_}) -> {A,S} end, AL), ASL = lists:map(fun ({_,A,S,_}) -> {A,S} end, DAL), instrument:holes(MDS), - {comment, - "total status - sum of blocks = " ++ integer_to_list(S1-SumBlocks)}. + {comment, "total status - sum of blocks = " ++ integer_to_list(S1-SumBlocks)}. '+Mis true'(doc) -> ["Check that memory data can be read and processed"]; '+Mis true'(suite) -> []; diff --git a/lib/tools/test/lcnt_SUITE.erl b/lib/tools/test/lcnt_SUITE.erl index 47b8031bee..7917dedb49 100644 --- a/lib/tools/test/lcnt_SUITE.erl +++ b/lib/tools/test/lcnt_SUITE.erl @@ -22,47 +22,28 @@ -include_lib("common_test/include/ct.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). --export([init_per_suite/1, end_per_suite/1]). +-export([all/0, suite/0]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases --export([ - t_load/1, - t_conflicts/1, - t_locations/1, - t_swap_keys/1 - ]). - -%% Default timetrap timeout (set in init_per_testcase) --define(default_timeout, ?t:minutes(4)). - -init_per_suite(Config) when is_list(Config) -> - Config. - -end_per_suite(Config) when is_list(Config) -> - Config. +-export([t_load/1, + t_conflicts/1, + t_locations/1, + t_swap_keys/1]). init_per_testcase(_Case, Config) -> - Dog = ?t:timetrap(?default_timeout), - [{watchdog,Dog} | Config]. + Config. -end_per_testcase(_Case, Config) -> - Dog = ?config(watchdog, Config), - ?t:timetrap_cancel(Dog), +end_per_testcase(_Case, _Config) -> catch lcnt:stop(), ok. -suite() -> [{ct_hooks,[ts_install_cth]}]. - -all() -> [t_load, t_conflicts, t_locations, t_swap_keys]. - -groups() -> []. - -init_per_group(_GroupName, Config) -> Config. - -end_per_group(_GroupName, Config) -> Config. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap,{minutes,4}}]. +all() -> + [t_load, t_conflicts, t_locations, t_swap_keys]. %%---------------------------------------------------------------------- %% Tests @@ -169,12 +150,3 @@ t_swap_keys_file([File|Files]) -> ok = lcnt:conflicts(), ok = lcnt:stop(), t_swap_keys_file(Files). - - -%%---------------------------------------------------------------------- -%% Auxiliary tests -%%---------------------------------------------------------------------- - -%%---------------------------------------------------------------------- -%% Auxiliary -%%---------------------------------------------------------------------- diff --git a/lib/tools/test/make_SUITE.erl b/lib/tools/test/make_SUITE.erl index 7580f77568..5e3b3772fc 100644 --- a/lib/tools/test/make_SUITE.erl +++ b/lib/tools/test/make_SUITE.erl @@ -195,7 +195,7 @@ otp_6057_a(Config) when is_list(Config) -> %% mtime will be the same). {ok, FileInfo1} = file:read_file_info(Test1++".beam"), Date1 = FileInfo1#file_info.mtime, - ?t:sleep(?t:seconds(2)), + timer:sleep(2000), up_to_date = make:all(), {ok, FileInfo2} = file:read_file_info(Test1++".beam"), case FileInfo2#file_info.mtime of diff --git a/lib/tools/test/tools_SUITE.erl b/lib/tools/test/tools_SUITE.erl index f79d41eb73..07baf79c1b 100644 --- a/lib/tools/test/tools_SUITE.erl +++ b/lib/tools/test/tools_SUITE.erl @@ -21,47 +21,21 @@ -include_lib("common_test/include/ct.hrl"). -%% Default timetrap timeout (set in init_per_testcase). --define(default_timeout, ?t:minutes(1)). -define(application, tools). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2]). --export([init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0]). %% Test cases must be exported. -export([app_test/1, appup_test/1]). -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap,{minutes,1}}]. all() -> [app_test, appup_test]. -groups() -> - []. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - - -init_per_testcase(_Case, Config) -> - Dog=test_server:timetrap(?default_timeout), - [{watchdog, Dog}|Config]. -end_per_testcase(_Case, Config) -> - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), - ok. - %%% %%% Test cases starts here. %%% diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl index 4f38bfc0a6..295910e1a3 100644 --- a/lib/tools/test/xref_SUITE.erl +++ b/lib/tools/test/xref_SUITE.erl @@ -37,24 +37,20 @@ -define(copydir, ?config(copy_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2, init/1, fini/1]). +-export([all/0, suite/0, groups/0, + init_per_suite/1, end_per_suite/1]). --export([ - addrem/1, convert/1, intergraph/1, lines/1, loops/1, +-export([addrem/1, convert/1, intergraph/1, lines/1, loops/1, no_data/1, modules/1]). --export([ - add/1, default/1, info/1, lib/1, read/1, read2/1, remove/1, +-export([add/1, default/1, info/1, lib/1, read/1, read2/1, remove/1, replace/1, update/1, deprecated/1, trycatch/1, fun_mfa/1, fun_mfa_r14/1, fun_mfa_vars/1, qlc/1]). --export([ - analyze/1, basic/1, md/1, q/1, variables/1, unused_locals/1]). +-export([analyze/1, basic/1, md/1, q/1, variables/1, unused_locals/1]). --export([ - format_error/1, otp_7423/1, otp_7831/1, otp_10192/1]). +-export([format_error/1, otp_7423/1, otp_7831/1, otp_10192/1]). -import(lists, [append/2, flatten/1, keysearch/3, member/2, sort/1, usort/1]). @@ -62,16 +58,15 @@ range/1, relation_to_family/1, set/1, to_external/1, union/2]). --export([init_per_testcase/2, end_per_testcase/2]). - %% Checks some info counters of a server and some relations that should hold. -export([check_count/1, check_state/1]). -include_lib("kernel/include/file.hrl"). - -include_lib("tools/src/xref.hrl"). -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap,{minutes,2}}]. all() -> [{group, xref}, {group, files}, {group, analyses}, @@ -89,20 +84,8 @@ groups() -> [analyze, basic, md, q, variables, unused_locals]}, {misc, [], [format_error, otp_7423, otp_7831, otp_10192]}]. -init_per_suite(Config) -> - init(Config). - -end_per_suite(_Config) -> - ok. - -init_per_group(_GroupName, Config) -> - Config. -end_per_group(_GroupName, Config) -> - Config. - - -init(Conf) when is_list(Conf) -> +init_per_suite(Conf) when is_list(Conf) -> DataDir = ?datadir, PrivDir = ?privdir, CopyDir = fname(PrivDir, "datacopy"), @@ -112,22 +95,11 @@ init(Conf) when is_list(Conf) -> ok = erl_tar:close(Tar), ok = erl_tar:extract(TarFile, [compressed]), ok = file:delete(TarFile), - [{copy_dir, CopyDir} | Conf]. - -fini(Conf) when is_list(Conf) -> - %% Nothing. - Conf. + [{copy_dir, CopyDir}|Conf]. -init_per_testcase(_Case, Config) -> - Dog=?t:timetrap(?t:minutes(2)), - [{watchdog, Dog}|Config]. - -end_per_testcase(_Case, _Config) -> - Dog=?config(watchdog, _Config), - test_server:timetrap_cancel(Dog), +end_per_suite(Conf) when is_list(Conf) -> ok. - %% Seems a bit short... addrem(suite) -> []; addrem(doc) -> ["Simple test of removing modules"]; |