Skip to content

Commit

Permalink
Merge branch 'raimo/daily-build-fixes' into maint
Browse files Browse the repository at this point in the history
* raimo/daily-build-fixes:
  Fix erroneous skipping for jinterface, erl_interface and ic
  • Loading branch information
RaimoNiskanen committed Nov 26, 2012
2 parents c9f6798 + 87b4ec9 commit 7c4021a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 19 deletions.
11 changes: 8 additions & 3 deletions lib/ic/test/java_client_erl_server_SUITE.erl
Expand Up @@ -62,9 +62,14 @@ init_per_suite(Config) when is_list(Config) ->
case case code:priv_dir(jinterface) of
{error,bad_name} ->
false;
P ->
filelib:is_dir(P)
end
P ->
case filelib:wildcard(filename:join(P, "*.jar")) of
[_|_] ->
true;
[] ->
false
end
end
of
true ->
case find_executable(["java"]) of
Expand Down
2 changes: 1 addition & 1 deletion lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src
Expand Up @@ -68,7 +68,7 @@ EBINS = $(ERL_FILES:.erl=.@EMULATOR@)

@IFEQ@ (@jinterface_classpath@,)
all:
@ELSE
@ELSE@
all: $(CLASS_FILES) $(EBINS)
@ENDIF@

Expand Down
52 changes: 37 additions & 15 deletions lib/test_server/src/ts.erl
Expand Up @@ -290,21 +290,43 @@ run(List, Opts) when is_list(List), is_list(Opts) ->
run(Testspec, Config) when is_atom(Testspec), is_list(Config) ->
Options=check_test_get_opts(Testspec, Config),
File=atom_to_list(Testspec),
Spec = case code:lib_dir(Testspec) of
_ when Testspec == emulator;
Testspec == system;
Testspec == epmd ->
File++".spec";
{error, bad_name} ->
create_skip_spec(Testspec, tests(Testspec));
Path ->
case file:read_file_info(filename:join(Path,"ebin")) of
{ok,_} ->
File++".spec";
_ ->
create_skip_spec(Testspec, tests(Testspec))
end
end,
WhatToDo =
case Testspec of
%% Known to exist but fails generic tests below
emulator -> test;
system -> test;
erl_interface -> test;
epmd -> test;
_ ->
case code:lib_dir(Testspec) of
{error,bad_name} ->
%% Application does not exist
skip;
Path ->
case file:read_file_info(filename:join(Path,"ebin")) of
{ok,#file_info{type=directory}} ->
%% Erlang application is built
test;
_ ->
case filelib:wildcard(
filename:join([Path,"priv","*.jar"])) of
[] ->
%% The application is not built
skip;
[_|_] ->
%% Java application is built
test
end
end
end
end,
Spec =
case WhatToDo of
skip ->
create_skip_spec(Testspec, tests(Testspec));
test ->
File++".spec"
end,
run_test(File, [{spec,[Spec]}], Options);
%% Runs one module in a spec (interactive)
run(Testspec, Mod) when is_atom(Testspec), is_atom(Mod) ->
Expand Down

0 comments on commit 7c4021a

Please sign in to comment.