From b8b3a8c7d7d01cc4126dc4961c4f5de6afc1b066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Sat, 23 Jan 2010 12:12:23 +0100 Subject: Test suites: fix creation of Emakefiles The Emakefiles in some test suite directories are only appended to, never created from scratch, which can cause problems especially when swithching branches in a git repository. --- lib/kernel/test/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/kernel') diff --git a/lib/kernel/test/Makefile b/lib/kernel/test/Makefile index ffad998d96..1e8cd55f11 100644 --- a/lib/kernel/test/Makefile +++ b/lib/kernel/test/Makefile @@ -116,7 +116,7 @@ EBIN = . make_emakefile: $(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) '*_SUITE_make' \ - >> $(EMAKEFILE) + > $(EMAKEFILE) $(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) $(MODULES) \ >> $(EMAKEFILE) -- cgit v1.2.3 From fc1ddbbc8c979bf0dc67ec9bfcb95ac0e18e6161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Sun, 24 Jan 2010 09:28:05 +0100 Subject: kernel tests: modernize guard tests --- lib/kernel/test/bif_SUITE.erl | 34 ++++++++++++++-------------- lib/kernel/test/cleanup.erl | 2 +- lib/kernel/test/erl_distribution_SUITE.erl | 36 +++++++++++++++--------------- lib/kernel/test/error_logger_SUITE.erl | 22 +++++++++--------- lib/kernel/test/global_group_SUITE.erl | 20 ++++++++--------- lib/kernel/test/heart_SUITE.erl | 6 ++--- lib/kernel/test/init_SUITE.erl | 4 ++-- lib/kernel/test/kernel_SUITE.erl | 2 +- lib/kernel/test/kernel_config_SUITE.erl | 2 +- lib/kernel/test/loose_node.erl | 17 +++++++------- lib/kernel/test/os_SUITE.erl | 14 ++++++------ lib/kernel/test/pdict_SUITE.erl | 4 ++-- lib/kernel/test/rpc_SUITE.erl | 4 ++-- lib/kernel/test/seq_trace_SUITE.erl | 6 ++--- lib/kernel/test/wrap_log_reader_SUITE.erl | 20 ++++++++--------- 15 files changed, 97 insertions(+), 96 deletions(-) (limited to 'lib/kernel') diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl index c78d82659f..57e6fd14e4 100644 --- a/lib/kernel/test/bif_SUITE.erl +++ b/lib/kernel/test/bif_SUITE.erl @@ -66,7 +66,7 @@ spawn_opt_tests(suite) -> spawn1(doc) -> ["Test spawn/1"]; spawn1(suite) -> []; -spawn1(Config) when list(Config) -> +spawn1(Config) when is_list(Config) -> ?line Node = node(), ?line Parent = self(), ?line {_, _, FA, _} = fetch_proc_vals(self()), @@ -83,7 +83,7 @@ spawn1(Config) when list(Config) -> spawn2(doc) -> ["Test spawn/2"]; spawn2(suite) -> []; -spawn2(Config) when list(Config) -> +spawn2(Config) when is_list(Config) -> ?line {ok, Node} = start_node(spawn2), ?line Parent = self(), @@ -105,7 +105,7 @@ spawn2(Config) when list(Config) -> spawn3(doc) -> ["Test spawn/3"]; spawn3(suite) -> []; -spawn3(Config) when list(Config) -> +spawn3(Config) when is_list(Config) -> ?line Node = node(), ?line Parent = self(), @@ -127,7 +127,7 @@ spawn3(Config) when list(Config) -> spawn4(doc) -> ["Test spawn/4"]; spawn4(suite) -> []; -spawn4(Config) when list(Config) -> +spawn4(Config) when is_list(Config) -> ?line {ok, Node} = start_node(spawn4), ?line Parent = self(), @@ -154,7 +154,7 @@ spawn4(Config) when list(Config) -> spawn_link1(doc) -> ["Test spawn_link/1"]; spawn_link1(suite) -> []; -spawn_link1(Config) when list(Config) -> +spawn_link1(Config) when is_list(Config) -> ?line Node = node(), ?line Parent = self(), ?line {_, _, FA, _} = fetch_proc_vals(self()), @@ -171,7 +171,7 @@ spawn_link1(Config) when list(Config) -> spawn_link2(doc) -> ["Test spawn_link/2"]; spawn_link2(suite) -> []; -spawn_link2(Config) when list(Config) -> +spawn_link2(Config) when is_list(Config) -> ?line {ok, Node} = start_node(spawn_link2), ?line Parent = self(), @@ -192,7 +192,7 @@ spawn_link2(Config) when list(Config) -> spawn_link3(doc) -> ["Test spawn_link/3"]; spawn_link3(suite) -> []; -spawn_link3(Config) when list(Config) -> +spawn_link3(Config) when is_list(Config) -> ?line Node = node(), ?line Parent = self(), @@ -214,7 +214,7 @@ spawn_link3(Config) when list(Config) -> spawn_link4(doc) -> ["Test spawn_link/4"]; spawn_link4(suite) -> []; -spawn_link4(Config) when list(Config) -> +spawn_link4(Config) when is_list(Config) -> ?line {ok, Node} = start_node(spawn_link4), ?line Parent = self(), @@ -240,7 +240,7 @@ spawn_link4(Config) when list(Config) -> spawn_opt2(doc) -> ["Test spawn_opt/2"]; spawn_opt2(suite) -> []; -spawn_opt2(Config) when list(Config) -> +spawn_opt2(Config) when is_list(Config) -> ?line Node = node(), ?line Parent = self(), ?line {_, _, FA, _} = fetch_proc_vals(self()), @@ -275,7 +275,7 @@ spawn_opt2(Config) when list(Config) -> spawn_opt3(doc) -> ["Test spawn_opt/3"]; spawn_opt3(suite) -> []; -spawn_opt3(Config) when list(Config) -> +spawn_opt3(Config) when is_list(Config) -> ?line {ok, Node} = start_node(spawn_opt3), ?line Parent = self(), ?line {_, _, FA, _} = fetch_proc_vals(self()), @@ -312,7 +312,7 @@ spawn_opt3(Config) when list(Config) -> spawn_opt4(doc) -> ["Test spawn_opt/4"]; spawn_opt4(suite) -> []; -spawn_opt4(Config) when list(Config) -> +spawn_opt4(Config) when is_list(Config) -> ?line Node = node(), ?line Parent = self(), ?line {_, _, FA, _} = fetch_proc_vals(self()), @@ -352,7 +352,7 @@ spawn_opt4(Config) when list(Config) -> spawn_opt5(doc) -> ["Test spawn_opt/5"]; spawn_opt5(suite) -> []; -spawn_opt5(Config) when list(Config) -> +spawn_opt5(Config) when is_list(Config) -> ?line {ok, Node} = start_node(spawn_opt5), ?line Parent = self(), ?line {_, _, FA, _} = fetch_proc_vals(self()), @@ -396,7 +396,7 @@ spawn_failures(doc) -> ["Test failure behavior of spawn bifs"]; spawn_failures(suite) -> []; -spawn_failures(Config) when list(Config) -> +spawn_failures(Config) when is_list(Config) -> ?line ThisNode = node(), ?line {ok, Node} = start_node(spawn_remote_failure), @@ -556,7 +556,7 @@ wilderness(doc) -> "wilderness of the heap are interpreted correct by the emulator "]; wilderness(suite) -> []; -wilderness(Config) when list(Config) -> +wilderness(Config) when is_list(Config) -> ?line Dog = ?t:timetrap(?default_timeout), ?line OKParams = {512, 8}, ?line Alloc = erlang:system_info(allocator), @@ -604,11 +604,11 @@ run_wilderness_test({Set_tt, Set_tp}, {Exp_tt, Exp_tp}) -> end, stop_node(Node). -to_string(X) when integer(X) -> +to_string(X) when is_integer(X) -> integer_to_list(X); -to_string(X) when atom(X) -> +to_string(X) when is_atom(X) -> atom_to_list(X); -to_string(X) when list(X) -> +to_string(X) when is_list(X) -> X. get_nodenames(N, T) -> diff --git a/lib/kernel/test/cleanup.erl b/lib/kernel/test/cleanup.erl index 6e1a1edeac..6df5c4aff4 100644 --- a/lib/kernel/test/cleanup.erl +++ b/lib/kernel/test/cleanup.erl @@ -31,7 +31,7 @@ cleanup(_) -> ?line case nodes() of [] -> ok; - Nodes when list(Nodes) -> + Nodes when is_list(Nodes) -> Kill = fun(Node) -> spawn(Node, erlang, halt, []) end, ?line lists:foreach(Kill, Nodes), ?line test_server:fail({nodes_left, Nodes}) diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl index 8f2e2512e0..539986b193 100644 --- a/lib/kernel/test/erl_distribution_SUITE.erl +++ b/lib/kernel/test/erl_distribution_SUITE.erl @@ -62,7 +62,7 @@ all(suite) -> table_waste, net_setuptime, monitor_nodes]. -init_per_testcase(Func, Config) when atom(Func), list(Config) -> +init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(4)), [{watchdog, Dog}|Config]. @@ -72,7 +72,7 @@ fin_per_testcase(_Func, Config) -> tick(suite) -> []; tick(doc) -> []; -tick(Config) when list(Config) -> +tick(Config) when is_list(Config) -> ?line Dog = test_server:timetrap(test_server:seconds(120)), PaDir = filename:dirname(code:which(erl_distribution_SUITE)), @@ -119,7 +119,7 @@ tick(Config) when list(Config) -> monitor_node(Node, true), receive - {tick_test, T} when integer(T) -> + {tick_test, T} when is_integer(T) -> stop_node(ServNode), stop_node(Node), T; @@ -141,7 +141,7 @@ table_waste(doc) -> ["Checks that pinging nonexistyent nodes does not waste space in distribution table"]; table_waste(suite) -> []; -table_waste(Config) when list(Config) -> +table_waste(Config) when is_list(Config) -> ?line {ok, HName} = inet:gethostname(), F = fun(0,_F) -> []; (N,F) -> @@ -161,7 +161,7 @@ illegal_nodenames(doc) -> ["Test that pinging an illegal nodename does not kill the node"]; illegal_nodenames(suite) -> []; -illegal_nodenames(Config) when list(Config) -> +illegal_nodenames(Config) when is_list(Config) -> ?line Dog=?t:timetrap(?t:minutes(2)), PaDir = filename:dirname(code:which(erl_distribution_SUITE)), ?line {ok, Node}=start_node(illegal_nodenames, "-pa " ++ PaDir), @@ -269,12 +269,12 @@ tick_cli_test1(Node) -> tick_change(doc) -> ["OTP-4255"]; tick_change(suite) -> []; -tick_change(Config) when list(Config) -> +tick_change(Config) when is_list(Config) -> ?line PaDir = filename:dirname(code:which(?MODULE)), ?line [BN, CN] = get_nodenames(2, tick_change), ?line DefaultTT = net_kernel:get_net_ticktime(), ?line case DefaultTT of - I when integer(I) -> ?line ok; + I when is_integer(I) -> ?line ok; _ -> ?line ?t:fail(DefaultTT) end, @@ -445,7 +445,7 @@ hidden_node(doc) -> ["Basic test of hidden node"]; hidden_node(suite) -> []; -hidden_node(Config) when list(Config) -> +hidden_node(Config) when is_list(Config) -> ?line Dog = ?t:timetrap(?t:seconds(40)), PaDir = filename:dirname(code:which(?MODULE)), VArgs = "-pa " ++ PaDir, @@ -548,7 +548,7 @@ monitor_nodes(suite) -> monitor_nodes_nodedown_reason(doc) -> []; monitor_nodes_nodedown_reason(suite) -> []; -monitor_nodes_nodedown_reason(Config) when list(Config) -> +monitor_nodes_nodedown_reason(Config) when is_list(Config) -> ?line MonNodeState = monitor_node_state(), ?line ok = net_kernel:monitor_nodes(true), ?line ok = net_kernel:monitor_nodes(true, [nodedown_reason]), @@ -603,7 +603,7 @@ monitor_nodes_nodedown_reason(Config) when list(Config) -> monitor_nodes_complex_nodedown_reason(doc) -> []; monitor_nodes_complex_nodedown_reason(suite) -> []; -monitor_nodes_complex_nodedown_reason(Config) when list(Config) -> +monitor_nodes_complex_nodedown_reason(Config) when is_list(Config) -> ?line MonNodeState = monitor_node_state(), ?line Me = self(), ?line ok = net_kernel:monitor_nodes(true, [nodedown_reason]), @@ -885,7 +885,7 @@ monitor_nodes_errors(doc) -> []; monitor_nodes_errors(suite) -> []; -monitor_nodes_errors(Config) when list(Config) -> +monitor_nodes_errors(Config) when is_list(Config) -> ?line MonNodeState = monitor_node_state(), ?line error = net_kernel:monitor_nodes(asdf), ?line {error, @@ -922,7 +922,7 @@ monitor_nodes_combinations(doc) -> []; monitor_nodes_combinations(suite) -> []; -monitor_nodes_combinations(Config) when list(Config) -> +monitor_nodes_combinations(Config) when is_list(Config) -> ?line MonNodeState = monitor_node_state(), ?line monitor_nodes_all_comb(true), ?line [VisibleName, HiddenName] = get_nodenames(2, @@ -1044,7 +1044,7 @@ monitor_nodes_cleanup(doc) -> []; monitor_nodes_cleanup(suite) -> []; -monitor_nodes_cleanup(Config) when list(Config) -> +monitor_nodes_cleanup(Config) when is_list(Config) -> ?line MonNodeState = monitor_node_state(), ?line Me = self(), ?line No = monitor_nodes_all_comb(true), @@ -1076,7 +1076,7 @@ monitor_nodes_many(doc) -> []; monitor_nodes_many(suite) -> []; -monitor_nodes_many(Config) when list(Config) -> +monitor_nodes_many(Config) when is_list(Config) -> ?line MonNodeState = monitor_node_state(), ?line [Name] = get_nodenames(1, monitor_nodes_many), %% We want to perform more than 2^16 net_kernel:monitor_nodes @@ -1139,10 +1139,10 @@ start_node(Name, Param, this) -> start_node(Name, Param, "this") -> NewParam = Param ++ " -pa " ++ filename:dirname(code:which(?MODULE)), ?t:start_node(Name, peer, [{args, NewParam}, {erl, [this]}]); -start_node(Name, Param, Rel) when atom(Rel) -> +start_node(Name, Param, Rel) when is_atom(Rel) -> NewParam = Param ++ " -pa " ++ filename:dirname(code:which(?MODULE)), ?t:start_node(Name, peer, [{args, NewParam}, {erl, [{release, atom_to_list(Rel)}]}]); -start_node(Name, Param, Rel) when list(Rel) -> +start_node(Name, Param, Rel) when is_list(Rel) -> NewParam = Param ++ " -pa " ++ filename:dirname(code:which(?MODULE)), ?t:start_node(Name, peer, [{args, NewParam}, {erl, [{release, Rel}]}]). @@ -1216,9 +1216,9 @@ wait_until(Fun) -> end end. -repeat(Fun, 0) when function(Fun) -> +repeat(Fun, 0) when is_function(Fun) -> ok; -repeat(Fun, N) when function(Fun), integer(N), N > 0 -> +repeat(Fun, N) when is_function(Fun), is_integer(N), N > 0 -> Fun(), repeat(Fun, N-1). diff --git a/lib/kernel/test/error_logger_SUITE.erl b/lib/kernel/test/error_logger_SUITE.erl index a737949bbb..38940bbe31 100644 --- a/lib/kernel/test/error_logger_SUITE.erl +++ b/lib/kernel/test/error_logger_SUITE.erl @@ -45,7 +45,7 @@ all(suite) -> error_report(suite) -> []; error_report(doc) -> []; -error_report(Config) when list(Config) -> +error_report(Config) when is_list(Config) -> ?line error_logger:add_report_handler(?MODULE, self()), Rep1 = [{tag1,"data1"},{tag2,data2},{tag3,3}], Rep2 = [testing,"testing",{tag1,"tag1"}], @@ -85,7 +85,7 @@ error_report(Config) when list(Config) -> info_report(suite) -> []; info_report(doc) -> []; -info_report(Config) when list(Config) -> +info_report(Config) when is_list(Config) -> ?line error_logger:add_report_handler(?MODULE, self()), Rep1 = [{tag1,"data1"},{tag2,data2},{tag3,3}], Rep2 = [testing,"testing",{tag1,"tag1"}], @@ -125,7 +125,7 @@ info_report(Config) when list(Config) -> error(suite) -> []; error(doc) -> []; -error(Config) when list(Config) -> +error(Config) when is_list(Config) -> ?line error_logger:add_report_handler(?MODULE, self()), Msg1 = "This is a plain text string~n", Msg2 = "This is a text with arguments ~p~n", @@ -160,7 +160,7 @@ error(Config) when list(Config) -> info(suite) -> []; info(doc) -> []; -info(Config) when list(Config) -> +info(Config) when is_list(Config) -> ?line error_logger:add_report_handler(?MODULE, self()), Msg1 = "This is a plain text string~n", Msg2 = "This is a text with arguments ~p~n", @@ -188,7 +188,7 @@ info(Config) when list(Config) -> emulator(suite) -> []; emulator(doc) -> []; -emulator(Config) when list(Config) -> +emulator(Config) when is_list(Config) -> ?line error_logger:add_report_handler(?MODULE, self()), spawn(?MODULE, generate_error, []), reported(emulator), @@ -215,7 +215,7 @@ tty(Config) when is_list(Config) -> logfile(suite) -> []; logfile(doc) -> []; -logfile(Config) when list(Config) -> +logfile(Config) when is_list(Config) -> ?line case error_logger:logfile(filename) of {error, no_log_file} -> % Ok, we continues. do_logfile(); @@ -236,7 +236,7 @@ do_logfile() -> add(suite) -> []; add(doc) -> []; -add(Config) when list(Config) -> +add(Config) when is_list(Config) -> ?line {'EXIT',_} = (catch error_logger:add_report_handler("dummy")), ?line {'EXIT',_} = error_logger:add_report_handler(non_existing), ?line my_error = error_logger:add_report_handler(?MODULE, [error]), @@ -246,7 +246,7 @@ add(Config) when list(Config) -> delete(suite) -> []; delete(doc) -> []; -delete(Config) when list(Config) -> +delete(Config) when is_list(Config) -> ?line {'EXIT',_} = (catch error_logger:delete_report_handler("dummy")), ?line {error,_} = error_logger:delete_report_handler(non_existing), ok. @@ -265,7 +265,7 @@ reported(Tag, Type, Report) -> reported(emulator) -> receive - {error, "~s~n", String} when list(String) -> + {error, "~s~n", String} when is_list(String) -> test_server:messages_get(), ok after 1000 -> @@ -277,9 +277,9 @@ reported(emulator) -> %% Sends a notification to the Tester process about the events %% generated by the Tester process. %%----------------------------------------------------------------- -init(Tester) when pid(Tester) -> +init(Tester) when is_pid(Tester) -> {ok, Tester}; -init(Config) when list(Config) -> +init(Config) when is_list(Config) -> my_error. handle_event({Tag, _GL, {_EPid, Type, Report}}, Tester) -> diff --git a/lib/kernel/test/global_group_SUITE.erl b/lib/kernel/test/global_group_SUITE.erl index a8b87390eb..188b944cf3 100644 --- a/lib/kernel/test/global_group_SUITE.erl +++ b/lib/kernel/test/global_group_SUITE.erl @@ -42,7 +42,7 @@ all(suite) -> -define(TESTCASE, testcase_name). -define(testcase, ?config(?TESTCASE, Config)). -init_per_testcase(Case, Config) when atom(Case), list(Config) -> +init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog=?t:timetrap(?t:minutes(5)), [{?TESTCASE, Case}, {watchdog, Dog}|Config]. @@ -59,7 +59,7 @@ fin_per_testcase(_Func, Config) -> start_gg_proc(suite) -> []; start_gg_proc(doc) -> ["Check that the global_group processes are started automatically. "]; -start_gg_proc(Config) when list(Config) -> +start_gg_proc(Config) when is_list(Config) -> ?line Dog = test_server:timetrap(test_server:seconds(120)), ?line Dir = ?config(priv_dir, Config), @@ -94,7 +94,7 @@ start_gg_proc(Config) when list(Config) -> no_gg_proc(suite) -> []; no_gg_proc(doc) -> ["Start a system without global groups. Nodes are not " "synced at start (sync_nodes_optional is not defined)"]; -no_gg_proc(Config) when list(Config) -> +no_gg_proc(Config) when is_list(Config) -> ?line Dog = test_server:timetrap(test_server:seconds(200)), ?line Dir = ?config(priv_dir, Config), @@ -267,7 +267,7 @@ no_gg_proc_sync(suite) -> []; no_gg_proc_sync(doc) -> ["Start a system without global groups, but syncing the nodes by using " "sync_nodes_optional."]; -no_gg_proc_sync(Config) when list(Config) -> +no_gg_proc_sync(Config) when is_list(Config) -> ?line Dog = test_server:timetrap(test_server:seconds(200)), ?line Dir = ?config(priv_dir, Config), @@ -441,7 +441,7 @@ no_gg_proc_sync(Config) when list(Config) -> compatible(suite) -> []; compatible(doc) -> ["Check that a system without global groups is compatible with the old R4 system."]; -compatible(Config) when list(Config) -> +compatible(Config) when is_list(Config) -> ?line Dog = test_server:timetrap(test_server:seconds(200)), ?line Dir = ?config(priv_dir, Config), @@ -614,7 +614,7 @@ compatible(Config) when list(Config) -> one_grp(suite) -> []; one_grp(doc) -> ["Test a system with only one global group. "]; -one_grp(Config) when list(Config) -> +one_grp(Config) when is_list(Config) -> ?line Dog = test_server:timetrap(test_server:seconds(120)), ?line Dir = ?config(priv_dir, Config), @@ -701,7 +701,7 @@ one_grp(Config) when list(Config) -> one_grp_x(suite) -> []; one_grp_x(doc) -> ["Check a system with only one global group. " "Start the nodes with different time intervals. "]; -one_grp_x(Config) when list(Config) -> +one_grp_x(Config) when is_list(Config) -> ?line Dog = test_server:timetrap(test_server:seconds(120)), ?line Dir = ?config(priv_dir, Config), @@ -763,7 +763,7 @@ one_grp_x(Config) when list(Config) -> two_grp(suite) -> []; two_grp(doc) -> ["Test a two global group system. "]; -two_grp(Config) when list(Config) -> +two_grp(Config) when is_list(Config) -> ?line Dog = test_server:timetrap(test_server:seconds(200)), ?line Dir = ?config(priv_dir, Config), @@ -1063,7 +1063,7 @@ two_grp(Config) when list(Config) -> hidden_groups(suite) -> []; hidden_groups(doc) -> ["Test hidden global groups."]; -hidden_groups(Config) when list(Config) -> +hidden_groups(Config) when is_list(Config) -> ?line Dog = test_server:timetrap(test_server:seconds(200)), ?line Dir = ?config(priv_dir, Config), @@ -1138,7 +1138,7 @@ hidden_groups(Config) when list(Config) -> test_exit(suite) -> []; test_exit(doc) -> ["Checks when the search process exits. "]; -test_exit(Config) when list(Config) -> +test_exit(Config) when is_list(Config) -> ?line Dog = test_server:timetrap(test_server:seconds(120)), ?line NN = node_name(atom_to_list(node())), diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl index b06244db3c..476d2ddc4f 100644 --- a/lib/kernel/test/heart_SUITE.erl +++ b/lib/kernel/test/heart_SUITE.erl @@ -80,7 +80,7 @@ start_check(Type, Name) -> end, erlang:monitor_node(Node, true), case rpc:call(Node, erlang, whereis, [heart]) of - Pid when pid(Pid) -> + Pid when is_pid(Pid) -> ok; _ -> test_server:fail(heart_not_started) @@ -355,7 +355,7 @@ erl() -> end. name(Node) when is_list(Node) -> name(Node,[]); -name(Node) when atom(Node) -> name(atom_to_list(Node),[]). +name(Node) when is_atom(Node) -> name(atom_to_list(Node),[]). name([$@|Node], Name) -> case lists:member($., Node) of @@ -368,7 +368,7 @@ name([H|T], Name) -> name(T, [H|Name]). -atom_conv(A) when atom(A) -> +atom_conv(A) when is_atom(A) -> atom_to_list(A); atom_conv(A) when is_list(A) -> A. diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl index 3d777f93a4..61629401fc 100644 --- a/lib/kernel/test/init_SUITE.erl +++ b/lib/kernel/test/init_SUITE.erl @@ -44,7 +44,7 @@ all(suite) -> restart, get_status, script_id, boot]. -init_per_testcase(Func, Config) when atom(Func), list(Config) -> +init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:seconds(?DEFAULT_TIMEOUT_SEC)), [{watchdog, Dog}|Config]. @@ -477,7 +477,7 @@ script_id(Config) when is_list(Config) -> ?line {Name, Vsn} = init:script_id(), ?line if - list(Name), list(Vsn) -> + is_list(Name), is_list(Vsn) -> ok; true -> ?t:fail(not_standard_script) diff --git a/lib/kernel/test/kernel_SUITE.erl b/lib/kernel/test/kernel_SUITE.erl index 225bc38b05..af77b8aaf8 100644 --- a/lib/kernel/test/kernel_SUITE.erl +++ b/lib/kernel/test/kernel_SUITE.erl @@ -56,6 +56,6 @@ app_test(doc) -> ["Tests the applications consistency."]; app_test(suite) -> []; -app_test(Config) when list(Config) -> +app_test(Config) when is_list(Config) -> ?line ok=?t:app_test(kernel), ok. diff --git a/lib/kernel/test/kernel_config_SUITE.erl b/lib/kernel/test/kernel_config_SUITE.erl index 6b7d788e60..aa0c25c7df 100644 --- a/lib/kernel/test/kernel_config_SUITE.erl +++ b/lib/kernel/test/kernel_config_SUITE.erl @@ -56,7 +56,7 @@ from(_, []) -> []. %%----------------------------------------------------------------- sync(doc) -> []; sync(suite) -> []; -sync(Conf) when list(Conf) -> +sync(Conf) when is_list(Conf) -> ?line Dog = ?t:timetrap(?t:seconds(120)), % Write a config file Dir = ?config(priv_dir,Conf), diff --git a/lib/kernel/test/loose_node.erl b/lib/kernel/test/loose_node.erl index ac1ddb8d9a..59c3ed1887 100644 --- a/lib/kernel/test/loose_node.erl +++ b/lib/kernel/test/loose_node.erl @@ -55,7 +55,7 @@ %% Exported functions. %% -stop(Node) when atom(Node) -> +stop(Node) when is_atom(Node) -> rpc:cast(Node, erlang, halt, []), io:format("Stopped loose node ~p~n", [Node]), ok. @@ -63,9 +63,10 @@ stop(Node) when atom(Node) -> start(Name, Args) -> start(Name, Args, -1). -start(Name, Args, TimeOut) when atom(Name) -> +start(Name, Args, TimeOut) when is_atom(Name) -> start(atom_to_list(Name), Args, TimeOut); -start(Name, Args, TimeOut) when list(Name), list(Args), integer(TimeOut) -> +start(Name, Args, TimeOut) + when is_list(Name), is_list(Args), is_integer(TimeOut) -> Parent = self(), Ref = make_ref(), Starter @@ -119,7 +120,7 @@ start(Name, Args, TimeOut) when list(Name), list(Args), integer(TimeOut) -> io:format("Trying to start loose node...~n" " --> ~p~n", [Cmd]), Res = case open_port({spawn, Cmd}, []) of - P when port(P) -> + P when is_port(P) -> receive {loose_node_started, Node, @@ -150,14 +151,14 @@ start(Name, Args, TimeOut) when list(Name), list(Args), integer(TimeOut) -> %% Exported functions for internal use. %% -loose_node_started([Name, Node, TimeOutSecs]) when list(Name), - list(Node), - list(TimeOutSecs) -> +loose_node_started([Name, Node, TimeOutSecs]) when is_list(Name), + is_list(Node), + is_list(TimeOutSecs) -> spawn_opt(fun () -> process_flag(trap_exit, true), Proc = {list_to_atom(Name), list_to_atom(Node)}, Timeout = case catch list_to_integer(TimeOutSecs) of - I when integer(I), I >= 0 -> I*1000; + I when is_integer(I), I >= 0 -> I*1000; _ -> infinity end, wait_until(fun () -> is_alive() end), diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl index 667f267079..1151ea1b02 100644 --- a/lib/kernel/test/os_SUITE.erl +++ b/lib/kernel/test/os_SUITE.erl @@ -32,7 +32,7 @@ space_in_cwd(doc) -> "Test that executing a command in a current working directory " "with space in its name works."; space_in_cwd(suite) -> []; -space_in_cwd(Config) when list(Config) -> +space_in_cwd(Config) when is_list(Config) -> ?line PrivDir = ?config(priv_dir, Config), ?line Dirname = filename:join(PrivDir, "cwd with space"), ?line ok = file:make_dir(Dirname), @@ -60,7 +60,7 @@ space_in_cwd(Config) when list(Config) -> quoting(doc) -> "Test that various ways of quoting arguments work."; quoting(suite) -> []; -quoting(Config) when list(Config) -> +quoting(Config) when is_list(Config) -> ?line DataDir = ?config(data_dir, Config), ?line Echo = filename:join(DataDir, "my_echo"), @@ -78,7 +78,7 @@ quoting(Config) when list(Config) -> space_in_name(doc) -> "Test that program with a space in its name can be executed."; space_in_name(suite) -> []; -space_in_name(Config) when list(Config) -> +space_in_name(Config) when is_list(Config) -> ?line PrivDir = ?config(priv_dir, Config), ?line DataDir = ?config(data_dir, Config), ?line Spacedir = filename:join(PrivDir, "program files"), @@ -108,7 +108,7 @@ space_in_name(Config) when list(Config) -> bad_command(doc) -> "Check that a bad command doesn't crasch the server or the emulator (it used to)."; bad_command(suite) -> []; -bad_command(Config) when list(Config) -> +bad_command(Config) when is_list(Config) -> ?line catch os:cmd([a|b]), ?line catch os:cmd({bad, thing}), @@ -120,7 +120,7 @@ bad_command(Config) when list(Config) -> find_executable(suite) -> []; find_executable(doc) -> []; -find_executable(Config) when list(Config) -> +find_executable(Config) when is_list(Config) -> case os:type() of {win32, _} -> ?line DataDir = filename:join(?config(data_dir, Config), "win32"), @@ -159,7 +159,7 @@ find_exe(Where, Name, Ext, Path) -> case os:find_executable(Name, Path) of Expected -> ok; - Name when list(Name) -> + Name when is_list(Name) -> case filename:absname(Name) of Expected -> ok; @@ -176,7 +176,7 @@ find_exe(Where, Name, Ext, Path) -> unix_comment_in_command(doc) -> "OTP-1805: Test that os:cmd(\"ls #\") works correctly (used to hang)."; unix_comment_in_command(suite) -> []; -unix_comment_in_command(Config) when list(Config) -> +unix_comment_in_command(Config) when is_list(Config) -> ?line Dog = test_server:timetrap(test_server:seconds(20)), ?line Priv = ?config(priv_dir, Config), ?line ok = file:set_cwd(Priv), diff --git a/lib/kernel/test/pdict_SUITE.erl b/lib/kernel/test/pdict_SUITE.erl index 6aa434b614..ed08dbabf5 100644 --- a/lib/kernel/test/pdict_SUITE.erl +++ b/lib/kernel/test/pdict_SUITE.erl @@ -49,7 +49,7 @@ simple(doc) -> ["Tests simple functionality in process dictionary."]; simple(suite) -> []; -simple(Config) when list(Config) -> +simple(Config) when is_list(Config) -> XX = get(), erase(), L = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p, @@ -146,7 +146,7 @@ info(doc) -> ["Tests process_info(Pid, dictionary)"]; info(suite) -> []; -info(Config) when list(Config) -> +info(Config) when is_list(Config) -> L = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p, q,r,s,t,u,v,x,y,z,'A','B','C','D'], process_flag(trap_exit,true), diff --git a/lib/kernel/test/rpc_SUITE.erl b/lib/kernel/test/rpc_SUITE.erl index 2b39e31a80..f6225b5971 100644 --- a/lib/kernel/test/rpc_SUITE.erl +++ b/lib/kernel/test/rpc_SUITE.erl @@ -333,7 +333,7 @@ suicide(exit, Reason) -> suicide(erlang, exit, [Name, Reason]) when is_atom(Name) -> case whereis(Name) of - Pid when pid(Pid) -> suicide(erlang, exit, [Pid, Reason]) + Pid when is_pid(Pid) -> suicide(erlang, exit, [Pid, Reason]) end; suicide(Mod, Func, Args) -> spawn_link( @@ -448,7 +448,7 @@ call_benchmark(Config) when is_list(Config) -> ?t:timetrap_cancel(Timetrap), ok. -do_call_benchmark(Node, M) when integer(M), M > 0 -> +do_call_benchmark(Node, M) when is_integer(M), M > 0 -> do_call_benchmark(Node, erlang:now(), 0, M). do_call_benchmark(Node, {A,B,C}, M, M) -> diff --git a/lib/kernel/test/seq_trace_SUITE.erl b/lib/kernel/test/seq_trace_SUITE.erl index f582b94c97..41c7c3b25b 100644 --- a/lib/kernel/test/seq_trace_SUITE.erl +++ b/lib/kernel/test/seq_trace_SUITE.erl @@ -381,7 +381,7 @@ port(Config) when is_list(Config) -> get_port_message(Port) -> receive - {Port,{data,Bin}} when binary(Bin) -> + {Port,{data,Bin}} when is_binary(Bin) -> binary_to_term(Bin); Other -> ?t:fail({unexpected,Other}) @@ -678,7 +678,7 @@ transparent_tracer() -> receive {started, Ref} -> ok end, fun(pid) -> Pid; - ({stop, N}) when integer(N), N >= 0 -> + ({stop, N}) when is_integer(N), N >= 0 -> Mref = erlang:monitor(process, Pid), receive {'DOWN', Mref, _, _, _} -> @@ -717,7 +717,7 @@ simple_tracer(Data, DN) -> From ! {tracerlog,lists:reverse(Data)} end. -stop_tracer(N) when integer(N) -> +stop_tracer(N) when is_integer(N) -> case catch (seq_trace_SUITE_tracer ! {stop,N,self()}) of {'EXIT', _} -> {error, not_started}; diff --git a/lib/kernel/test/wrap_log_reader_SUITE.erl b/lib/kernel/test/wrap_log_reader_SUITE.erl index 1d1570fbd9..a7d4e578d5 100644 --- a/lib/kernel/test/wrap_log_reader_SUITE.erl +++ b/lib/kernel/test/wrap_log_reader_SUITE.erl @@ -48,7 +48,7 @@ all(suite) -> [no_file, one, two, four, wrap, wrapping, external, error]. -init_per_testcase(Func, Config) when atom(Func), list(Config) -> +init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:seconds(60)), [{watchdog, Dog} | Config]. @@ -58,7 +58,7 @@ fin_per_testcase(_Func, _Config) -> no_file(suite) -> []; no_file(doc) -> ["No log file exists"]; -no_file(Conf) when list(Conf) -> +no_file(Conf) when is_list(Conf) -> ?line code:add_path(?config(data_dir,Conf)), Dir = ?privdir(Conf), File = join(Dir, "sune.LOG"), @@ -81,7 +81,7 @@ one(doc) -> ["One index file"]. one_empty(suite) -> []; one_empty(doc) -> ["One empty index file"]; -one_empty(Conf) when list(Conf) -> +one_empty(Conf) when is_list(Conf) -> Dir = ?privdir(Conf), File = join(Dir, "sune.LOG"), delete_files(File), @@ -107,7 +107,7 @@ one_empty(Conf) when list(Conf) -> one_filled(suite) -> []; one_filled(doc) -> ["One filled index file"]; -one_filled(Conf) when list(Conf) -> +one_filled(Conf) when is_list(Conf) -> Dir = ?privdir(Conf), File = join(Dir, "sune.LOG"), delete_files(File), @@ -144,7 +144,7 @@ two(doc) -> ["Two index files"]. two_filled(suite) -> []; two_filled(doc) -> ["Two filled index files"]; -two_filled(Conf) when list(Conf) -> +two_filled(Conf) when is_list(Conf) -> Dir = ?privdir(Conf), File = list_to_atom(join(Dir, "sune.LOG")), delete_files(File), @@ -186,7 +186,7 @@ four(doc) -> ["Four index files"]. four_filled(suite) -> []; four_filled(doc) -> ["Four filled index files"]; -four_filled(Conf) when list(Conf) -> +four_filled(Conf) when is_list(Conf) -> Dir = ?privdir(Conf), File = join(Dir, "sune.LOG"), delete_files(File), @@ -231,7 +231,7 @@ wrap(doc) -> ["Wrap index file, first wrapping"]. wrap_filled(suite) -> []; wrap_filled(doc) -> ["First wrap, open, filled index file"]; -wrap_filled(Conf) when list(Conf) -> +wrap_filled(Conf) when is_list(Conf) -> Dir = ?privdir(Conf), File = join(Dir, "sune.LOG"), delete_files(File), @@ -274,7 +274,7 @@ test_wrap(File) -> wrapping(suite) -> []; wrapping(doc) -> ["Wrapping at the same time as reading"]; -wrapping(Conf) when list(Conf) -> +wrapping(Conf) when is_list(Conf) -> Dir = ?privdir(Conf), File = join(Dir, "sune.LOG"), delete_files(File), @@ -329,7 +329,7 @@ wrapping(Conf) when list(Conf) -> external(suite) -> []; external(doc) -> ["External format"]; -external(Conf) when list(Conf) -> +external(Conf) when is_list(Conf) -> Dir = ?privdir(Conf), File = join(Dir, "sune.LOG"), delete_files(File), @@ -349,7 +349,7 @@ external(Conf) when list(Conf) -> error(suite) -> []; error(doc) -> ["Error situations"]; -error(Conf) when list(Conf) -> +error(Conf) when is_list(Conf) -> Dir = ?privdir(Conf), File = join(Dir, "sune.LOG"), delete_files(File), -- cgit v1.2.3 From a656a27d520cec163aa99fbec583ba7a30a4f72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Sun, 24 Jan 2010 09:30:02 +0100 Subject: file_SUITE: eliminate a warning for an unused variable --- lib/kernel/test/file_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/kernel') diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index c645d0f842..9ad13eba4f 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -3371,7 +3371,7 @@ read_line_create_files(TestData) -> [ Function(File) || {Function,File,_,_} <- TestData ]. read_line_remove_files(TestData) -> - [ file:delete(File) || {Function,File,_,_} <- TestData ]. + [ file:delete(File) || {_Function,File,_,_} <- TestData ]. read_line_1(suite) -> []; -- cgit v1.2.3