aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reltool/test
diff options
context:
space:
mode:
Diffstat (limited to 'lib/reltool/test')
-rw-r--r--lib/reltool/test/reltool_app_SUITE.erl9
-rw-r--r--lib/reltool/test/reltool_server_SUITE.erl23
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/unicode/ua-1.0/ebin/ua.app1
-rw-r--r--lib/reltool/test/reltool_test_lib.erl60
4 files changed, 71 insertions, 22 deletions
diff --git a/lib/reltool/test/reltool_app_SUITE.erl b/lib/reltool/test/reltool_app_SUITE.erl
index a6e00cde08..9abc7fea41 100644
--- a/lib/reltool/test/reltool_app_SUITE.erl
+++ b/lib/reltool/test/reltool_app_SUITE.erl
@@ -26,6 +26,7 @@
-compile(export_all).
-include("reltool_test_lib.hrl").
+-include_lib("common_test/include/ct.hrl").
t() -> reltool_test_lib:t(?MODULE).
@@ -64,7 +65,7 @@ end_per_testcase(Func,Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [fields, modules, export_all, app_depend, undef_funcs].
+ [fields, modules, export_all, app_depend, undef_funcs, appup].
groups() ->
[].
@@ -290,3 +291,9 @@ key1search(Key, L) ->
{value, {Key, Value}} ->
Value
end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Test that the reltool appup file is ok
+appup(Config) when is_list(Config) ->
+ ok = ?t:appup_test(reltool).
diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl
index 752037042d..347e80ed7c 100644
--- a/lib/reltool/test/reltool_server_SUITE.erl
+++ b/lib/reltool/test/reltool_server_SUITE.erl
@@ -1,8 +1,7 @@
-%% -*- coding: utf-8 -*-
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2014. 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
@@ -144,7 +143,8 @@ all() ->
mod_incl_cond_derived,
use_selected_vsn,
use_selected_vsn_relative_path,
- non_standard_vsn_id].
+ non_standard_vsn_id,
+ undefined_regexp].
groups() ->
[].
@@ -808,13 +808,14 @@ create_target_unicode(Config) ->
%% If file name translation mode is unicode, then use unicode
%% characters release name (which will be used as file name for
- %% .rel, .script and .boot)
- RelNamePrefix =
+ %% .rel, .script and .boot), and install the release under a path
+ %% which icludes unicode characters.
+ {RelNamePrefix,TargetDirName} =
case file:native_name_encoding() of
utf8 ->
- "Unicode test αβ";
+ {"Unicode test αβ","target_unicode_αβ"} ;
latin1 ->
- "Unicode test"
+ {"Unicode test","target_unicode"}
end,
%% Configure the server
@@ -838,7 +839,7 @@ create_target_unicode(Config) ->
]},
%% Generate target file
- TargetDir = filename:join([?WORK_DIR, "target_unicode"]),
+ TargetDir = filename:join([?WORK_DIR, TargetDirName]),
?m(ok, reltool_utils:recursive_delete(TargetDir)),
?m(ok, file:make_dir(TargetDir)),
?log("SPEC: ~p\n", [reltool:get_target_spec([{config, Sys}])]),
@@ -2506,6 +2507,12 @@ non_standard_vsn_id(Config) ->
reltool_server:get_app(Pid2,b)),
ok.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+undefined_regexp(_Config) ->
+ ?msym({ok,_},
+ reltool:get_config([{sys,[{app,asn1,[{excl_app_filters,
+ {add, ["^priv"]}}]}]}])),
+ ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Library functions
diff --git a/lib/reltool/test/reltool_server_SUITE_data/unicode/ua-1.0/ebin/ua.app b/lib/reltool/test/reltool_server_SUITE_data/unicode/ua-1.0/ebin/ua.app
index 6f571b7179..dbce20232c 100644
--- a/lib/reltool/test/reltool_server_SUITE_data/unicode/ua-1.0/ebin/ua.app
+++ b/lib/reltool/test/reltool_server_SUITE_data/unicode/ua-1.0/ebin/ua.app
@@ -1,4 +1,3 @@
-% -*- coding: utf-8 -*-
{application, ua,
[{description, "Application for testing unicode in reltool - αβ"},
{vsn, "1.0"},
diff --git a/lib/reltool/test/reltool_test_lib.erl b/lib/reltool/test/reltool_test_lib.erl
index 3485365ed9..fa12f19aa7 100644
--- a/lib/reltool/test/reltool_test_lib.erl
+++ b/lib/reltool/test/reltool_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2014. 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,12 +20,13 @@
-compile(export_all).
-include("reltool_test_lib.hrl").
+-define(timeout, 20). % minutes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
init_per_suite(Config) when is_list(Config)->
global:register_name(reltool_global_logger, group_leader()),
- incr_timetrap(Config, 10).
+ incr_timetrap(Config, ?timeout).
end_per_suite(Config) when is_list(Config)->
global:unregister_name(reltool_global_logger),
@@ -51,7 +52,7 @@ set_kill_timer(Config) ->
Time =
case lookup_config(tc_timeout, Config) of
[] ->
- timer:minutes(10);
+ timer:minutes(?timeout);
ConfigTime when is_integer(ConfigTime) ->
ConfigTime
end,
@@ -258,8 +259,8 @@ run_test([{Module, TC} | Rest], Config) ->
true ->
[do_run_test(Module, TC, NewConfig)]
end,
- Module:end_per_suite(NewConfig),
- Res ++ run_test(Rest, NewConfig);
+ CommonTestRes = worst_res(Res),
+ Res ++ run_test(Rest, [{tc_status,CommonTestRes}|NewConfig]);
Error ->
?error("Test suite skipped: ~w~n", [Error]),
[{skipped, Error}]
@@ -267,6 +268,36 @@ run_test([{Module, TC} | Rest], Config) ->
run_test([], _Config) ->
[].
+worst_res(Res) ->
+ NewRes = [{dummy, {ok,dummy, dummy}} | Res],
+ [{_,WorstRes}|_] = lists:sort(fun compare_res/2, NewRes),
+ common_test_res(WorstRes).
+
+common_test_res(ok) ->
+ ok;
+common_test_res({Res,_,Reason}) ->
+ common_test_res({Res,Reason});
+common_test_res({Res,Reason}) ->
+ case Res of
+ ok -> ok;
+ skip -> {skipped, Reason};
+ skipped -> {skipped, Reason};
+ failed -> {failed, Reason};
+ crash -> {failed, Reason}
+ end.
+
+% crash < failed < skip < ok
+compare_res({_,{ResA,_,_}},{_,{ResB,_,_}}) ->
+ res_to_int(ResA) < res_to_int(ResB).
+
+res_to_int(Res) ->
+ case Res of
+ ok -> 4;
+ skip -> 3;
+ failed -> 2;
+ crash -> 1
+ end.
+
do_run_test(Module, all, Config) ->
All = [{Module, Test} || Test <- Module:all()],
run_test(All, Config);
@@ -290,9 +321,10 @@ eval_test_case(Mod, Fun, Config) ->
test_case_evaluator(Mod, Fun, [Config]) ->
NewConfig = Mod:init_per_testcase(Fun, Config),
- R = apply(Mod, Fun, [NewConfig]),
- Mod:end_per_testcase(Fun, NewConfig),
- exit({test_case_ok, R}).
+ Res = apply(Mod, Fun, [NewConfig]),
+ CommonTestRes = common_test_res(Res),
+ Mod:end_per_testcase(Fun, [{tc_status,CommonTestRes}|NewConfig]),
+ exit({test_case_ok, Res}).
wait_for_evaluator(Pid, Mod, Fun, Config) ->
receive
@@ -307,13 +339,17 @@ wait_for_evaluator(Pid, Mod, Fun, Config) ->
{'EXIT', Pid, {skipped, Reason}} ->
log("<WARNING> Test case ~w skipped, because ~p~n",
[{Mod, Fun}, Reason]),
- Mod:end_per_testcase(Fun, Config),
- {skip, {Mod, Fun}, Reason};
+ Res = {skipped, {Mod, Fun}, Reason},
+ CommonTestRes = common_test_res(Res),
+ Mod:end_per_testcase(Fun, [{tc_status,CommonTestRes}|Config]),
+ Res;
{'EXIT', Pid, Reason} ->
log("<ERROR> Eval process ~w exited, because\n\t~p~n",
[{Mod, Fun}, Reason]),
- Mod:end_per_testcase(Fun, Config),
- {crash, {Mod, Fun}, Reason}
+ Res = {crash, {Mod, Fun}, Reason},
+ CommonTestRes = common_test_res(Res),
+ Mod:end_per_testcase(Fun, [{tc_status,CommonTestRes}|Config]),
+ Res
end.
flush() ->