aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/doc
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2013-02-17 19:35:40 +0100
committerAnders Svensson <[email protected]>2013-03-06 08:37:07 +0100
commit6c9ff9812608c1c893c50eb567f6e8121fdde35d (patch)
tree50926eff773ef9e27b1265ffc496d089b6bf66e5 /lib/tools/doc
parent0a2237a18e16de514677c7c2a13bee7c6e32bbaf (diff)
downloadotp-6c9ff9812608c1c893c50eb567f6e8121fdde35d.tar.gz
otp-6c9ff9812608c1c893c50eb567f6e8121fdde35d.tar.bz2
otp-6c9ff9812608c1c893c50eb567f6e8121fdde35d.zip
Extend cover.erl source search
Commit 29231033 made cover fall back to compile info if source was not found in pwd or ../src. This isn't sufficient for source that lies in subdirectories of ../src when beams and source have been moved since compilation (eg. install of some OTP applications), so first try finding source relative to the beam directory. For example, given a beam path /installed/path/to/app-1.0/ebin/root.beam and a source path /compiled/path/to/app/src/subdir/root.erl then look for /installed/path/to/app-1.0/ebin/../src/subdir/root.erl before the source path.
Diffstat (limited to 'lib/tools/doc')
-rw-r--r--lib/tools/doc/src/cover.xml9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/tools/doc/src/cover.xml b/lib/tools/doc/src/cover.xml
index 477871d6c3..beefd4ee8d 100644
--- a/lib/tools/doc/src/cover.xml
+++ b/lib/tools/doc/src/cover.xml
@@ -316,8 +316,13 @@
<c>compile_beam_directory/0,1</c>, it is assumed that the
source code can be found in the same directory as the
<c>.beam</c> file, in <c>../src</c> relative to that
- directory, or at the source path in
- <c>Module:module_info(compile)</c>. If no source code is found,
+ directory, or using the source path in
+ <c>Module:module_info(compile)</c>. When using the latter,
+ two paths are examined: first the one constructed by
+ joining <c>../src</c> and the tail of the compiled path
+ below a trailing <c>src</c> component, then the compiled
+ path itself.
+ If no source code is found,
<c>{error,no_source_code_found}</c> is returned.</p>
<p>HINT: It is possible to issue multiple analyse_to_file commands at
the same time. </p>