Fix include directories given to cover:compile/2

The directories, taken from src/Emakefile are relative to src/, not
testsuite/: they need to be adapted.
This commit is contained in:
Jean-Sébastien Pédron 2011-06-30 17:34:50 +02:00
parent 3c7db77ed7
commit 828eb0aead

View File

@ -32,7 +32,18 @@ setup() ->
cover_compile(Emakefile).
cover_compile([{Mods, Options} | Rest]) ->
cover_compile2(Mods, Options),
%% Include directories are relative to $top_builddir/src in
%% src/Emakefile. We must prepend this path to each directory. If
%% "Dir" is an absolute directory, filename:join/1 won't change it.
Options1 = [
case Option of
{i, Dir} -> {i, filename:join([?top_builddir, "src", Dir])};
_ -> Option
end
|| Option <- Options
],
io:format(standard_error, "Options1 = ~p~n", [Options1]),
cover_compile2(Mods, Options1),
cover_compile(Rest);
cover_compile([]) ->
ok.