aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-04-07 10:31:41 +0200
committerBjörn Gustavsson <[email protected]>2017-04-07 10:31:41 +0200
commiteaaeb3dab48ba3dde62281e21f773148e30bc7fc (patch)
treeb26b991bbe25834b6f70a657d079967cd2cea94c
parentd88d2cd8e9c50122923adc8b17904664f6360528 (diff)
downloadotp-eaaeb3dab48ba3dde62281e21f773148e30bc7fc.tar.gz
otp-eaaeb3dab48ba3dde62281e21f773148e30bc7fc.tar.bz2
otp-eaaeb3dab48ba3dde62281e21f773148e30bc7fc.zip
Teach filelib_SUITE to work when STDLIB is cover-compiled
filelib_SUITE:find_source/1 would fail when running the tests with STDLIB cover-compiled.
-rw-r--r--lib/stdlib/test/filelib_SUITE.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl
index 87fba815d2..6133a3ded4 100644
--- a/lib/stdlib/test/filelib_SUITE.erl
+++ b/lib/stdlib/test/filelib_SUITE.erl
@@ -507,7 +507,12 @@ file_props_symlink(Config) ->
end.
find_source(Config) when is_list(Config) ->
- BeamFile = code:which(lists),
+ %% filename:find_{file,source}() does not work if the files are
+ %% cover-compiled. To make sure that the test does not fail
+ %% when the STDLIB is cover-compiled, search for modules in
+ %% the compiler application.
+
+ BeamFile = code:which(compile),
BeamName = filename:basename(BeamFile),
BeamDir = filename:dirname(BeamFile),
SrcName = filename:basename(BeamFile, ".beam") ++ ".erl",
@@ -530,7 +535,7 @@ find_source(Config) when is_list(Config) ->
{error, not_found} = filelib:find_source(BeamName, BeamDir,
[{".erl",".yrl",[{"",""}]}]),
- {ok, ParserErl} = filelib:find_source(code:which(erl_parse)),
+ {ok, ParserErl} = filelib:find_source(code:which(core_parse)),
{ok, ParserYrl} = filelib:find_source(ParserErl),
"lry." ++ _ = lists:reverse(ParserYrl),
{ok, ParserYrl} = filelib:find_source(ParserErl,