aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/src/test_server_ctrl.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2011-02-17 17:12:58 +0100
committerLukas Larsson <[email protected]>2011-02-17 17:12:58 +0100
commit62e3328272e3bac139e765e6a5147daca02ec833 (patch)
tree6598446fa99d235a3a726a6c08c62d19942b41cd /lib/test_server/src/test_server_ctrl.erl
parent53974a3517268389ae18fabee509ebf4bbfce747 (diff)
parent00db7dddae0c6f1acddf52d97c9e6c65393d2459 (diff)
downloadotp-62e3328272e3bac139e765e6a5147daca02ec833.tar.gz
otp-62e3328272e3bac139e765e6a5147daca02ec833.tar.bz2
otp-62e3328272e3bac139e765e6a5147daca02ec833.zip
Merge branch 'lukas/common_test/updates_needed_before_migration/OTP-8768' into dev
* lukas/common_test/updates_needed_before_migration/OTP-8768: Update ts to take the config path as an invironmental and as a variables passed with all_tests and also with the normal run Update TEST_SERVER_FRAMEWORK os variable to be regarded as undet if set to undefined Fix bug with subgroups after introduction of remote groups Rename Suite Callback to Common Test Hook Update so that cover is skipper for applications without a .cover file Update minimal build target to include runtime_tools and common_test Update ts to start common test with both ts.config and ts.PLATFORM.config Update ts scb to add nodenames in all pre_init clauses Add release/tests/test_server to path Add ts_install_scb which is a common_test SCB that handles making of test modules. Update ts to work with common test instead of test_server Add kill_slavenodes/0 as an exported function Change format of remote groups to {group, Module, GroupName}, note that this is an unsupported feature Add possibility to get all testdata Fix bug when groups refer to groups in the groups/0 function Add support for external groups. Refactor code to make it easier to debug Update so that when asking for os and we are in the test_server_ctrl process, just use os:type(). Fix so that groups can return external test cases, i.e.
Diffstat (limited to 'lib/test_server/src/test_server_ctrl.erl')
-rw-r--r--lib/test_server/src/test_server_ctrl.erl14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl
index 977a2b1785..7cd58642d0 100644
--- a/lib/test_server/src/test_server_ctrl.erl
+++ b/lib/test_server/src/test_server_ctrl.erl
@@ -168,6 +168,7 @@
cross_cover_analyse/1, cross_cover_analyse/2, trc/1, stop_trace/0]).
-export([testcase_callback/1]).
-export([set_random_seed/1]).
+-export([kill_slavenodes/0]).
%%% TEST_SERVER INTERFACE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-export([output/2, print/2, print/3, print_timestamp/2]).
@@ -525,6 +526,9 @@ testcase_callback(ModFunc) ->
set_random_seed(Seed) ->
controller_call({set_random_seed,Seed}).
+kill_slavenodes() ->
+ controller_call(kill_slavenodes).
+
get_hosts() ->
get(test_server_hosts).
@@ -533,6 +537,8 @@ get_target_os_type() ->
undefined ->
%% This is probably called on the target node
os:type();
+ Pid when Pid =:= self() ->
+ os:type();
_pid ->
%% This is called on the controller, e.g. from a
%% specification clause of a test case
@@ -637,7 +643,7 @@ contact_main_target(local) ->
%% When used by a general framework, global registration of
%% test_server should not be required.
case os:getenv("TEST_SERVER_FRAMEWORK") of
- false ->
+ FW when FW =:= false; FW =:= "undefined" ->
%% Local target! The global test_server process implemented by
%% test_server.erl will not be started, so we simulate it by
%% globally registering this process instead.
@@ -1704,7 +1710,7 @@ do_test_cases(TopCases, SkipCases,
[erlang:system_info(version), code:root_dir()]),
case os:getenv("TEST_SERVER_FRAMEWORK") of
- false ->
+ FW when FW =:= false; FW =:= "undefined" ->
print(html, "<p>Target:<br>\n"),
print_who(TI#target_info.host, TI#target_info.username),
print(html, "<br>Used Erlang ~s in <tt>~s</tt>.\n",
@@ -4057,7 +4063,7 @@ get_font_style1(default) ->
format_exception(Reason={_Error,Stack}) when is_list(Stack) ->
case os:getenv("TEST_SERVER_FRAMEWORK") of
- false ->
+ FW when FW =:= false; FW =:= "undefined" ->
case application:get_env(test_server, format_exception) of
{ok,false} ->
{"~p",Reason};
@@ -4630,7 +4636,7 @@ collect_case([Case | Cases], St, Acc) ->
collect_case_invoke(Mod, Case, MFA, St) ->
case os:getenv("TEST_SERVER_FRAMEWORK") of
- false ->
+ FW when FW =:= false; FW =:= "undefined" ->
case catch apply(Mod, Case, [suite]) of
{'EXIT',_} ->
{ok,[MFA],St};