tdd-guard-rust

Crates.iotdd-guard-rust
lib.rstdd-guard-rust
version0.1.0
created_at2025-08-29 19:19:49.687135+00
updated_at2025-08-29 19:19:49.687135+00
descriptionRust test reporter for TDD Guard validation
homepagehttps://github.com/nizos/tdd-guard
repositoryhttps://github.com/nizos/tdd-guard
max_upload_size
id1816422
size62,428
Nizar Selander (nizos)

documentation

https://github.com/nizos/tdd-guard/tree/main/reporters/rust

README

TDD Guard Rust Reporter

Rust test reporter that captures test results for TDD Guard validation.

Note: This reporter is part of the TDD Guard project, which ensures Claude Code follows Test-Driven Development principles.

Requirements

  • Rust 1.70+
  • TDD Guard installed globally
  • cargo-nextest (recommended) or cargo test with JSON output support

Installation

Step 1: Install TDD Guard

npm install -g tdd-guard

Step 2: Install the Rust reporter

cargo install tdd-guard-rust

Usage

The reporter works as a filter that processes test output while passing it through unchanged.

With cargo-nextest (Recommended)

cargo nextest run 2>&1 | tdd-guard-rust --project-root /absolute/path/to/project

With cargo test

cargo test -- -Z unstable-options --format json 2>&1 | tdd-guard-rust --project-root /absolute/path/to/project

Direct Execution

The reporter can also execute tests directly:

# Auto-detect runner (prefers nextest)
tdd-guard-rust --project-root /absolute/path/to/project

# Force specific runner
tdd-guard-rust --project-root /absolute/path/to/project --runner nextest
tdd-guard-rust --project-root /absolute/path/to/project --runner cargo

Makefile Integration

Add to your Makefile:

.PHONY: test
test:
	cargo nextest run 2>&1 | tdd-guard-rust --project-root $(PWD) --passthrough

.PHONY: test-tdd
test-tdd:
	tdd-guard on && $(MAKE) test

Configuration

Project Root

The --project-root flag must be an absolute path to your project directory. This is where the .claude/tdd-guard/data/test.json file will be written.

Flags

  • --passthrough: Force passthrough mode even if stdin is a terminal
  • --runner [auto|nextest|cargo]: Choose test runner for direct execution (default: auto)
  • --project-root: Absolute path to project directory (required)

How It Works

The reporter captures JSON-formatted test output, passes it through unchanged to stdout, and saves TDD Guard-formatted results to .claude/tdd-guard/data/test.json.

License

MIT - See LICENSE file in the repository root.

Commit count: 469

cargo fmt