Effective coverage reads function totals as line totals when the LLVM report has no branches

未關閉 適合新手
#95 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 2 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
78/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python, rust
領域
testing-qa

研究方向

從 effective_coverage.parse_index_page_totals 開始,使用 issue 中 html_report/index.html 的合成列重現問題。檢查它如何選取總數,以及如何處理 branch 儲存格 - (0/0)。重現時回傳 lines (1, 4) 和 branches (0, 0),讓有效行涵蓋率使用行總數,即表示完成。

由索引模型根據 Issue 內容生成。

描述

bug

Found while reviewing the user manual against the implementation at fe013fe. Reproduced by calling effective_coverage.parse_index_page_totals on a synthetic index page.

The effective-coverage path reads the totals from the LLVM HTML index page by taking the last three matches of NN.NN% (covered/total) in the page and treating them as function, line and branch totals. When the report contains no branches, llvm-cov renders the branch total as - (0/0), which does not match. The last three matches are then shifted by one cell: the function totals are read as line totals and the line totals as branch totals.

Reproduction

html_report/index.html whose only rows are

<tr><td>a.rs</td><td>100.00% (1/1)</td><td>25.00% (1/4)</td><td>- (0/0)</td></tr>
<tr><td>Totals</td><td>100.00% (1/1)</td><td>25.00% (1/4)</td><td>- (0/0)</td></tr>

parse_index_page_totals returns {'lines': (1, 1), 'branches': (1, 4)}. Expected: {'lines': (1, 4), 'branches': (0, 0)}.

Effect

With --yaml, a report without branch data is gated on the function coverage instead of the line coverage. In the example the effective line coverage is 100 % although 1 of 4 lines is covered. A Rust-only scope built without -Zcoverage-options=branch has no branch data.

Expected behavior

Read the totals from the Totals row by column, and accept - (0/0) as zero branches.

主要語言
Python
星號
0
分支
4
平均合併
1 天 16 小時
30 天內合併 PR
16

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

eclipse-score/coverage_tool 的其他 Issue

查看 eclipse-score/coverage_tool 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。