diff options
author | Björn Gustavsson <[email protected]> | 2016-02-26 13:10:05 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-02-26 13:10:05 +0100 |
commit | 63fb22fbca8fc9b3ab118b2dc2d8d2514d926903 (patch) | |
tree | d29a0e0fe4d750f19c48a19568d3f99252ffe09e /lib/compiler/test/receive_SUITE.erl | |
parent | ad847aa2f332230ea33d6a65953c9be1f22af551 (diff) | |
parent | fc3c64711400be9eae653350213630cb8cb257f9 (diff) | |
download | otp-63fb22fbca8fc9b3ab118b2dc2d8d2514d926903.tar.gz otp-63fb22fbca8fc9b3ab118b2dc2d8d2514d926903.tar.bz2 otp-63fb22fbca8fc9b3ab118b2dc2d8d2514d926903.zip |
Merge branch 'bjorn/compiler/modernize-tests'
* bjorn/compiler/modernize-tests:
Remove ?line macros
Replace use of lists:keysearch/3 with lists:keyfind/3
Eliminate use of doc and suite clauses
Replace ?t with test_server
Replace use of test_server:format/2 with io:format/2
Eliminate use of test_server:fail/0,1
Eliminate use of ?config() macro
Modernize use of timetraps
Eliminate useless helper functions
Diffstat (limited to 'lib/compiler/test/receive_SUITE.erl')
-rw-r--r-- | lib/compiler/test/receive_SUITE.erl | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl index fef29ab06d..8d2c78aae2 100644 --- a/lib/compiler/test/receive_SUITE.erl +++ b/lib/compiler/test/receive_SUITE.erl @@ -30,15 +30,14 @@ -include_lib("common_test/include/ct.hrl"). init_per_testcase(_Case, Config) -> - ?line Dog = test_server:timetrap(test_server:minutes(2)), - [{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]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap,{minutes,2}}]. all() -> test_lib:recompile(?MODULE), @@ -64,21 +63,21 @@ end_per_group(_GroupName, Config) -> -record(state, {ena = true}). recv(Config) when is_list(Config) -> - ?line Pid = spawn_link(fun() -> loop(#state{}) end), + Pid = spawn_link(fun() -> loop(#state{}) end), Self = self(), - ?line Pid ! {Self,test}, + Pid ! {Self,test}, receive {ok,test} -> ok; {error,Other} -> io:format("Got unpexected ~p", [Other]), - ?line ?t:fail() + ct:fail(unexpected) after 10000 -> - ?line ?t:fail(no_answer) + ct:fail(no_answer) end, receive X -> io:format("Unexpected extra message: ~p", [X]), - ?line ?t:fail() + ct:fail(unexpected) after 10 -> ok end, @@ -116,9 +115,9 @@ coverage(Config) when is_list(Config) -> self() ! 17, self() ! 19, - ?line 59 = tuple_to_values(infinity, x), - ?line 61 = tuple_to_values(999999, x), - ?line 0 = tuple_to_values(1, x), + 59 = tuple_to_values(infinity, x), + 61 = tuple_to_values(999999, x), + 0 = tuple_to_values(1, x), ok. receive_all() -> @@ -188,8 +187,8 @@ ref_opt(Config) when is_list(Config) -> end. ref_opt_1(Config) -> - DataDir = ?config(data_dir, Config), - PrivDir = ?config(priv_dir, Config), + DataDir = proplists:get_value(data_dir, Config), + PrivDir = proplists:get_value(priv_dir, Config), Sources = filelib:wildcard(filename:join([DataDir,"ref_opt","*.{erl,S}"])), test_lib:p_run(fun(Src) -> do_ref_opt(Src, PrivDir) @@ -257,9 +256,9 @@ cover_recv_instructions() -> export(Config) when is_list(Config) -> Ref = make_ref(), - ?line self() ! {result,Ref,42}, - ?line 42 = export_1(Ref), - ?line {error,timeout} = export_1(Ref), + self() ! {result,Ref,42}, + 42 = export_1(Ref), + {error,timeout} = export_1(Ref), ok. export_1(Reference) -> |