# Report Formats

- Section: Documentation > Guides > Report Formats
- Canonical: https://covdbg.com/docs/guides/report-formats/

---

covdbg stores coverage results in a `.covdb` database file. You can export coverage to industry-standard formats, or to a static HTML report, using the `convert` command.

## Coverage Database

`.covdb` is covdbg's native format - a SQLite-based database containing detailed coverage information.

### When to Use

- Primary storage for coverage results
- Input for the `merge` command
- Input for the `convert` command

### Creating a `.covdb`

```powershell
# Run coverage and save results
covdbg --output "results.covdb" "tests.exe"
```

---

## LCOV Format

LCOV is a widely-supported text-based format used by many CI/CD systems and coverage viewers.

### When to Use

- Uploading to Codecov, Coveralls, or similar services
- Integration with CI/CD pipelines
- Viewing in LCOV-compatible tools
- Text-based reports that can be diffed

### File Structure

LCOV files contain:
- Source file information (`SF:`)
- Function coverage (`FN:`, `FNDA:`, `FNF:`, `FNH:`)
- Line coverage (`DA:`, `LF:`, `LH:`)
- Branch coverage (if available)

### Converting to LCOV

```powershell
covdbg convert --input "results.covdb" --format LCOV --output "coverage.lcov"
```

### Short Form

```powershell
covdbg convert -i results.covdb -f LCOV -o coverage.lcov
```

### Example Output

```
TN:
SF:C:\project\src\main.cpp
FN:10,main
FNDA:1,main
FNF:1
FNH:1
DA:10,1
DA:11,1
DA:12,1
DA:15,0
LF:4
LH:3
end_of_record
```

---

## GCOV Format

GCOV export produces one `.gcov` file per source file, compatible with GCC's coverage format.

### When to Use

- Integration with tools expecting GCOV format
- Detailed per-file coverage reports
- When you need individual file coverage data

### File Naming

For each source file `foo.cpp`, covdbg creates `foo.cpp.gcov` in the output directory.

### Converting to GCOV

```powershell
# Create output directory first
New-Item -ItemType Directory -Force -Path "gcov-output"

# Convert
covdbg convert --input "results.covdb" --format GCOV --output "gcov-output\"
```

### Short Form

```powershell
mkdir gcov-output
covdbg convert -i results.covdb -f GCOV -o gcov-output\
```

### Example Output

```
        -:    0:Source:C:\project\src\main.cpp
        -:    0:Programs:1
        1:   10:int main() {
        1:   11:    int x = 0;
        1:   12:    x++;
    #####:   15:    unreached_code();
```

Format:
- `count:line:source` where count is execution times
- `-` means non-executable line
- `#####` means never executed

---

## HTML Reports

The exporter produces a static report directory with line and function totals, file filtering, and source pages with execution counts and uncovered-line navigation:

```powershell
covdbg convert --input results.covdb --format HTML --output coverage-html
```

Open `coverage-html/index.html` directly in a browser, or share the entire output directory. Reports include source text read at export time, so use the matching source revision and the same access controls as your source code.

### Short Form

```powershell
covdbg convert -i results.covdb -f HTML -o coverage-html
```

See [HTML Reports](/docs/guides/html-reports/) for export options, source relocation, and publishing details.

---

## Format Comparison

| Feature | `.covdb` | LCOV | GCOV | HTML |
|---------|----------|------|------|------|
| File type | Binary (SQLite) | Text | Text | Static web pages |
| Multiple files | Single file | Single file | Multiple files | Directory |
| Mergeable | Yes (`merge`) | Via external tools | Via external tools | Merge databases before export |
| Function coverage | Yes | Yes | Limited | Yes |
| Line coverage | Yes | Yes | Yes | Yes |
| Hit counts | Yes | Yes | Yes | Yes |
| Source text | No | No | Yes | Yes |
| CI integration | Custom | Excellent | Good | Publish as an artifact or static site |

---

## Workflow Examples

### CI Pipeline with Codecov

```powershell
# Run tests with coverage
covdbg --output coverage.covdb tests.exe

# Export to LCOV for Codecov
covdbg convert -i coverage.covdb -f LCOV -o coverage.lcov

# Upload (example with Codecov CLI)
codecov --file coverage.lcov
```

### Merge Multiple Test Runs

```powershell
# Run different test suites
covdbg --output unit.covdb unit_tests.exe
covdbg --output integration.covdb integration_tests.exe

# Merge results
covdbg merge -i unit.covdb -i integration.covdb -o merged.covdb

# Export merged coverage
covdbg convert -i merged.covdb -f LCOV -o coverage.lcov
```

---

## See Also

* [CLI Reference](/docs/reference/cli-reference/) - Command documentation
* [GitHub Actions](/docs/integrations/github-actions/) - CI integration
* [HTML Reports](/docs/guides/html-reports/) - Static browser reports
