diff options
author | Lukas Larsson <[email protected]> | 2017-09-06 11:59:43 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2017-09-12 09:56:07 +0200 |
commit | 373f6170e70953838d95f09f511d81abc1fec87c (patch) | |
tree | 943cfc51f6f3853de722340f210483a5b7ff05c9 /lib | |
parent | 4cd39050980ad78ec60079b80a76aec5677b1a7f (diff) | |
download | otp-373f6170e70953838d95f09f511d81abc1fec87c.tar.gz otp-373f6170e70953838d95f09f511d81abc1fec87c.tar.bz2 otp-373f6170e70953838d95f09f511d81abc1fec87c.zip |
ts: Don't test apps that are not available
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common_test/test_server/ts_lib.erl | 24 |
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) -> |