Skip to content

Commit

Permalink
Merge branch 'lukas/test-cases' into maint
Browse files Browse the repository at this point in the history
* lukas/test-cases:
  Ignore calls to wx* modules if it is undefined
  Fix erl_interface testcases
  Update gccifier to respect -link option
  Extand timetrap for escript tests
  Fix compilation issues on windows and Ubuntu 12.04
  Ignore common_test bootstrap
  • Loading branch information
garazdawi committed Jun 1, 2012
2 parents 3e348c6 + 50da165 commit b82c337
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -110,6 +110,7 @@ JAVADOC-GENERATED
!/bootstrap/bin/*.boot

/bootstrap/lib/asn1
/bootstrap/lib/common_test
/bootstrap/lib/hipe
/bootstrap/lib/ic
/bootstrap/lib/orber
Expand Down
18 changes: 11 additions & 7 deletions erts/test/erl_print_SUITE_data/Makefile.src
Expand Up @@ -20,16 +20,20 @@
include @erts_lib_include_internal_generated@@DS@ethread.mk

CC = @CC@
CFLAGS = @ERTS_CFLAGS@
LIBS = @ERTS_LIBS@
CFLAGST = @ERTS_CFLAGS@
LIBST = @ERTS_LIBS@
CFLAGSF = @CFLAGS@
LIBSF = @LIBS@
CP=cp
CHMOD=chmod

EPTF_CFLAGS = -Wall $(CFLAGS) @DEFS@ -I@erts_lib_include_internal@ -I@erts_lib_include_internal_generated@
EPTF_LIBS = $(LIBS) -L@erts_lib_internal_path@ -lerts_internal@type_marker@
COMMON_CFLAGS = -Wall @DEFS@ -I@erts_lib_include_internal@ -I@erts_lib_include_internal_generated@

EPTT_CFLAGS = -DTHREAD_SAFE $(ETHR_DEFS) $(EPTF_CFLAGS)
EPTT_LIBS = -L@erts_lib_internal_path@ -lerts_internal_r@type_marker@ $(ETHR_LIBS) $(LIBS)
EPTF_CFLAGS = $(CFLAGSF) $(COMMON_CFLAGS)
EPTF_LIBS = -L@erts_lib_internal_path@ -lerts_internal@type_marker@ $(LIBSF)

EPTT_CFLAGS = -DTHREAD_SAFE $(ETHR_DEFS) $(CFLAGST) $(COMMON_CFLAGS)
EPTT_LIBS = -L@erts_lib_internal_path@ -lerts_internal_r@type_marker@ $(ETHR_LIBS) $(LIBST)

GCC = .@DS@gccifier -CC"$(CC)"

Expand All @@ -43,7 +47,7 @@ gccifier@exe@:
$(CHMOD) a+x gccifier@exe@
@ELSE@
gccifier@exe@: ..@DS@utils@DS@gccifier.c
$(CC) $(CFLAGS) -o gccifier@exe@ ..@DS@utils@DS@gccifier.c $(LIBS)
$(CC) $(CFLAGST) -o gccifier@exe@ ..@DS@utils@DS@gccifier.c $(LIBST)
@ENDIF@

erl_print_tests.false@exe@: gccifier@exe@ erl_print_tests.c
Expand Down
4 changes: 2 additions & 2 deletions erts/test/erl_print_SUITE_data/erl_print_tests.c
Expand Up @@ -44,8 +44,8 @@
#endif

#ifdef __WIN32__
#define signed_long_long LONGLONG
#define unsigned_long_long ULONGLONG
#define signed_long_long __int64
#define unsigned_long_long unsigned __int64
#else
#define signed_long_long signed long long
#define unsigned_long_long unsigned long long
Expand Down
16 changes: 15 additions & 1 deletion erts/test/otp_SUITE.erl
Expand Up @@ -89,7 +89,8 @@ undefined_functions(Config) when is_list(Config) ->
?line Undef2 = ssl_crypto_filter(Undef1),
?line Undef3 = edoc_filter(Undef2),
Undef4 = eunit_filter(Undef3),
Undef = dialyzer_filter(Undef4),
Undef5 = dialyzer_filter(Undef4),
Undef = wx_filter(Undef5),

case Undef of
[] -> ok;
Expand Down Expand Up @@ -188,6 +189,19 @@ dialyzer_filter(Undef) ->
_ -> Undef
end.

wx_filter(Undef) ->
case code:lib_dir(wx) of
{error,bad_name} ->
filter(fun({_,{MaybeWxModule,_,_}}) ->
case atom_to_list(MaybeWxModule) of
"wx"++_ -> false;
_ -> true
end
end, Undef);
_ -> Undef
end.


deprecated_not_in_obsolete(Config) when is_list(Config) ->
?line Server = ?config(xref_server, Config),
?line {ok,DeprecatedFunctions} = xref:q(Server, "DF"),
Expand Down
3 changes: 3 additions & 0 deletions erts/test/utils/gccifier.c
Expand Up @@ -231,6 +231,9 @@ main(int argc, char *argv[])
CHECK_FIRST_LINK_ARG;
save_arg(&link_args, "-libpath:", arg, NULL);
}
else if (strcmp("-link",arg) == 0) {
CHECK_FIRST_LINK_ARG;
}
#endif /* #ifdef __WIN32__ */
else if (is_prefix("-l", &arg)) {
CHECK_FIRST_LINK_ARG;
Expand Down
6 changes: 4 additions & 2 deletions lib/erl_interface/test/all_SUITE_data/gccifier.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
* Copyright Ericsson AB 2005-2009. All Rights Reserved.
* Copyright Ericsson AB 2004-2009. 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
Expand All @@ -16,7 +16,6 @@
*
* %CopyrightEnd%
*
*/

/*
Expand Down Expand Up @@ -232,6 +231,9 @@ main(int argc, char *argv[])
CHECK_FIRST_LINK_ARG;
save_arg(&link_args, "-libpath:", arg, NULL);
}
else if (strcmp("-link",arg) == 0) {
CHECK_FIRST_LINK_ARG;
}
#endif /* #ifdef __WIN32__ */
else if (is_prefix("-l", &arg)) {
CHECK_FIRST_LINK_ARG;
Expand Down
20 changes: 10 additions & 10 deletions lib/erl_interface/test/ei_tmo_SUITE.erl
Expand Up @@ -88,12 +88,12 @@ ei_recv_tmo(doc) ->
ei_recv_tmo(suite) ->
[];
ei_recv_tmo(Config) when is_list(Config) ->
?line do_one_recv(c_node_recv_tmo_1),
?line do_one_recv_failure(c_node_recv_tmo_2),
?line do_one_recv(Config,c_node_recv_tmo_1),
?line do_one_recv_failure(Config,c_node_recv_tmo_2),
ok.


do_one_recv(CNode) ->
do_one_recv(Config,CNode) ->
?line {_,Host} = split(node()),
?line P1 = runner:start(?recv_tmo),
?line runner:send_term(P1,{CNode,
Expand All @@ -107,7 +107,7 @@ do_one_recv(CNode) ->
?line {term, Term1} = runner:get_term(P1, 10000),
?line runner:recv_eot(P1).

do_one_recv_failure(CNode) ->
do_one_recv_failure(Config,CNode) ->
?line P1 = runner:start(?recv_tmo),
?line runner:send_term(P1,{CNode,
erlang:get_cookie(),
Expand All @@ -128,14 +128,14 @@ ei_send_tmo(Config) when is_list(Config) ->
%dbg:p(self()),
VxSim = ?config(vxsim, Config),
?line register(ei_send_tmo_1,self()),
?line do_one_send(self(),c_node_send_tmo_1),
?line do_one_send(ei_send_tmo_1,c_node_send_tmo_2),
?line do_one_send_failure(self(),cccc1,c_nod_send_tmo_3,VxSim),
?line do_one_send_failure(ei_send_tmo_1,cccc2,c_nod_send_tmo_4,VxSim),
?line do_one_send(Config,self(),c_node_send_tmo_1),
?line do_one_send(Config,ei_send_tmo_1,c_node_send_tmo_2),
?line do_one_send_failure(Config,self(),cccc1,c_nod_send_tmo_3,VxSim),
?line do_one_send_failure(Config,ei_send_tmo_1,cccc2,c_nod_send_tmo_4,VxSim),
ok.


do_one_send(From,CNode) ->
do_one_send(Config,From,CNode) ->
?line {_,Host} = split(node()),
?line P1 = runner:start(?send_tmo),
?line runner:send_term(P1,{CNode,
Expand All @@ -155,7 +155,7 @@ do_one_send(From,CNode) ->
?line {term, 0} = runner:get_term(P1, 10000),
?line runner:recv_eot(P1).

do_one_send_failure(From,FakeName,CName,VxSim) ->
do_one_send_failure(Config,From,FakeName,CName,VxSim) ->
?line {_,Host} = split(node()),
?line OurName = join(FakeName,Host),
?line Node = join(CName,Host),
Expand Down
30 changes: 15 additions & 15 deletions lib/erl_interface/test/erl_match_SUITE.erl
Expand Up @@ -29,7 +29,7 @@
bind/1, integers/1, floats/1, binaries/1, strings/1]).

%% For interactive running of matcher.
-export([start_matcher/0, erl_match/3]).
-export([start_matcher/1, erl_match/3]).

%% This test suite tests the erl_match() function.

Expand Down Expand Up @@ -57,7 +57,7 @@ end_per_group(_GroupName, Config) ->

atoms(suite) -> [];
atoms(Config) when is_list(Config) ->
?line P = start_matcher(),
?line P = start_matcher(Config),

?line eq(P, '', ''),
?line eq(P, a, a),
Expand All @@ -74,7 +74,7 @@ atoms(Config) when is_list(Config) ->

lists(suite) -> [];
lists(Config) when is_list(Config) ->
?line P = start_matcher(),
?line P = start_matcher(Config),
?line eq(P, [], []),

?line ne(P, [], [a]),
Expand All @@ -101,7 +101,7 @@ lists(Config) when is_list(Config) ->

tuples(suite) -> [];
tuples(Config) when is_list(Config) ->
?line P = start_matcher(),
?line P = start_matcher(Config),

?line ne(P, {}, {a, b}),
?line ne(P, {a, b}, {}),
Expand Down Expand Up @@ -129,7 +129,7 @@ tuples(Config) when is_list(Config) ->

references(suite) -> [];
references(Config) when is_list(Config) ->
?line P = start_matcher(),
?line P = start_matcher(Config),
?line Ref1 = make_ref(),
?line Ref2 = make_ref(),

Expand All @@ -144,7 +144,7 @@ references(Config) when is_list(Config) ->

pids(suite) -> [];
pids(Config) when is_list(Config) ->
?line P = start_matcher(),
?line P = start_matcher(Config),
?line Pid1 = c:pid(0,1,2),
?line Pid2 = c:pid(0,1,3),

Expand All @@ -163,8 +163,8 @@ ports(Config) when is_list(Config) ->
vxworks ->
{skipped,"not on vxworks, pucko"};
_ ->
?line P = start_matcher(),
?line P2 = start_matcher(),
?line P = start_matcher(Config),
?line P2 = start_matcher(Config),

?line eq(P, P, P),
?line ne(P, P, P2),
Expand All @@ -176,7 +176,7 @@ ports(Config) when is_list(Config) ->

integers(suite) -> [];
integers(Config) when is_list(Config) ->
?line P = start_matcher(),
?line P = start_matcher(Config),
?line I1 = 123,
?line I2 = 12345,
?line I3 = -123,
Expand All @@ -195,7 +195,7 @@ integers(Config) when is_list(Config) ->

floats(suite) -> [];
floats(Config) when is_list(Config) ->
?line P = start_matcher(),
?line P = start_matcher(Config),
?line F1 = 3.1414,
?line F2 = 3.1415,
?line F3 = 3.1416,
Expand All @@ -218,7 +218,7 @@ floats(Config) when is_list(Config) ->

binaries(suite) -> [];
binaries(Config) when is_list(Config) ->
?line P = start_matcher(),
?line P = start_matcher(Config),
?line Bin1 = term_to_binary({kalle, 146015, {kungsgatan, 23}}),
?line Bin2 = term_to_binary(sune),
?line Bin3 = list_to_binary("sune"),
Expand All @@ -237,7 +237,7 @@ binaries(Config) when is_list(Config) ->

strings(suite) -> [];
strings(Config) when is_list(Config) ->
?line P = start_matcher(),
?line P = start_matcher(Config),

?line S1 = "string",
?line S2 = "streng",
Expand All @@ -254,7 +254,7 @@ strings(Config) when is_list(Config) ->

bind(suite) -> [];
bind(Config) when is_list(Config) ->
?line P = start_bind(),
?line P = start_bind(Config),
?line S = "[X,Y,Z]",
?line L1 = [301,302,302],
?line L2 = [65,66,67],
Expand All @@ -265,7 +265,7 @@ bind(Config) when is_list(Config) ->
?line runner:finish(P),
ok.

start_bind() ->
start_bind(Config) ->
runner:start(?erl_match_bind).

bind_ok(Port, Bind, Term) ->
Expand All @@ -287,7 +287,7 @@ erl_bind(Port, Pattern, Term) ->



start_matcher() ->
start_matcher(Config) ->
runner:start(?erl_match_server).

eq(Port, Pattern, Term) ->
Expand Down
2 changes: 1 addition & 1 deletion lib/stdlib/test/escript_SUITE.erl
Expand Up @@ -62,7 +62,7 @@ end_per_group(_GroupName, Config) ->
Config.

init_per_testcase(_Case, Config) ->
?line Dog = ?t:timetrap(?t:minutes(1)),
?line Dog = ?t:timetrap(?t:minutes(2)),
[{watchdog,Dog}|Config].

end_per_testcase(_Case, Config) ->
Expand Down

0 comments on commit b82c337

Please sign in to comment.