aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2012-10-01 10:28:26 +0200
committerLukas Larsson <[email protected]>2012-10-01 11:32:42 +0200
commite062d0fe7efcb3e4b19f9e7c8ed3a30c421755a4 (patch)
tree24a1ab5354e242100d81d98be791db26ee7c7797
parent1a4e8f6e5cbebcdb8d99ef44154fe3c9742ef8b7 (diff)
downloadotp-e062d0fe7efcb3e4b19f9e7c8ed3a30c421755a4.tar.gz
otp-e062d0fe7efcb3e4b19f9e7c8ed3a30c421755a4.tar.bz2
otp-e062d0fe7efcb3e4b19f9e7c8ed3a30c421755a4.zip
Verify that ebin folder of applications exists
Sometime in cross environments the documentation will create the lib folders, but there will be no ebin so all undefined functions should then be ignored.
-rw-r--r--erts/test/otp_SUITE.erl25
-rw-r--r--lib/test_server/src/ts.erl17
2 files changed, 31 insertions, 11 deletions
diff --git a/erts/test/otp_SUITE.erl b/erts/test/otp_SUITE.erl
index 5f28f22606..7df611e749 100644
--- a/erts/test/otp_SUITE.erl
+++ b/erts/test/otp_SUITE.erl
@@ -150,8 +150,8 @@ is_hipe_module(Mod) ->
end.
ssl_crypto_filter(Undef) ->
- case {code:lib_dir(crypto),code:lib_dir(ssl)} of
- {{error,bad_name},{error,bad_name}} ->
+ case {app_exists(crypto),app_exists(ssl)} of
+ {false,false} ->
filter(fun({_,{ssl,_,_}}) -> false;
({_,{crypto,_,_}}) -> false;
({_,{ssh,_,_}}) -> false;
@@ -175,8 +175,8 @@ eunit_filter(Undef) ->
end, Undef).
dialyzer_filter(Undef) ->
- case code:lib_dir(dialyzer) of
- {error,bad_name} ->
+ case app_exists(dialyzer) of
+ false ->
filter(fun({_,{dialyzer_callgraph,_,_}}) -> false;
({_,{dialyzer_codeserver,_,_}}) -> false;
({_,{dialyzer_contracts,_,_}}) -> false;
@@ -191,8 +191,8 @@ dialyzer_filter(Undef) ->
end.
wx_filter(Undef) ->
- case code:lib_dir(wx) of
- {error,bad_name} ->
+ case app_exists(wx) of
+ false ->
filter(fun({_,{MaybeWxModule,_,_}}) ->
case atom_to_list(MaybeWxModule) of
"wx"++_ -> false;
@@ -338,3 +338,16 @@ open_log(Config, Name) ->
close_log(Fd) ->
ok = file:close(Fd).
+
+app_exists(AppAtom) ->
+ case code:lib_dir(AppAtom) of
+ {error,bad_name} ->
+ false;
+ Path ->
+ case file:read_file_info(filename:join(Path,"ebin")) of
+ {ok,_} ->
+ true;
+ _ ->
+ false
+ end
+ end.
diff --git a/lib/test_server/src/ts.erl b/lib/test_server/src/ts.erl
index 4899f38d2b..42b286ef64 100644
--- a/lib/test_server/src/ts.erl
+++ b/lib/test_server/src/ts.erl
@@ -291,12 +291,19 @@ 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
- {error, bad_name} when Testspec /= emulator,
- Testspec /= system,
- Testspec /= epmd ->
+ _ when Testspec == emulator;
+ Testspec == system;
+ Testspec == epmd ->
+ File++".spec";
+ {error, bad_name} ->
create_skip_spec(Testspec, tests(Testspec));
- _ ->
- File++".spec"
+ Path ->
+ case file:read_file_info(filename:join(Path,"ebin")) of
+ {ok,_} ->
+ File++".spec";
+ _ ->
+ create_skip_spec(Testspec, tests(Testspec))
+ end
end,
run_test(File, [{spec,[Spec]}], Options);
%% Runs one module in a spec (interactive)