From 5fe95cec32ddc92f6a483c24f6f591586ba065f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 25 Feb 2016 07:38:39 +0100 Subject: Modernize use of timetraps Either rely on the default 30 minutes timetrap, or set the timeout using the supported methods in common_test. --- lib/compiler/test/regressions_SUITE.erl | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'lib/compiler/test/regressions_SUITE.erl') diff --git a/lib/compiler/test/regressions_SUITE.erl b/lib/compiler/test/regressions_SUITE.erl index a8caa34c60..0131a2bdbd 100644 --- a/lib/compiler/test/regressions_SUITE.erl +++ b/lib/compiler/test/regressions_SUITE.erl @@ -21,26 +21,23 @@ -module(regressions_SUITE). -include_lib("common_test/include/ct.hrl"). --export([all/0, groups/0, init_per_testcase/2,end_per_testcase/2]). - +-export([all/0,groups/0,init_per_testcase/2,end_per_testcase/2,suite/0]). -export([maps/1]). groups() -> [{p,test_lib:parallel(), [maps]}]. -% Default timetrap timeout (set in init_per_testcase). --define(default_timeout, ?t:minutes(2)). - init_per_testcase(_Case, Config) -> - ?line Dog = ?t:timetrap(?default_timeout), - [{watchdog, Dog} | Config]. + Config. -end_per_testcase(_Case, Config) -> - Dog = ?config(watchdog, Config), - test_server:timetrap_cancel(Dog), +end_per_testcase(_Case, _Config) -> ok. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap,{minutes,2}}]. + all() -> test_lib:recompile(?MODULE), [{group,p}]. -- cgit v1.2.3 From ca93ccf62e91c55345eb1e67e6ea107ba72e5a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 25 Feb 2016 15:01:29 +0100 Subject: Eliminate use of ?config() macro ?config is ugly and not recommended. Use proplists:get_value/2 instead. --- lib/compiler/test/regressions_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/compiler/test/regressions_SUITE.erl') diff --git a/lib/compiler/test/regressions_SUITE.erl b/lib/compiler/test/regressions_SUITE.erl index 0131a2bdbd..0e641fcd71 100644 --- a/lib/compiler/test/regressions_SUITE.erl +++ b/lib/compiler/test/regressions_SUITE.erl @@ -70,7 +70,7 @@ run(Config, Tests) -> run_test(Conf, Test0) -> Module = "regressions_"++test_lib:uniq(), Filename = Module ++ ".erl", - DataDir = ?config(priv_dir, Conf), + DataDir = proplists:get_value(priv_dir, Conf), Test = ["-module(", Module, "). ", Test0], File = filename:join(DataDir, Filename), Def = [binary,export_all,return], -- cgit v1.2.3 From 117daae14c7779a35659589a842af331fe773d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 25 Feb 2016 15:28:25 +0100 Subject: Eliminate use of test_server:fail/0,1 --- lib/compiler/test/regressions_SUITE.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/compiler/test/regressions_SUITE.erl') diff --git a/lib/compiler/test/regressions_SUITE.erl b/lib/compiler/test/regressions_SUITE.erl index 0e641fcd71..65fd213649 100644 --- a/lib/compiler/test/regressions_SUITE.erl +++ b/lib/compiler/test/regressions_SUITE.erl @@ -91,5 +91,4 @@ run_test(Conf, Test0) -> ok. fail() -> - io:format("failed~n"), - ?t:fail(). + ct:fail(failed). -- cgit v1.2.3 From 3d03356f718f64ca0e33b715f306219db86a4b0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 25 Feb 2016 15:40:16 +0100 Subject: Replace use of test_server:format/2 with io:format/2 There is no practial difference. --- lib/compiler/test/regressions_SUITE.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/compiler/test/regressions_SUITE.erl') diff --git a/lib/compiler/test/regressions_SUITE.erl b/lib/compiler/test/regressions_SUITE.erl index 65fd213649..3fd4645529 100644 --- a/lib/compiler/test/regressions_SUITE.erl +++ b/lib/compiler/test/regressions_SUITE.erl @@ -59,7 +59,8 @@ run(Config, Tests) -> io:format("Compiling test for: ~w~n", [N]), case catch run_test(Config, P) of {'EXIT', Reason} -> - ?t:format("~nTest ~p failed.~nReason: ~p~n", [N, Reason]), + io:format("~nTest ~p failed.~nReason: ~p~n", + [N, Reason]), fail(); _ -> ok end -- cgit v1.2.3