aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/test_lib.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-02-26 13:10:05 +0100
committerBjörn Gustavsson <[email protected]>2016-02-26 13:10:05 +0100
commit63fb22fbca8fc9b3ab118b2dc2d8d2514d926903 (patch)
treed29a0e0fe4d750f19c48a19568d3f99252ffe09e /lib/compiler/test/test_lib.erl
parentad847aa2f332230ea33d6a65953c9be1f22af551 (diff)
parentfc3c64711400be9eae653350213630cb8cb257f9 (diff)
downloadotp-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/test_lib.erl')
-rw-r--r--lib/compiler/test/test_lib.erl11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/compiler/test/test_lib.erl b/lib/compiler/test/test_lib.erl
index e4b6a2fa9c..3ca93fb021 100644
--- a/lib/compiler/test/test_lib.erl
+++ b/lib/compiler/test/test_lib.erl
@@ -52,7 +52,7 @@ smoke_disasm(File) when is_list(File) ->
%% be slower than running them sequentially.
parallel() ->
- case ?t:is_cover() orelse erlang:system_info(schedulers) =:= 1 of
+ case test_server:is_cover() orelse erlang:system_info(schedulers) =:= 1 of
true -> [];
false -> [parallel]
end.
@@ -66,7 +66,7 @@ uniq() ->
opt_opts(Mod) ->
Comp = Mod:module_info(compile),
- {value,{options,Opts}} = lists:keysearch(options, 1, Comp),
+ {options,Opts} = lists:keyfind(options, 1, Comp),
lists:filter(fun(no_copt) -> true;
(no_postopt) -> true;
(no_float_opt) -> true;
@@ -85,7 +85,7 @@ opt_opts(Mod) ->
%% This function retrieves the path to the original data directory.
get_data_dir(Config) ->
- Data0 = ?config(data_dir, Config),
+ Data0 = proplists:get_value(data_dir, Config),
Opts = [{return,list}],
Data1 = re:replace(Data0, "_no_opt_SUITE", "_SUITE", Opts),
Data = re:replace(Data1, "_post_opt_SUITE", "_SUITE", Opts),
@@ -96,7 +96,7 @@ get_data_dir(Config) ->
p_run(Test, List) ->
S = erlang:system_info(schedulers),
- N = case ?t:is_cover() of
+ N = case test_server:is_cover() of
false ->
S + 1;
true ->
@@ -118,7 +118,8 @@ p_run_loop(_, [], _, [], Errors, Ws) ->
1 -> {comment,"1 warning"};
N -> {comment,integer_to_list(N)++" warnings"}
end;
- N -> ?t:fail({N,errors})
+ N ->
+ ct:fail({N,errors})
end;
p_run_loop(Test, [H|T], N, Refs, Errors, Ws) when length(Refs) < N ->
{_,Ref} = erlang:spawn_monitor(fun() -> exit(Test(H)) end),