< Summary - Neospec Coverage

Information
Line coverage
100%
Covered lines: 23
Uncovered lines: 0
Coverable lines: 23
Total lines: 47
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Write0%00100%

File(s)

/home/runner/work/neospec/neospec/internal/adapters/reporter/lcov.go

#LineLine coverage
 1package reporter
 2
 3import (
 4  "context"
 5  "fmt"
 6  "io"
 7  "sort"
 8
 9  "github.com/jedi-knights/neospec/internal/domain"
 10)
 11
 12// LCOV writes coverage data in LCOV tracefile format.
 13// See https://ltp.sourceforge.net/coverage/lcov/geninfo.1.php for the format.
 14// Test result data is not included in LCOV output — it is a coverage-only format.
 15type LCOV struct{}
 16
 17// NewLCOV creates an LCOV reporter.
 18func NewLCOV() *LCOV { return &LCOV{} }
 19
 320func (l *LCOV) Write(_ context.Context, w io.Writer, _ *domain.SuiteResult, cov *domain.CoverageData) error {
 121  if cov == nil {
 122    return nil
 123  }
 24
 225  for _, file := range cov.Files {
 326    // TN: test name (empty is valid)
 327    fmt.Fprintln(w, "TN:")
 328    fmt.Fprintf(w, "SF:%s\n", file.Path)
 329
 330    // Collect and sort line numbers for deterministic output.
 331    lines := make([]int, 0, len(file.Lines))
 332    for ln := range file.Lines {
 533      lines = append(lines, ln)
 534    }
 335    sort.Ints(lines)
 336
 337    for _, ln := range lines {
 538      fmt.Fprintf(w, "DA:%d,%d\n", ln, file.Lines[ln])
 539    }
 40
 341    fmt.Fprintf(w, "LH:%d\n", file.HitLines())
 342    fmt.Fprintf(w, "LF:%d\n", file.TotalLines())
 343    fmt.Fprintln(w, "end_of_record")
 44  }
 45
 246  return nil
 47}

Methods/Properties

Write