From e062d0fe7efcb3e4b19f9e7c8ed3a30c421755a4 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 1 Oct 2012 10:28:26 +0200 Subject: 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. --- lib/test_server/src/ts.erl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'lib/test_server') 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) -- cgit v1.2.3