aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/src/ts.erl
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2012-12-03 10:22:40 +0100
committerFredrik Gustafsson <[email protected]>2012-12-03 10:22:40 +0100
commitc228ceb941e26a04317bd2f66a2ee64687f0f869 (patch)
treefb019fce335b6db5b92ce300ee707496a9fe759b /lib/test_server/src/ts.erl
parentf78daeeccbf6de61b9e5dae4dd70f12fba03a2ff (diff)
parent26dffbeec17226a25c00d4072cb0f5c29ed48cea (diff)
downloadotp-c228ceb941e26a04317bd2f66a2ee64687f0f869.tar.gz
otp-c228ceb941e26a04317bd2f66a2ee64687f0f869.tar.bz2
otp-c228ceb941e26a04317bd2f66a2ee64687f0f869.zip
Merge branch 'fredrik/ssh/fix-idle-tests' into fredrik/ssh/rekeying
* fredrik/ssh/fix-idle-tests: (50 commits) Modifications to idle_time testcase Teach Win installer to handle redist on w2012/w8 ssl: Receive port EXIT-message so that it does not get mixed up with the protocol-error message we are expecting ssl: Add and enhance tests ssl: Consider new server options when resuming a session Prepare release ssl: Add dependencies to Makefile Simplify the code for the generated info/0 function Don't try to work around a non-loadable NIF library Fix BER encoding when multiple levels of typedefs are used Update megaco documentation Update documentation for the asn1 application Fix other applications Fix use of asn1 in megaco Remove the unused asn1ct_gen_ber module Fix erroneous skipping for jinterface, erl_interface and ic kernel: Heart port needs to be unregistered Update preloaded modules Update primary bootstrap Update copyright years ...
Diffstat (limited to 'lib/test_server/src/ts.erl')
-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 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) ->