Skip to content

Input Formats

trep auto-detects the input format from the file extension and content. Pass --format (for trep cov) or --format-test / --format-cov (for trep report) to override.


Test result formats

JUnit XML / Google Test XML

Format value: junit (aliases: ctest, gtest, maven, xml)

The standard <testsuites> / <testsuite> / <testcase> schema. Both JUnit and Google Test XML share the same parser — Google Test adds file and line attributes to <testcase> elements, which trep preserves and renders as clickable source links.

Compatible with: JUnit 4/5, Maven Surefire, pytest-junit, NUnit, xUnit, CTest, Google Test.

CTest's synthetic SKIP_REGULAR_EXPRESSION_MATCHED skip messages are automatically replaced with the human-readable reason extracted from <system-out>.

Example:

<testsuites>
  <testsuite name="CoreTests" tests="3" failures="1" time="0.042">
    <testcase name="TestAdd" classname="CoreTests" time="0.010"/>
    <testcase name="TestDiv" classname="CoreTests" time="0.005">
      <failure message="expected 5, got 4">core_test.cpp:30</failure>
    </testcase>
    <testcase name="TestSkipped" classname="CoreTests" time="0.000">
      <skipped/>
    </testcase>
  </testsuite>
</testsuites>


go test -json

Format value: gotest (aliases: go, json)

Produced by go test -json ./.... The parser processes the streaming event log, accumulates per-test output, and extracts meaningful failure messages while stripping boilerplate === RUN / --- FAIL header lines.

Typical usage:

go test -json ./... > test-results.json
trep test test-results.json

Or pipe directly:

go test -json ./... | trep test -


TAP (Test Anything Protocol) v12/13

Format value: tap

Line-oriented ok / not ok records.

Supports:

  • Optional # time=N.NNN annotations (accumulated into report duration)
  • # SKIP <reason> pragmas
  • TAP 13 embedded YAML diagnostic blocks (skipped cleanly)

Example:

TAP version 13
1..3
ok 1 - TestAdd # time=0.010
not ok 2 - TestDiv
  ---
  message: 'expected 5, got 4'
  ...
ok 3 - TestSkipped # SKIP not implemented yet


Coverage formats

LCOV

Format value: lcov

Generated by gcov, Istanbul/NYC, and many other tools. Both coverage.info and lcov.info extensions are auto-detected.

# Generate with gcov
lcov --capture --directory . --output-file coverage.info
trep cov coverage.info

Go coverprofile

Format value: gocover

Generated by go test -coverprofile=coverage.out ./.... The .out and .coverprofile extensions are auto-detected.

go test -coverprofile=coverage.out ./...
trep cov coverage.out

Cobertura

Format value: cobertura

XML format used by Cobertura, JaCoCo (with the Cobertura plugin), and many CI tools. Auto-detected from the XML content.

trep cov coverage.xml

Clover

Format value: clover

XML format used by PHPUnit, Atlassian Clover, and others.

trep cov clover.xml

Format auto-detection

Auto-detection checks the file extension first, then inspects the content:

Extension Detected as
.xml JUnit XML (test) or Cobertura/Clover (coverage) — content sniffed
.json go test -json
.tap TAP
.out, .coverprofile Go coverprofile
.info, .lcov LCOV
- (stdin) go test -json