Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ coverage-lcov:
@lcov $(COVERAGE_LCOV_OPTIONS) --capture \
--directory $(abs_builddir) \
--base-directory $(realpath $(abs_builddir)) \
--path $(realpath $(abs_srcdir)) \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this argument was needed before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--path was added in 2013 (commit 49e52f9) with --base-directory, but the commit message doesn't explain its specific purpose but further it was changed, and now means "Strip PATH from tracefile when applying diff"

(.venv) aniket@DESKTOP-074O80J:/mnt/d/cpython/cpython$ lcov --help | grep path
  -b, --base-directory DIR        Use DIR as base directory for relative paths
      --path PATH                 Strip PATH from tracefile when applying diff
      --list-full-path            Print full path during a list operation

--ignore-errors negative \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

geninfo: ERROR: Unexpected negative count '-1' for branch 1 of /mnt/d/cpython/cpython/Modules/getpath.c:944.
        Perhaps you need to compile with '-fprofile-update=atomic
        (use "geninfo --ignore-errors negative ..." to bypass this error)
make: *** [Makefile:1070: coverage-lcov] Error 1

i added after getting error ..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, but it looks off, as in diff it looks like --ignore-errors negative \ is added as replacement, should add this below one line, Do you have any suggestion for me ? thanks

--output-file $(COVERAGE_INFO)
@ # remove 3rd party modules, system headers and internal files with
@ # debug, test or dummy functions.
Expand All @@ -931,8 +931,13 @@ coverage-lcov:
'/usr/include/*' \
'/usr/local/include/*' \
'/usr/lib/gcc/*' \
--ignore-errors inconsistent \
--ignore-errors negative \
--ignore-errors unused \
--output-file $(COVERAGE_INFO)
@genhtml $(COVERAGE_INFO) \
--ignore-errors inconsistent \
--ignore-errors negative \
--output-directory $(COVERAGE_REPORT) \
$(COVERAGE_REPORT_OPTIONS)
@echo
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ``make coverage-lcov`` to work with lcov v2.x. Remove the ``--path`` option which was repurposed in lcov v2, and add ``--ignore-errors negative,inconsistent,unused`` flags to handle stricter validation introduced in lcov v2.
Loading