# How to Run Tests for the Brush Project: A Complete Guide

> Learn how to run tests for the Brush project with this complete guide. Execute the full test suite efficiently using the recommended cargo command.

- Repository: [Arthur Brussee/brush](https://github.com/ArthurBrussee/brush)
- Tags: how-to-guide
- Published: 2026-05-14

---

**Run `cargo test --all --all-features`** from the repository root to execute the complete test suite for the Brush project, matching the command used in the CI workflow defined in [`.github/workflows/ci.yml`](https://github.com/ArthurBrussee/brush/blob/main/.github/workflows/ci.yml).

The Brush project (ArthurBrussee/brush) is a Rust-based 3D Gaussian splatting tool organized as a Cargo workspace. Whether you are contributing new features or verifying local changes, knowing how to run tests for the Brush project ensures code quality across all workspace crates.

## Prerequisites

Before executing any tests, ensure you have **Rust** installed (version **≥ 1.88** as required by the codebase). Clone the repository and navigate to the root directory:

```bash
git clone https://github.com/ArthurBrussee/brush.git
cd brush

```

## Running the Full Test Suite

To validate the entire workspace as the CI does, use the **all-features** flag. According to the test workflow in [`.github/workflows/ci.yml`](https://github.com/ArthurBrussee/brush/blob/main/.github/workflows/ci.yml), the official command is:

```bash
cargo test --all --all-features

```

This command builds every crate defined in the workspace [`Cargo.toml`](https://github.com/ArthurBrussee/brush/blob/main/Cargo.toml) and executes both unit and integration tests while enabling all optional feature flags.

## Testing Specific Components

For targeted validation, you can isolate test execution to specific crates or documentation examples.

### Running Documentation Tests

To verify code examples embedded in the Rust documentation, append the **`--doc`** flag:

```bash
cargo test --all --all-features --doc

```

This ensures that examples in doc comments remain accurate and compile correctly.

### Testing Individual Crates

When working on a specific module like `brush-loss`, run tests for only that crate using the **`-p`** flag:

```bash
cargo test -p brush-loss --all-features

```

Replace `brush-loss` with any workspace member (e.g., `brush-bench-test`) as defined in the root [`Cargo.toml`](https://github.com/ArthurBrussee/brush/blob/main/Cargo.toml). Individual test files like [`crates/brush-loss/tests/reference.rs`](https://github.com/ArthurBrussee/brush/blob/main/crates/brush-loss/tests/reference.rs) contain the actual test implementations executed by this command.

## Understanding the Test Configuration

The repository’s testing logic is governed by two key files:

- **[`.github/workflows/ci.yml`](https://github.com/ArthurBrussee/brush/blob/main/.github/workflows/ci.yml)**: Defines the macOS CI runner steps that execute `cargo test --all --all-features` and doc tests.
- **[`Cargo.toml`](https://github.com/ArthurBrussee/brush/blob/main/Cargo.toml)**: Located at the workspace root, this file declares all member crates that `--all` includes in the test run.

## Summary

- **Use `cargo test --all --all-features`** to run the complete test suite matching CI behavior.
- **Append `--doc`** to validate documentation examples.
- **Use `-p <crate-name>`** to test individual workspace members like `brush-loss`.
- **Reference [`.github/workflows/ci.yml`](https://github.com/ArthurBrussee/brush/blob/main/.github/workflows/ci.yml)** for the authoritative test configuration.

## Frequently Asked Questions

### What is the minimum Rust version required to run Brush tests?

The codebase requires **Rust 1.88 or higher**. Attempting to run tests with older versions may result in compilation errors due to modern language features used in the workspace.

### How do I run tests for only one specific crate in the Brush workspace?

Use the **`-p`** flag followed by the crate name: `cargo test -p brush-loss --all-features`. This targets only the tests within that crate’s directory (such as those in `crates/brush-loss/tests/`) without building the entire workspace.

### Does `cargo test --all` include all features?

No, `cargo test --all` runs tests with default features only. To match the CI environment and test all code paths—including optional functionality—you must add **`--all-features`** as specified in [`.github/workflows/ci.yml`](https://github.com/ArthurBrussee/brush/blob/main/.github/workflows/ci.yml).

### Where are the actual test files located in the Brush repository?

Test implementations reside within each crate’s directory. For example, integration tests for the loss calculations exist in [`crates/brush-loss/tests/reference.rs`](https://github.com/ArthurBrussee/brush/blob/main/crates/brush-loss/tests/reference.rs), while the workspace declaration in the root [`Cargo.toml`](https://github.com/ArthurBrussee/brush/blob/main/Cargo.toml) determines which crates participate when running `cargo test --all`.