test-runner

Run Rust unit, integration, and doc tests with cargo test.

11|Updated Nov 5, 2025
One-click install
npx skills add https://github.com/d-o-hub/rust-self-learning-memory --skill test-runner-d-o-hub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-runner
Source: https://github.com/d-o-hub/rust-self-learning-memory/tree/main/.claude/skills/test-runner
Command: npx skills add https://github.com/d-o-hub/rust-self-learning-memory --skill test-runner-d-o-hub

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive guide to executing unit, integration, and doc tests for Rust projects, with troubleshooting workflows and structured test organization.

Core Features & Use Cases

  • Test categorization: unit, integration, and doc tests with targeted commands.
  • Execution strategy: quick checks, full suite, and selective runs.
  • Troubleshooting: identify failures, isolate tests, and resolve common patterns.

Quick Start

Run unit tests with cargo test --lib, then run integration tests cargo test --test '*' and finally cargo test --doc for documentation tests.

Frequently Asked Questions about test-runner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run unit, integration, and doc tests in Rust?

Rust testing runs three test types via cargo: unit tests with `cargo test --lib`, integration tests with `cargo test --test '*'`, and documentation tests with `cargo test --doc`. Each targets different test files and validates distinct aspects of your crate.

What's the best way to organize and execute targeted Rust tests?

Organize tests by type—unit tests in src files, integration tests in tests/ directory, doc tests in code comments—then run selectively using `cargo test --lib`, `cargo test --test`, or `cargo test --doc` to isolate failures and speed up local feedback loops.

Can I run Rust tests in CI pipelines with cargo?

Yes, cargo test supports CI automation with flags like `--nocapture` for output visibility, release-mode builds for performance testing, and environment-variable configuration to ensure reproducible results across local and pipeline environments.

How do I troubleshoot failing Rust tests?

Isolate failures by running specific test modules or single tests, use `--nocapture` to see println output, check for environment-variable dependencies, and run full suites with `--all` to distinguish module-level from integration issues.

Does cargo test work for documentation tests in Rust?

Yes, `cargo test --doc` executes code examples in documentation comments and doc attributes, validating that API documentation examples compile and run correctly as part of your test suite.