aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2012-10-24 14:57:54 +0200
committerSiri Hansen <[email protected]>2012-10-25 13:50:52 +0200
commitd241e64a5a4e46e1b3b864215f784348623af519 (patch)
treed709016873e685a67f8b10af53a0d854dff1cf9e
parentbb915519aa16f6410b19c6f868805b47717f11fa (diff)
downloadotp-d241e64a5a4e46e1b3b864215f784348623af519.tar.gz
otp-d241e64a5a4e46e1b3b864215f784348623af519.tar.bz2
otp-d241e64a5a4e46e1b3b864215f784348623af519.zip
[test_server] Set data_dir correctly when suite is cover compiled
If the test suite itself was included in code coverage analysis, then test_server_ctrl would not manage to set data_dir correctly for the test, since it relied on the result of code:which(Suite). This has been corrected.
-rw-r--r--lib/test_server/src/test_server_ctrl.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl
index 88d86285d5..4e3cbf9087 100644
--- a/lib/test_server/src/test_server_ctrl.erl
+++ b/lib/test_server/src/test_server_ctrl.erl
@@ -3207,11 +3207,17 @@ get_data_dir(Mod, Suite) ->
non_existing ->
print(12, "The module ~p is not loaded", [Mod]),
[];
+ cover_compiled ->
+ MainCoverNode = cover:get_main_node(),
+ {file,File} = rpc:call(MainCoverNode,cover,is_compiled,[UseMod]),
+ do_get_data_dir(UseMod,File);
FullPath ->
- filename:dirname(FullPath) ++ "/" ++ cast_to_list(UseMod) ++
- ?data_dir_suffix
+ do_get_data_dir(UseMod,FullPath)
end.
+do_get_data_dir(Mod,File) ->
+ filename:dirname(File) ++ "/" ++ cast_to_list(Mod) ++ ?data_dir_suffix.
+
print_conf_time(0) ->
ok;
print_conf_time(ConfTime) ->