aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-11-28 15:05:23 +0100
committerBjörn Gustavsson <[email protected]>2011-11-28 15:05:23 +0100
commitaa6824a16ba83c35ad35f9dde40c5a198c7002a2 (patch)
treecbd05ba751d4ea69f3b5caec2fdae0c9ba68265e /lib/stdlib/test
parent5c3dbd080f27f683f2d30c9c7072547c68d715b3 (diff)
parent9ac7e19e35b02c02e15abd3abc4e7b5c8b62752d (diff)
downloadotp-aa6824a16ba83c35ad35f9dde40c5a198c7002a2.tar.gz
otp-aa6824a16ba83c35ad35f9dde40c5a198c7002a2.tar.bz2
otp-aa6824a16ba83c35ad35f9dde40c5a198c7002a2.zip
Merge branch 'bjorn/compiler/options/OTP-9752'
* bjorn/compiler/options/OTP-9752: filename documentation: Recommend against using filename:find_src/1,2 Teach filename:find_src/1,2 to handle slim or stripped BEAM files filename: Eliminate failing call to Mod:module_info(source_file) filename.erl:filter_options/1: Remove handling of dead options compiler: Don't include {cwd,_} in module_info(compile) compiler: Don't include source code options in module_info(compile) hipe: Teach hipe to handle slim or stripped BEAM files
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/filename_SUITE.erl16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/stdlib/test/filename_SUITE.erl b/lib/stdlib/test/filename_SUITE.erl
index 70b0d413dc..4cfa589660 100644
--- a/lib/stdlib/test/filename_SUITE.erl
+++ b/lib/stdlib/test/filename_SUITE.erl
@@ -483,6 +483,22 @@ find_src(Config) when is_list(Config) ->
%% Try to find the source for a preloaded module.
?line {error,{preloaded,init}} = filename:find_src(init),
+
+ %% Make sure that find_src works for a slim BEAM file.
+ OldPath = code:get_path(),
+ try
+ PrivDir = ?config(priv_dir, Config),
+ code:add_patha(PrivDir),
+ Src = "simple",
+ SrcPath = filename:join(PrivDir, Src) ++ ".erl",
+ SrcContents = "-module(simple).\n",
+ ok = file:write_file(SrcPath, SrcContents),
+ {ok,simple} = compile:file(SrcPath, [slim,{outdir,PrivDir}]),
+ BeamPath = filename:join(PrivDir, Src),
+ {BeamPath,[]} = filename:find_src(simple)
+ after
+ code:set_path(OldPath)
+ end,
ok.
%%