aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-04-10 10:16:00 +0200
committerBjörn Gustavsson <[email protected]>2017-04-10 10:16:00 +0200
commite837d55f1d0bfca428fd8f219af71e09c0f98748 (patch)
tree7b97d36b2faebcd25173474b6ea79e1007b823b8 /lib/stdlib
parent47911ac4aa0c85c700a23a0b382c373becf99d49 (diff)
parenteaaeb3dab48ba3dde62281e21f773148e30bc7fc (diff)
downloadotp-e837d55f1d0bfca428fd8f219af71e09c0f98748.tar.gz
otp-e837d55f1d0bfca428fd8f219af71e09c0f98748.tar.bz2
otp-e837d55f1d0bfca428fd8f219af71e09c0f98748.zip
Merge branch 'bjorn/stdlib/cuddle-with-tests'
* bjorn/stdlib/cuddle-with-tests: Teach filelib_SUITE to work when STDLIB is cover-compiled
Diffstat (limited to 'lib/stdlib')
-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,