-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
genhtml (2.0) dies with source files in top directory #245
Comments
better if you could attach a testcase. |
This was on macOS 14.1 (Sonoma) using Apple's version of LLVM 15 as cc, but should translate well to Linux. (I reproduced my original case, which uses Meson as a build system, in a Kali Linux VM because that was what had lcov 2.0).
Meson automatically adds --prefix, so it is not easy for my original case to remove it. Without --prefix in the test case above, it finds the parent directory as the prefix:
|
Thanks. In any event: I seem to have a fix which I will push along with some other changes/enhancements - once local tests are complete and things seem to have stabilized. Henry |
My actual case is almost that simple -- I have multiple source files, but all were in the top-level directory. (I have since restructured it to have subdirectories, to clarify library vs executable code.) I am happy to test your fix on my original test case once you think it is worth sharing. Thank you for the quick responses. |
files. See #245 Signed-off-by: Henry Cox <henry.cox@mediatek.com>
should be fixed in the above commit: bf135ca |
Closing this issue as I think that it is fixed. |
Hack for linux-test-project/lcov#245. I tried to backport linux-test-project/lcov@bf135ca but had no luck (worked in one container but didn'y apply in another, whatever). This fixes the coverage unittests. >=lcov-2.1-beta works fine. The beta has landed in a beta version of Ubuntu too. Bug: linux-test-project/lcov#245
When there is a source file in the top-level directory of a project (one of the directories passed with --prefix), the
die("file error for " ...)
call gets triggered: @$short_path has only one element, so nothing gets passed toFile::Spec->catdir()
and$rel_dir
is empty.Adding
unshift @$short_path, '.' if $#$short_path == 0;
before the call tocatdir()
avoids the crash but generates an HTML coverage report with no way to access the source files because the top-level directory has a zero-length (or no?) hyperlink to the per-directory report file.With lcov 1.16, this would give the name "root" to the top-level directory.
The text was updated successfully, but these errors were encountered: