aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-10-24 16:59:23 +0200
committerBjörn Gustavsson <[email protected]>2012-10-25 11:10:34 +0200
commitd0e2f7202ed7d69121185ce58f480174aa4aff9f (patch)
treed86ac6929ce2e83d1fd68017895b662265cdd32d /lib/test_server/test
parent5f3a7727464522da88d07a3012aa87b8703e3f3a (diff)
downloadotp-d0e2f7202ed7d69121185ce58f480174aa4aff9f.tar.gz
otp-d0e2f7202ed7d69121185ce58f480174aa4aff9f.tar.bz2
otp-d0e2f7202ed7d69121185ce58f480174aa4aff9f.zip
test_server tests: Be kind to Windows by using shorter pathnames
The pathnames gets too long for Windows if we use priv_dir as working directory for the test_server tests in the slave node. Use data_dir instead. Revert this commit when the run-time system can handle long pathnames on Windows.
Diffstat (limited to 'lib/test_server/test')
-rw-r--r--lib/test_server/test/test_server_SUITE.erl8
-rw-r--r--lib/test_server/test/test_server_test_lib.erl14
2 files changed, 13 insertions, 9 deletions
diff --git a/lib/test_server/test/test_server_SUITE.erl b/lib/test_server/test/test_server_SUITE.erl
index cb8cb9da31..d20528d43b 100644
--- a/lib/test_server/test/test_server_SUITE.erl
+++ b/lib/test_server/test/test_server_SUITE.erl
@@ -120,9 +120,9 @@ run_test_server_tests(SuiteName, NCases, NFail, NExpected, NSucc,
NUsrSkip, NAutoSkip,
NActualSkip, NActualFail, NActualSucc, Config) ->
+ WorkDir = proplists:get_value(work_dir, Config),
ct:log("<a href=\"file://~s\">Test case log files</a>\n",
- [filename:join([proplists:get_value(priv_dir, Config),
- SuiteName++".logs"])]),
+ [filename:join(WorkDir, SuiteName++".logs")]),
Node = proplists:get_value(node, Config),
{ok,_Pid} = rpc:call(Node,test_server_ctrl, start, []),
@@ -140,8 +140,8 @@ run_test_server_tests(SuiteName, NCases, NFail, NExpected, NSucc,
{ok,Data} = test_server_test_lib:parse_suite(
hd(filelib:wildcard(
- filename:join([proplists:get_value(priv_dir, Config),
- SuiteName++".logs","run*","suite.log"])))),
+ filename:join([WorkDir,SuiteName++".logs",
+ "run*","suite.log"])))),
check([{"Number of cases",NCases,Data#suite.n_cases},
{"Number failed",NFail,Data#suite.n_cases_failed},
{"Number expected",NExpected,Data#suite.n_cases_expected},
diff --git a/lib/test_server/test/test_server_test_lib.erl b/lib/test_server/test/test_server_test_lib.erl
index 5ca24f3df7..8a808c5360 100644
--- a/lib/test_server/test/test_server_test_lib.erl
+++ b/lib/test_server/test/test_server_test_lib.erl
@@ -54,9 +54,13 @@ start_slave(Config,_Level) ->
ok
end,
DataDir = proplists:get_value(data_dir, Config),
- PrivDir = proplists:get_value(priv_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,
- %% PrivDir as well as directory of Test Server suites
+ %% 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)),
@@ -64,7 +68,7 @@ start_slave(Config,_Level) ->
undefined -> [];
Ds -> Ds
end,
- PathDirs = [PrivDir,TSDir | AddPathDirs],
+ 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]),
@@ -73,8 +77,8 @@ start_slave(Config,_Level) ->
true = rpc:call(Node, os, putenv,
["TEST_SERVER_FRAMEWORK", "undefined"]),
- ok = rpc:call(Node, file, set_cwd, [PrivDir]),
- [{node,Node} | Config]
+ ok = rpc:call(Node, file, set_cwd, [WorkDir]),
+ [{node,Node}, {work_dir,WorkDir} | Config]
end.
post_end_per_testcase(_TC, Config, Return, State) ->