aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2011-07-13 18:17:36 +0200
committerPeter Andersson <[email protected]>2011-09-23 12:24:54 +0200
commitf703d6512219431fa7fe61e5ddd1a9ed32506daa (patch)
tree6df2157019b840d8a1e2c0b1ef7ddb20b2a6daea /lib/common_test
parentd3b636f97ce36e106ac53beb4cba0db13cd5656f (diff)
downloadotp-f703d6512219431fa7fe61e5ddd1a9ed32506daa.tar.gz
otp-f703d6512219431fa7fe61e5ddd1a9ed32506daa.tar.bz2
otp-f703d6512219431fa7fe61e5ddd1a9ed32506daa.zip
Fix problem with logdir string and some other minor bugs
OTP-9370: Fix problem with crash if logdir contains multiple dirs OTP-9155: Fix some minor remaining bugs
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/src/ct_logs.erl40
-rw-r--r--lib/common_test/src/ct_run.erl13
2 files changed, 33 insertions, 20 deletions
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl
index 5c4eb88c1f..761b906392 100644
--- a/lib/common_test/src/ct_logs.erl
+++ b/lib/common_test/src/ct_logs.erl
@@ -124,27 +124,27 @@ close(Info, StartDir) ->
ok;
Error ->
io:format("Warning! Cleanup failed: ~p~n", [Error])
- end;
+ end,
+ make_all_suites_index(stop),
+ make_all_runs_index(stop);
true ->
- file:set_cwd("..")
- end,
-
- make_all_suites_index(stop),
- make_all_runs_index(stop),
-
- case ct_util:get_profile_data(browser, StartDir) of
- undefined ->
- ok;
- BrowserData ->
- case {proplists:get_value(prog, BrowserData),
- proplists:get_value(args, BrowserData),
- proplists:get_value(page, BrowserData)} of
- {Prog,Args,Page} when is_list(Args),
- is_list(Page) ->
- URL = "file://" ++ ?abs(Page),
- ct_util:open_url(Prog, Args, URL);
- _ ->
- ok
+ file:set_cwd(".."),
+ make_all_suites_index(stop),
+ make_all_runs_index(stop),
+ case ct_util:get_profile_data(browser, StartDir) of
+ undefined ->
+ ok;
+ BrowserData ->
+ case {proplists:get_value(prog, BrowserData),
+ proplists:get_value(args, BrowserData),
+ proplists:get_value(page, BrowserData)} of
+ {Prog,Args,Page} when is_list(Args),
+ is_list(Page) ->
+ URL = "\"file://" ++ ?abs(Page) ++ "\"",
+ ct_util:open_url(Prog, Args, URL);
+ _ ->
+ ok
+ end
end
end,
ok.
diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl
index 00b5a53cf4..418e212fd1 100644
--- a/lib/common_test/src/ct_run.erl
+++ b/lib/common_test/src/ct_run.erl
@@ -157,6 +157,7 @@ script_start(Args) ->
end,
stop_trace(Tracing),
timer:sleep(1000),
+ io:nl(),
Res.
script_start1(Parent, Args) ->
@@ -2155,6 +2156,18 @@ get_start_opt(Key, IfExists, Args) ->
get_start_opt(Key, IfExists, undefined, Args).
get_start_opt(Key, IfExists, IfNotExists, Args) ->
+ try try_get_start_opt(Key, IfExists, IfNotExists, Args) of
+ Result ->
+ Result
+ catch
+ error:_ ->
+ exit({user_error,{bad_argument,Key}})
+ end.
+
+try_get_start_opt(Key, IfExists, Args) ->
+ try_get_start_opt(Key, IfExists, undefined, Args).
+
+try_get_start_opt(Key, IfExists, IfNotExists, Args) ->
case lists:keysearch(Key, 1, Args) of
{value,{Key,Val}} when is_function(IfExists) ->
IfExists(Val);