Skip to content

Implement LCOV format reporting#70

Open
amartani wants to merge 3 commits intoplasma-umass:mainfrom
amartani:lcov-report
Open

Implement LCOV format reporting#70
amartani wants to merge 3 commits intoplasma-umass:mainfrom
amartani:lcov-report

Conversation

@amartani
Copy link

@amartani amartani commented Nov 9, 2025

Implements generating coverage reporting in LCOV format, controlled by the flag --lcov.

Changes:

  • Added lcovreport.py module with LcovReporter class for generating LCOV format output
  • Integrated LCOV reporting into slipcover.py with print_lcov() function
  • Added --lcov command-line flag to __main__.py for selecting LCOV output
  • Added --lcov-test-name and --lcov-comment, common in other LCOV tools
  • Added tests for LCOV reporting (with and without branches)

The LCOV format includes:

  • TN: Test name (optional)
  • SF: Source file path
  • BRDA: Branch coverage data (when --branch is used)
  • BRF/BRH: Branch statistics
  • DA: Line coverage data
  • LF/LH: Line statistics
  • end_of_record marker

Usage examples:

  python -m slipcover --lcov --out coverage.lcov script.py
  python -m slipcover --branch --lcov --out coverage.lcov script.py

Implements generating coverage reporting in LCOV format, controlled by the flag `--lcov`.

Changes:
- Added lcovreport.py module with LcovReporter class for generating LCOV format output
- Integrated LCOV reporting into slipcover.py with print_lcov() function
- Added --lcov command-line flag to __main__.py for selecting LCOV output
- Added --lcov-test-name and --lcov-comment, common in other LCOV tools
- Exported print_lcov in __init__.py to make it accessible
- Added tests for LCOV reporting (with and without branches)

The LCOV format includes:
- TN: Test name (optional)
- SF: Source file path
- BRDA: Branch coverage data (when --branch is used)
- BRF/BRH: Branch statistics
- DA: Line coverage data
- LF/LH: Line statistics
- end_of_record marker

Usage examples:
  python -m slipcover --lcov --out coverage.lcov script.py
  python -m slipcover --branch --lcov --out coverage.lcov script.py
@amartani amartani marked this pull request as ready for review November 9, 2025 05:16
@emeryberger emeryberger requested a review from Copilot January 14, 2026 18:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements LCOV format coverage reporting for slipcover, enabling output compatible with tools that consume LCOV format. The implementation adds a new LcovReporter class and integrates it into the CLI with --lcov flag support, along with optional test name and comment features.

Changes:

  • Added LCOV format reporting with line and branch coverage support
  • Integrated LCOV output option into CLI with --lcov, --lcov-test-name, and --lcov-comment flags
  • Added comprehensive test coverage for LCOV functionality including branches, test names, and comments

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/slipcover/lcovreport.py New module implementing LCOV format reporter with line and branch coverage
src/slipcover/slipcover.py Added print_lcov() function to expose LCOV reporting API
src/slipcover/main.py Integrated LCOV CLI flags and output handling in both merge and normal execution modes
src/slipcover/init.py Exported print_lcov in public API
tests/test_coverage.py Added test suite for LCOV reporting covering various scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@amartani
Copy link
Author

@emeryberger addressed Copilot's findings and merged updated main. ptal! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments