aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/src
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2011-12-02 11:18:49 +0100
committerPeter Andersson <[email protected]>2011-12-07 15:30:22 +0100
commite0138e0284ccba8d633aa31c4cfa8ff3073d985f (patch)
tree326a0488b457d28fe997f17e4283575724c4c7b5 /lib/test_server/src
parent139524f226e9fde387dea203396d5fccf2bdca41 (diff)
downloadotp-e0138e0284ccba8d633aa31c4cfa8ff3073d985f.tar.gz
otp-e0138e0284ccba8d633aa31c4cfa8ff3073d985f.tar.bz2
otp-e0138e0284ccba8d633aa31c4cfa8ff3073d985f.zip
Add tests for group specification and info function
Diffstat (limited to 'lib/test_server/src')
-rw-r--r--lib/test_server/src/test_server_ctrl.erl58
1 files changed, 35 insertions, 23 deletions
diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl
index 3c4b2ead8a..12fa725f66 100644
--- a/lib/test_server/src/test_server_ctrl.erl
+++ b/lib/test_server/src/test_server_ctrl.erl
@@ -1826,18 +1826,27 @@ start_log_file() ->
exit({cant_create_log_dir,{MkDirError,Dir}})
end,
TestDir = timestamp_filename_get(filename:join(Dir, "run.")),
- case file:make_dir(TestDir) of
- ok ->
- ok;
- MkDirError2 ->
- exit({cant_create_log_dir,{MkDirError2,TestDir}})
- end,
-
- ok = file:write_file(filename:join(Dir, ?last_file), TestDir ++ "\n"),
- ok = file:write_file(?last_file, TestDir ++ "\n"),
-
- put(test_server_log_dir_base,TestDir),
- MajorName = filename:join(TestDir, ?suitelog_name),
+ TestDir1 =
+ case file:make_dir(TestDir) of
+ ok ->
+ TestDir;
+ {error,eexist} ->
+ timer:sleep(1000),
+ %% we need min 1 second between timestamps unfortunately
+ TestDirX = timestamp_filename_get(filename:join(Dir, "run.")),
+ case file:make_dir(TestDirX) of
+ ok ->
+ TestDirX;
+ MkDirError2 ->
+ exit({cant_create_log_dir,{MkDirError2,TestDirX}})
+ end;
+ MkDirError2 ->
+ exit({cant_create_log_dir,{MkDirError2,TestDir}})
+ end,
+ ok = file:write_file(filename:join(Dir, ?last_file), TestDir1 ++ "\n"),
+ ok = file:write_file(?last_file, TestDir1 ++ "\n"),
+ put(test_server_log_dir_base,TestDir1),
+ MajorName = filename:join(TestDir1, ?suitelog_name),
HtmlName = MajorName ++ ?html_ext,
{ok,Major} = file:open(MajorName, [write]),
{ok,Html} = file:open(HtmlName, [write]),
@@ -1850,14 +1859,14 @@ start_log_file() ->
make_html_link(LinkName ++ ?html_ext, HtmlName,
filename:basename(Dir)),
- PrivDir = filename:join(TestDir, ?priv_dir),
+ PrivDir = filename:join(TestDir1, ?priv_dir),
ok = file:make_dir(PrivDir),
put(test_server_priv_dir,PrivDir++"/"),
print_timestamp(13,"Suite started at "),
- LogInfo = [{topdir,Dir},{rundir,lists:flatten(TestDir)}],
+ LogInfo = [{topdir,Dir},{rundir,lists:flatten(TestDir1)}],
test_server_sup:framework_call(report, [loginfo,LogInfo]),
- {ok,TestDir}.
+ {ok,TestDir1}.
make_html_link(LinkName, Target, Explanation) ->
%% if possible use a relative reference to Target.
@@ -2739,15 +2748,18 @@ run_test_cases_loop([{conf,Ref,Props,{Mod,Func}}|_Cases]=Cs0,
{skipped,TcSkip},
{failed,TcFail}]}]
end,
- GroupPath = lists:flatmap(fun({_Ref,[],_T}) -> [];
- ({_Ref,GrProps,_T}) -> [GrProps] end, Mode0),
- ActualCfg =
- update_config(hd(Config),
- [{priv_dir,get(test_server_priv_dir)},
- {data_dir,get_data_dir(Mod)},
- {tc_group_path,GroupPath} | CfgProps]),
+ TSDirs = [{priv_dir,get(test_server_priv_dir)},{data_dir,get_data_dir(Mod)}],
+ ActualCfg =
+ if not StartConf ->
+ update_config(hd(Config), TSDirs ++ CfgProps);
+ true ->
+ GroupPath = lists:flatmap(fun({_Ref,[],_T}) -> [];
+ ({_Ref,GrProps,_T}) -> [GrProps]
+ end, Mode0),
+ update_config(hd(Config),
+ TSDirs ++ [{tc_group_path,GroupPath} | CfgProps])
+ end,
CurrMode = curr_mode(Ref, Mode0, Mode),
-
ConfCaseResult = run_test_case(Ref, 0, Mod, Func, [ActualCfg], skip_init, target,
TimetrapData, CurrMode),