aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/test/test_server_test_lib.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2013-01-17 18:55:21 +0100
committerSiri Hansen <[email protected]>2013-01-25 15:56:00 +0100
commitc463aaf0355d3a958df2335d13dc88aafb667f40 (patch)
tree4468d65e9f8b96a4754d68f07ae421cc7fce3442 /lib/test_server/test/test_server_test_lib.erl
parenta26159db792be4fb0266f8eeba3f22f530034eb0 (diff)
downloadotp-c463aaf0355d3a958df2335d13dc88aafb667f40.tar.gz
otp-c463aaf0355d3a958df2335d13dc88aafb667f40.tar.bz2
otp-c463aaf0355d3a958df2335d13dc88aafb667f40.zip
[test_server] Add tests for unicode support
Diffstat (limited to 'lib/test_server/test/test_server_test_lib.erl')
-rw-r--r--lib/test_server/test/test_server_test_lib.erl66
1 files changed, 36 insertions, 30 deletions
diff --git a/lib/test_server/test/test_server_test_lib.erl b/lib/test_server/test/test_server_test_lib.erl
index d466aa0110..cd6804f7ad 100644
--- a/lib/test_server/test/test_server_test_lib.erl
+++ b/lib/test_server/test/test_server_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -20,6 +20,9 @@
-export([parse_suite/1]).
-export([init/2, pre_init_per_testcase/3, post_end_per_testcase/4]).
+%% for test_server_SUITE when node can not be started as slave
+-export([prepare_tester_node/2]).
+
-include("test_server_test_lib.hrl").
%% The CTH hooks all tests
@@ -49,38 +52,41 @@ start_slave(Config,_Level) ->
ct:log("Node ~p started~n", [Node]),
IsCover = test_server:is_cover(),
if IsCover ->
- cover:start(Node);
- true->
- ok
+ cover:start(Node);
+ true->
+ ok
end,
- DataDir = proplists:get_value(data_dir, Config),
- %% We would normally use priv_dir for temporary data,
- %% but the pathnames gets too long on Windows.
- %% Until the run-time system can support long pathnames,
- %% use the data dir.
- WorkDir = DataDir,
-
- %% WorkDir as well as directory of Test Server suites
- %% have to be in code path on Test Server node.
- [_ | Parts] = lists:reverse(filename:split(DataDir)),
- TSDir = filename:join(lists:reverse(Parts)),
- AddPathDirs = case proplists:get_value(path_dirs, Config) of
- undefined -> [];
- Ds -> Ds
- end,
- PathDirs = [WorkDir,TSDir | AddPathDirs],
- [true = rpc:call(Node, code, add_patha, [D]) || D <- PathDirs],
- io:format("Dirs added to code path (on ~w):~n",
- [Node]),
- [io:format("~s~n", [D]) || D <- PathDirs],
-
- true = rpc:call(Node, os, putenv,
- ["TEST_SERVER_FRAMEWORK", "undefined"]),
-
- ok = rpc:call(Node, file, set_cwd, [WorkDir]),
- [{node,Node}, {work_dir,WorkDir} | Config]
+ prepare_tester_node(Node,Config)
end.
+prepare_tester_node(Node,Config) ->
+ DataDir = proplists:get_value(data_dir, Config),
+ %% We would normally use priv_dir for temporary data,
+ %% but the pathnames gets too long on Windows.
+ %% Until the run-time system can support long pathnames,
+ %% use the data dir.
+ WorkDir = DataDir,
+
+ %% WorkDir as well as directory of Test Server suites
+ %% have to be in code path on Test Server node.
+ [_ | Parts] = lists:reverse(filename:split(DataDir)),
+ TSDir = filename:join(lists:reverse(Parts)),
+ AddPathDirs = case proplists:get_value(path_dirs, Config) of
+ undefined -> [];
+ Ds -> Ds
+ end,
+ PathDirs = [WorkDir,TSDir | AddPathDirs],
+ [true = rpc:call(Node, code, add_patha, [D]) || D <- PathDirs],
+ io:format("Dirs added to code path (on ~w):~n",
+ [Node]),
+ [io:format("~s~n", [D]) || D <- PathDirs],
+
+ true = rpc:call(Node, os, putenv,
+ ["TEST_SERVER_FRAMEWORK", "undefined"]),
+
+ ok = rpc:call(Node, file, set_cwd, [WorkDir]),
+ [{node,Node}, {work_dir,WorkDir} | Config].
+
post_end_per_testcase(_TC, Config, Return, State) ->
Node = proplists:get_value(node, Config),
Cover = test_server:is_cover(),