aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/test
diff options
context:
space:
mode:
authorJosé Valim <[email protected]>2012-11-28 13:08:35 +0100
committerFredrik Gustafsson <[email protected]>2013-01-25 14:57:00 +0100
commitf3fb48d42329d54b463e7434ff28bb51e4dde4dd (patch)
tree4ccc391d2ae698ea62df1bdffd0847beda29e7c3 /lib/tools/test
parent29231033bfa618e5c4e1c50a5cefba32e02f2708 (diff)
downloadotp-f3fb48d42329d54b463e7434ff28bb51e4dde4dd.tar.gz
otp-f3fb48d42329d54b463e7434ff28bb51e4dde4dd.tar.bz2
otp-f3fb48d42329d54b463e7434ff28bb51e4dde4dd.zip
Ensure cover keeps the proper file source
Whenever a module is compiled via compile:forms/2, the source is set to current directory unless a source option is passed to compile. This commit ensures that cover passes the source information to compile:forms/2 to ensure the source won't be modified after the module is cover compiled.
Diffstat (limited to 'lib/tools/test')
-rw-r--r--lib/tools/test/cover_SUITE.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl
index 2156390244..5abc5c41b1 100644
--- a/lib/tools/test/cover_SUITE.erl
+++ b/lib/tools/test/cover_SUITE.erl
@@ -149,7 +149,9 @@ compile(Config) when is_list(Config) ->
ok = beam_lib:crypto_key_fun(simple_crypto_fun(Key)),
{ok,crypt} = cover:compile_beam("crypt.beam")
end,
+ Path = filename:join([?config(data_dir, Config), "compile_beam", "v.erl"]),
?line {ok,v} = cover:compile_beam(v),
+ {source,Path} = lists:keyfind(source, 1, v:module_info(compile)),
?line {ok,w} = cover:compile_beam("w.beam"),
?line {error,{no_abstract_code,"./x.beam"}} = cover:compile_beam(x),
?line {error,{already_cover_compiled,no_beam_found,a}}=cover:compile_beam(a),