From 6c9ff9812608c1c893c50eb567f6e8121fdde35d Mon Sep 17 00:00:00 2001
From: Anders Svensson
Date: Sun, 17 Feb 2013 19:35:40 +0100
Subject: 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.
---
lib/tools/doc/src/cover.xml | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
(limited to 'lib/tools/doc')
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 @@
compile_beam_directory/0,1, it is assumed that the
source code can be found in the same directory as the
.beam file, in ../src relative to that
- directory, or at the source path in
- Module:module_info(compile). If no source code is found,
+ directory, or using the source path in
+ Module:module_info(compile). When using the latter,
+ two paths are examined: first the one constructed by
+ joining ../src and the tail of the compiled path
+ below a trailing src component, then the compiled
+ path itself.
+ If no source code is found,
{error,no_source_code_found} is returned.
HINT: It is possible to issue multiple analyse_to_file commands at
the same time.
--
cgit v1.2.3