### covdbg CLI: Run Mode Example Source: https://context7_llms Demonstrates basic usage of the covdbg CLI to run an executable under coverage tracking. Shows how to specify configuration, output file, and pass arguments to the target program. ```powershell # Basic usage covdbg --config .covdbg.yaml --output results.covdb tests.exe # Pass arguments to target covdbg -c .covdbg.yaml -o results.covdb tests.exe --gtest_filter="MyTest.*" # Open source (auto license) covdbg --fetch-license -c .covdbg.yaml -o results.covdb tests.exe ``` -------------------------------- ### GitHub Actions: Complete Coverage Workflow Source: https://context7_llms This YAML workflow demonstrates a complete GitHub Actions setup for running code coverage. It includes checking out code, setting up covdbg, building the project, running coverage, converting the output to LCOV format, and uploading to Codecov. ```yaml name: Coverage on: [push, pull_request] jobs: coverage: runs-on: windows-latest steps: - uses: actions/checkout@v4 - name: Setup covdbg uses: covdbg/setup-covdbg@v0 with: version: '1.0.0' - name: Build run: | cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake --build build - name: Run Coverage shell: pwsh env: COVDBG_APPDATA: .covdbg COVDBG_FETCH_LICENSE: true # Open source # Or for commercial: COVDBG_LICENSE: ${{ secrets.COVDBG_LICENSE }} run: | covdbg --config .covdbg.yaml --output tests.covdb build/tests.exe - name: Convert to LCOV run: covdbg convert -i tests.covdb -f LCOV -o coverage.lcov - name: Upload to Codecov uses: codecov/codecov-action@v5 with: files: coverage.lcov env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} ``` -------------------------------- ### GitHub Actions: Commercial Coverage Source: https://context7_llms This snippet demonstrates how to configure a GitHub Actions step for running coverage in commercial projects. It requires setting the `COVDBG_LICENSE` environment variable with a valid license token. ```yaml - name: Run Coverage env: COVDBG_LICENSE: ${{ secrets.COVDBG_LICENSE }} run: covdbg --config .covdbg.yaml -o coverage.covdb tests.exe ``` -------------------------------- ### GitHub Actions: Open Source Coverage Source: https://context7_llms This snippet shows how to configure a GitHub Actions step for running coverage in open-source projects. It utilizes `COVDBG_FETCH_LICENSE: true` to automatically fetch the necessary license. ```yaml - name: Run Coverage env: COVDBG_FETCH_LICENSE: true run: covdbg --config .covdbg.yaml -o coverage.covdb tests.exe ``` -------------------------------- ### Run Coverage with Covdbg CLI Source: https://context7_llms Executes code coverage analysis using the covdbg CLI. Requires a configuration file and specifies the output database file and the executable to test. Supports silent and debug logging modes, and fetching open-source licenses. ```bash covdbg -c .covdbg.yaml -o out.covdb tests.exe covdbg --log-level NONE -c .covdbg.yaml -o out.covdb tests.exe covdbg --log-level DEBUG -c .covdbg.yaml -o out.covdb tests.exe covdbg --fetch-license -c .covdbg.yaml -o out.covdb tests.exe ``` -------------------------------- ### Codecov Integration: Basic Usage Source: https://context7_llms This YAML snippet outlines the basic steps for integrating Covdbg with Codecov. It covers running tests with coverage, converting the output to LCOV format, and uploading the results to Codecov. ```yaml # 1. Run tests with coverage - name: Run tests run: covdbg -c .covdbg.yaml -o coverage.covdb tests.exe # 2. Convert to LCOV - name: Convert run: covdbg convert -i coverage.covdb -f LCOV -o coverage.lcov # 3. Upload - name: Upload to Codecov uses: codecov/codecov-action@v5 with: files: coverage.lcov env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} ``` -------------------------------- ### Run C/C++ Application with covdbg Coverage Source: https://context7_llms Executes a specified program while collecting line-level code coverage. Requires a configuration file and specifies an output file for the coverage database (.covdb). Supports environment variables for license and configuration. ```powershell # Set license (commercial) or use --fetch-license (open source) $env:COVDBG_LICENSE = "" # Run tests with coverage covdbg --config .covdbg.yaml --output coverage.covdb tests.exe # Export to LCOV covdbg convert -i coverage.covdb -f LCOV -o coverage.lcov ``` -------------------------------- ### Common Workflow: Multiple Test Suites (PowerShell) Source: https://context7_llms This PowerShell script illustrates a workflow for handling multiple test suites. It generates separate coverage reports for unit and integration tests, merges them, and then converts the merged report to LCOV format. ```powershell covdbg -c .covdbg.yaml -o unit.covdb unit_tests.exe covdbg -c .covdbg.yaml -o integration.covdb integration_tests.exe covdbg merge -i unit.covdb -i integration.covdb -o merged.covdb covdbg convert -i merged.covdb -f LCOV -o coverage.lcov ``` -------------------------------- ### Merge and Analyze with Covdbg CLI Source: https://context7_llms Merges multiple Covdbg database files into a single database or analyzes a binary to generate a database with symbol information. ```bash covdbg merge -i a.covdb -i b.covdb -o merged.covdb covdbg analyze -i app.exe -o symbols.covdb ``` -------------------------------- ### Common Workflow: Single Test Suite (PowerShell) Source: https://context7_llms This PowerShell script demonstrates a common workflow for generating a coverage report from a single test suite. It runs covdbg to collect coverage data and then converts it to LCOV format. ```powershell covdbg -c .covdbg.yaml -o coverage.covdb tests.exe covdbg convert -i coverage.covdb -f LCOV -o coverage.lcov ``` -------------------------------- ### Common Workflow: Complete Coverage Report (PowerShell) Source: https://context7_llms This PowerShell script generates a complete coverage report, including unexecuted code. It runs tests, analyzes binaries to capture all coverable lines, merges the results, and exports to LCOV format. ```powershell # Run tests covdbg -c .covdbg.yaml -o tests.covdb tests.exe # Analyze all code (captures functions never called) covdbg analyze -i app.exe -o symbols.covdb -c .covdbg.yaml # Merge for complete picture covdbg merge -i tests.covdb -i symbols.covdb -o complete.covdb # Export covdbg convert -i complete.covdb -f LCOV -o coverage.lcov ``` -------------------------------- ### Export Coverage Data with Covdbg CLI Source: https://context7_llms Converts coverage data from a Covdbg database file to LCOV or GCOV format. Specifies the input database, output format, and output file or directory. ```bash covdbg convert -i out.covdb -f LCOV -o coverage.lcov covdbg convert -i out.covdb -f GCOV -o ./gcov/ ``` -------------------------------- ### Merge Multiple covdbg Coverage Databases Source: https://context7_llms Combines multiple .covdb files into a single database. This is useful for aggregating coverage results from different test suites or execution runs. ```powershell covdbg merge -i unit.covdb -i integration.covdb -o merged.covdb ``` -------------------------------- ### Analyze Binaries for Coverable Lines with covdbg Source: https://context7_llms Extracts information about coverable lines from executable binaries using debug symbols (PDB files) without actually running the program. This can be used to identify uncovered code sections. ```powershell # Analyze for uncovered code covdbg analyze -i app.exe -o app-symbols.covdb -c .covdbg.yaml # Merge with test coverage for complete picture covdbg merge -i app-symbols.covdb -i tests.covdb -o complete.covdb ``` -------------------------------- ### Configure covdbg Coverage Filtering Source: https://context7_llms Defines source file inclusion and exclusion patterns for code coverage collection. Uses YAML format with glob-style wildcards. Supports recursive matching with '**'. Exclude patterns take precedence over include patterns. ```yaml version: 1 source_root: "." coverage: default: files: include: - "src/**/*.cpp" - "src/**/*.h" exclude: - "build/**" - "third_party/**" ``` -------------------------------- ### Codecov Integration: Advanced Usage (Include Uncovered Code) Source: https://context7_llms This YAML snippet shows advanced Codecov integration to include uncovered code paths in the coverage report. It involves running tests, analyzing binaries, merging coverage data, and then converting and uploading. ```yaml # 1. Run tests - run: covdbg -c .covdbg.yaml -o tests.covdb tests.exe # 2. Analyze binaries for all coverable lines - run: | covdbg analyze -i app.exe -o app.covdb -c .covdbg.yaml covdbg analyze -i lib.dll -o lib.covdb -c .covdbg.yaml # 3. Merge coverage with symbols - run: covdbg merge -i tests.covdb -i app.covdb -i lib.covdb -o merged.covdb # 4. Convert and upload - run: covdbg convert -i merged.covdb -f LCOV -o coverage.lcov - uses: codecov/codecov-action@v5 with: files: coverage.lcov env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} ``` -------------------------------- ### Export covdbg Coverage Data Source: https://context7_llms Converts collected coverage data from the .covdb format into standard LCOV or GCOV formats. LCOV is suitable for CI services like Codecov, while GCOV generates detailed per-file coverage reports. ```powershell # Export to LCOV covdbg convert -i results.covdb -f LCOV -o coverage.lcov # Export to GCOV mkdir gcov-output covdbg convert -i results.covdb -f GCOV -o gcov-output\ ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.