python / python/cpython

"make coverage-lcov" doesn't work with lcov v2.x

オープン
#151,001 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

build type-bug
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Bug report

Bug description:

The Python Developer’s Guide says:

In order to create a HTML report you can install lcov.

Unfortunately, this doesn't work with a modern version of the lcov: e.g. first I got error about missing --path option. It "works for me" (with some warnings) on the patch:

diff --git a/Makefile.pre.in b/Makefile.pre.in
index 2b34b009fd7..20b895d488a 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -917,7 +917,6 @@ coverage-lcov:
        @lcov $(COVERAGE_LCOV_OPTIONS) --capture \
            --directory $(abs_builddir) \
            --base-directory $(realpath $(abs_builddir)) \
-           --path $(realpath $(abs_srcdir)) \
            --output-file $(COVERAGE_INFO)
        @ # remove 3rd party modules, system headers and internal files with
        @ # debug, test or dummy functions.
@@ -931,8 +930,11 @@ coverage-lcov:
            '/usr/include/*' \
            '/usr/local/include/*' \
            '/usr/lib/gcc/*' \
+               --ignore-errors inconsistent \
+               --ignore-errors unused \
            --output-file $(COVERAGE_INFO)
        @genhtml $(COVERAGE_INFO) \
+               --ignore-errors inconsistent \
            --output-directory $(COVERAGE_REPORT) \
            $(COVERAGE_REPORT_OPTIONS)
        @echo
CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs
  • gh-151008

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Makefile.pre.in の coverage-lcov ターゲットから始め、レポートに示されている lcov と genhtml のコマンドを確認します。lcov 2.x で make coverage-lcov を実行し、報告されているオプションエラーと整合性エラーなしに、カバレッジデータと HTML レポートが生成されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
build-system, testing-qa
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。