Skip to content

Commit

Permalink
Merge branch 'lukas/rcs-ppc-cross-tests/OTP-10265' into maint
Browse files Browse the repository at this point in the history
* lukas/rcs-ppc-cross-tests/OTP-10265:
  Skip ct_netconf tests if there is no crypto
  Migrate timers from test_server to ct interface
  Update tests to run with an oldshell emulator
  Move crypto check so that tc is skipped and not failed
  Update for new version of ppc compilation chain
  Verify that ebin folder of applications exists
  • Loading branch information
garazdawi committed Nov 2, 2012
2 parents d5733bc + 5851407 commit 045319d
Show file tree
Hide file tree
Showing 10 changed files with 351 additions and 242 deletions.
25 changes: 19 additions & 6 deletions erts/test/otp_SUITE.erl
Expand Up @@ -150,8 +150,8 @@ is_hipe_module(Mod) ->
end.

ssl_crypto_filter(Undef) ->
case {code:lib_dir(crypto),code:lib_dir(ssl)} of
{{error,bad_name},{error,bad_name}} ->
case {app_exists(crypto),app_exists(ssl)} of
{false,false} ->
filter(fun({_,{ssl,_,_}}) -> false;
({_,{crypto,_,_}}) -> false;
({_,{ssh,_,_}}) -> false;
Expand All @@ -175,8 +175,8 @@ eunit_filter(Undef) ->
end, Undef).

dialyzer_filter(Undef) ->
case code:lib_dir(dialyzer) of
{error,bad_name} ->
case app_exists(dialyzer) of
false ->
filter(fun({_,{dialyzer_callgraph,_,_}}) -> false;
({_,{dialyzer_codeserver,_,_}}) -> false;
({_,{dialyzer_contracts,_,_}}) -> false;
Expand All @@ -191,8 +191,8 @@ dialyzer_filter(Undef) ->
end.

wx_filter(Undef) ->
case code:lib_dir(wx) of
{error,bad_name} ->
case app_exists(wx) of
false ->
filter(fun({_,{MaybeWxModule,_,_}}) ->
case atom_to_list(MaybeWxModule) of
"wx"++_ -> false;
Expand Down Expand Up @@ -338,3 +338,16 @@ open_log(Config, Name) ->

close_log(Fd) ->
ok = file:close(Fd).

app_exists(AppAtom) ->
case code:lib_dir(AppAtom) of
{error,bad_name} ->
false;
Path ->
case file:read_file_info(filename:join(Path,"ebin")) of
{ok,_} ->
true;
_ ->
false
end
end.
15 changes: 7 additions & 8 deletions lib/asn1/test/asn1_SUITE.erl
Expand Up @@ -51,7 +51,8 @@
%% Suite definition
%%------------------------------------------------------------------------------

suite() -> [{ct_hooks, [ts_install_cth]}].
suite() -> [{ct_hooks, [ts_install_cth]},
{timetrap,{minutes,60}}].

all() ->
[{group, parallel},
Expand Down Expand Up @@ -241,15 +242,10 @@ init_per_testcase(Func, Config) ->
ok = filelib:ensure_dir(filename:join([CaseDir, dummy_file])),
true = code:add_patha(CaseDir),

Dog = case Func of
testX420 -> test_server:timetrap({minutes, 90});
_ -> test_server:timetrap({minutes, 60})
end,
[{case_dir, CaseDir}, {watchdog, Dog}|Config].
[{case_dir, CaseDir}|Config].

end_per_testcase(_Func, Config) ->
code:del_path(?config(case_dir, Config)),
test_server:timetrap_cancel(?config(watchdog, Config)).
code:del_path(?config(case_dir, Config)).

%%------------------------------------------------------------------------------
%% Test runners
Expand Down Expand Up @@ -1064,6 +1060,9 @@ test_modified_x420(Config) ->
asn1_test_lib:compile_all(Files, Config, [der]),
test_modified_x420:test_io(Config).


testX420() ->
[{timetrap,{minutes,90}}].
testX420(Config) ->
test(Config, fun testX420/3, [ber, ber_bin, ber_bin_v2]).
testX420(Config, Rule, Opts) ->
Expand Down
7 changes: 6 additions & 1 deletion lib/common_test/test/ct_netconfc_SUITE.erl
Expand Up @@ -44,7 +44,12 @@
%%--------------------------------------------------------------------
init_per_suite(Config) ->
Config1 = ct_test_support:init_per_suite(Config),
Config1.
case application:load(crypto) of
{error,Reason} ->
{skip, Reason};
_ ->
Config1
end.

end_per_suite(Config) ->
ct_test_support:end_per_suite(Config).
Expand Down
16 changes: 9 additions & 7 deletions lib/inets/test/inets_app_test.erl
Expand Up @@ -35,6 +35,15 @@
init_per_testcase(undef_funcs, Config) ->
NewConfig = lists:keydelete(watchdog, 1, Config),
Dog = test_server:timetrap(inets_test_lib:minutes(10)),

%% We need to check if there is a point to run this test.
%% On some platforms, crypto will not build, which in turn
%% causes ssl to not build (at this time, this will
%% change in the future).
%% So, we first check if we can start crypto, and if not,
%% we skip this test case!
?ENSURE_STARTED(crypto),

[{watchdog, Dog}| NewConfig];
init_per_testcase(_, Config) ->
Config.
Expand Down Expand Up @@ -240,13 +249,6 @@ undef_funcs(suite) ->
undef_funcs(doc) ->
[];
undef_funcs(Config) when is_list(Config) ->
%% We need to check if there is a point to run this test.
%% On some platforms, crypto will not build, which in turn
%% causes ssl to not build (at this time, this will
%% change in the future).
%% So, we first check if we can start crypto, and if not,
%% we skip this test case!
?ENSURE_STARTED(crypto),
App = inets,
AppFile = key1search(app_file, Config),
Mods = key1search(modules, AppFile),
Expand Down

0 comments on commit 045319d

Please sign in to comment.