diff options
author | Raimo Niskanen <[email protected]> | 2012-11-26 09:34:34 +0100 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2012-11-26 09:34:34 +0100 |
commit | ac4f18141f4dd56f07b22cfcd2d642a2d449c1d4 (patch) | |
tree | 8867eb9ec2846a63af689a5e5cbdb05441582440 | |
parent | 9b562e0c84e690b31a3f379cbd470b537cd234bd (diff) | |
parent | 7c4021a7555112affc7c37dd72f418ccc87ca647 (diff) | |
download | otp-ac4f18141f4dd56f07b22cfcd2d642a2d449c1d4.tar.gz otp-ac4f18141f4dd56f07b22cfcd2d642a2d449c1d4.tar.bz2 otp-ac4f18141f4dd56f07b22cfcd2d642a2d449c1d4.zip |
Merge branch 'maint'
-rw-r--r-- | lib/ic/test/java_client_erl_server_SUITE.erl | 11 | ||||
-rw-r--r-- | lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src | 2 | ||||
-rw-r--r-- | lib/test_server/src/ts.erl | 52 |
3 files changed, 46 insertions, 19 deletions
diff --git a/lib/ic/test/java_client_erl_server_SUITE.erl b/lib/ic/test/java_client_erl_server_SUITE.erl index c2bec94697..9e49305c3c 100644 --- a/lib/ic/test/java_client_erl_server_SUITE.erl +++ b/lib/ic/test/java_client_erl_server_SUITE.erl @@ -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 diff --git a/lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src b/lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src index ac8f2e619f..3143ab427b 100644 --- a/lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src +++ b/lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src @@ -68,7 +68,7 @@ EBINS = $(ERL_FILES:.erl=.@EMULATOR@) @IFEQ@ (@jinterface_classpath@,) all: -@ELSE +@ELSE@ all: $(CLASS_FILES) $(EBINS) @ENDIF@ diff --git a/lib/test_server/src/ts.erl b/lib/test_server/src/ts.erl index 3ddc58fdbc..115e783070 100644 --- a/lib/test_server/src/ts.erl +++ b/lib/test_server/src/ts.erl @@ -259,21 +259,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) -> |