aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2017-09-06 11:59:43 +0200
committerLukas Larsson <[email protected]>2017-09-12 09:56:07 +0200
commit373f6170e70953838d95f09f511d81abc1fec87c (patch)
tree943cfc51f6f3853de722340f210483a5b7ff05c9 /lib/common_test
parent4cd39050980ad78ec60079b80a76aec5677b1a7f (diff)
downloadotp-373f6170e70953838d95f09f511d81abc1fec87c.tar.gz
otp-373f6170e70953838d95f09f511d81abc1fec87c.tar.bz2
otp-373f6170e70953838d95f09f511d81abc1fec87c.zip
ts: Don't test apps that are not available
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/test_server/ts_lib.erl24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/common_test/test_server/ts_lib.erl b/lib/common_test/test_server/ts_lib.erl
index a7be740c5c..ea039a2c2b 100644
--- a/lib/common_test/test_server/ts_lib.erl
+++ b/lib/common_test/test_server/ts_lib.erl
@@ -120,7 +120,8 @@ specs(Dir) ->
[]
end
end, Specs),
- sort_tests(MainSpecs).
+
+ sort_tests(filter_tests(MainSpecs)).
test_categories(Dir, App) ->
Specs = filelib:wildcard(filename:join([filename:dirname(Dir),
@@ -141,10 +142,29 @@ suites(Dir, App) ->
"*_SUITE.erl"]),
Suites=filelib:wildcard(Glob),
[filename_to_atom(Name) || Name <- Suites].
-
+
filename_to_atom(Name) ->
list_to_atom(filename:rootname(filename:basename(Name))).
+%% Filter out tests of applications that are not accessible
+
+filter_tests(Tests) ->
+ lists:filter(
+ fun(Special) when Special == epmd;
+ Special == emulator;
+ Special == system ->
+ true;
+ (Test) ->
+ case application:load(filename_to_atom(Test)) of
+ {error, {already_loaded, _}} ->
+ true;
+ {error,_NoSuchApplication} ->
+ false;
+ _ ->
+ true
+ end
+ end, Tests).
+
%% Sorts a list of either log files directories or spec files.
sort_tests(Tests) ->