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/tools/test/emem_SUITE.erl | |
parent | 146dfa9ddc3b31649ef581d65f3cb00ef95af10f (diff) | |
download | otp-8ccea1c2c756d8bc548ee6ba3e10f5a583aca7e7.tar.gz otp-8ccea1c2c756d8bc548ee6ba3e10f5a583aca7e7.tar.bz2 otp-8ccea1c2c756d8bc548ee6ba3e10f5a583aca7e7.zip |
Modernize use of timetraps
Diffstat (limited to 'lib/tools/test/emem_SUITE.erl')
-rw-r--r-- | lib/tools/test/emem_SUITE.erl | 43 |
1 files changed, 11 insertions, 32 deletions
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) -> |