From 8ccea1c2c756d8bc548ee6ba3e10f5a583aca7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 6 Apr 2016 19:46:34 +0200 Subject: Modernize use of timetraps --- lib/tools/test/instrument_SUITE.erl | 40 ++++++------------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) (limited to 'lib/tools/test/instrument_SUITE.erl') 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) -> []; -- cgit v1.2.3