aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/src
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2012-11-21 10:43:38 +0100
committerRaimo Niskanen <[email protected]>2012-11-26 09:26:12 +0100
commit87b4ec9a0b2e4bbe1180e8a26700072f49303508 (patch)
treee23d1cfcd7bbcebe058f607f4e89199555f90019 /lib/test_server/src
parent1ecc870573b37491e9dd7965d29d20efea557c01 (diff)
downloadotp-87b4ec9a0b2e4bbe1180e8a26700072f49303508.tar.gz
otp-87b4ec9a0b2e4bbe1180e8a26700072f49303508.tar.bz2
otp-87b4ec9a0b2e4bbe1180e8a26700072f49303508.zip
Fix erroneous skipping for jinterface, erl_interface and ic
Diffstat (limited to 'lib/test_server/src')
-rw-r--r--lib/test_server/src/ts.erl52
1 files changed, 37 insertions, 15 deletions
diff --git a/lib/test_server/src/ts.erl b/lib/test_server/src/ts.erl
index 42b286ef64..5fbc0ee017 100644
--- a/lib/test_server/src/ts.erl
+++ b/lib/test_server/src/ts.erl
@@ -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) ->