diff options
author | Lukas Larsson <[email protected]> | 2011-01-11 14:03:49 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-01-24 10:45:15 +0100 |
commit | 64b1a505c46cb51c7ba3f0588a89fb7bc712aa9a (patch) | |
tree | ac0fe5bacf41ba2298b0d3b955477065796801bf | |
parent | eb5eb98cfba9854870b061abf50027a025e6dc5d (diff) | |
download | otp-64b1a505c46cb51c7ba3f0588a89fb7bc712aa9a.tar.gz otp-64b1a505c46cb51c7ba3f0588a89fb7bc712aa9a.tar.bz2 otp-64b1a505c46cb51c7ba3f0588a89fb7bc712aa9a.zip |
Update ts scb to add nodenames in all pre_init clauses
-rw-r--r-- | lib/test_server/src/ts_install_scb.erl | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/test_server/src/ts_install_scb.erl b/lib/test_server/src/ts_install_scb.erl index 33710c7bfd..3ba8795764 100644 --- a/lib/test_server/src/ts_install_scb.erl +++ b/lib/test_server/src/ts_install_scb.erl @@ -19,8 +19,9 @@ %%% @doc TS Installed SCB %%% -%%% This module does what the ts:install/0 command combined with the make -%%% parts of the ts:run/x command did. +%%% This module does what the make parts of the ts:run/x command did, +%%% but not the Makefile.first parts! So they have to be done by ts or +%%% manually!! -module(ts_install_scb). @@ -106,9 +107,7 @@ pre_init_per_suite(_Suite,Config,State) -> make_non_erlang(DataDir, Variables), - {lists:keystore(nodenames, 1, Config, - {nodenames,generate_nodenames(State#state.nodenames)}), - State} + {add_node_name(Config, State), State} catch Error:Reason -> Stack = erlang:get_stacktrace(), ct:pal("~p failed! ~p:{~p,~p}",[?MODULE,Error,Reason,Stack]), @@ -148,7 +147,7 @@ post_end_per_suite(_Suite,_Config,Return,State) -> State :: #state{}) -> {config() | skip_or_fail(), NewState :: #state{}}. pre_init_per_group(_Group,Config,State) -> - {Config, State}. + {add_node_name(Config, State), State}. %% @doc Called after each init_per_group. -spec post_init_per_group(Group :: atom(), @@ -182,7 +181,7 @@ post_end_per_group(_Group,_Config,Return,State) -> State :: #state{}) -> {config() | skip_or_fail(), NewState :: #state{}}. pre_init_per_testcase(_TC,Config,State) -> - {Config, State}. + {add_node_name(Config, State), State}. %% @doc Called after each test case. -spec post_end_per_testcase(TC :: atom(), @@ -285,6 +284,17 @@ get_mtime(File) -> {{0,0,0},{0,0,0}} end. +%% Add a nodename to config if it does not exist +add_node_name(Config, State) -> + case proplists:get_value(nodenames, Config) of + undefined -> + lists:keystore( + nodenames, 1, Config, + {nodenames,generate_nodenames(State#state.nodenames)}); + _Else -> + Config + end. + %% Copied from test_server_ctrl.erl generate_nodenames(Num) -> |