{"id":15372736,"url":"https://github.com/bitfield/cargo-testdox","last_synced_at":"2025-10-19T11:51:00.562Z","repository":{"id":251528200,"uuid":"837678739","full_name":"bitfield/cargo-testdox","owner":"bitfield","description":"Turns your Rust tests into docs","archived":false,"fork":false,"pushed_at":"2025-02-26T17:15:22.000Z","size":562,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-15T14:13:08.705Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitfield.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-03T17:26:51.000Z","updated_at":"2025-04-01T14:34:35.000Z","dependencies_parsed_at":"2024-09-08T14:37:12.102Z","dependency_job_id":"2d6bb703-12fc-4504-b408-6cfad3ad6f46","html_url":"https://github.com/bitfield/cargo-testdox","commit_stats":null,"previous_names":["bitfield/cargo-testdox"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfield%2Fcargo-testdox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfield%2Fcargo-testdox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfield%2Fcargo-testdox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfield%2Fcargo-testdox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfield","download_url":"https://codeload.github.com/bitfield/cargo-testdox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249085429,"owners_count":21210267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T13:53:00.226Z","updated_at":"2025-10-19T11:51:00.556Z","avatar_url":"https://github.com/bitfield.png","language":"Rust","readme":"[![Crate](https://img.shields.io/crates/v/cargo-testdox.svg)](https://crates.io/crates/cargo-testdox)\n[![Docs](https://docs.rs/cargo-testdox/badge.svg)](https://docs.rs/cargo-testdox)\n![CI](https://github.com/bitfield/cargo-testdox/actions/workflows/ci.yml/badge.svg)\n![Audit](https://github.com/bitfield/cargo-testdox/actions/workflows/audit.yml/badge.svg)\n![Maintenance](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg)\n\n[Subscribe to learn Rust with me!](https://bitfieldconsulting.com/subscribe)\n\n# cargo-testdox\n\n![cargo-testdox logo](img/logo.png)\n\nA Cargo subcommand to print your Rust test names as sentences.\n\n## Installation\n\n```sh\ncargo install cargo-testdox\n```\n\n## Usage\n\nIn any Rust project with tests, run:\n\n```sh\ncargo testdox\n```\n\n![Animated demo](img/demo.gif)\n\n`cargo-testdox` will first invoke `cargo test` to run your tests, with any extra arguments that you give it. It will then show the result for each test (passed, failed, or ignored), with the test name formatted as a sentence. That is, with underscores replaced by spaces.\n\nFor example, the following test:\n\n```rust,ignore\n#[test]\nfn it_works() {}\n```\n\nwill produce this output when run with `cargo-testdox`:\n\n```txt\n ✔ it works\n```\n\nIf the test were failing, it would produce:\n\n```txt\n x it works\n```\n\nIf the test were ignored, it would produce:\n\n```txt\n ? it works\n```\n\nIf the test were in a module `foo::bar`, it would produce:\n\n```txt\n ✔ foo::bar — it works\n```\n\nHowever, if the module path ends with `test` or `tests`, this part is omitted, and the name of the parent module (if there is one) is used instead. For example, if the module is `foo::tests`:\n\n```txt\n ✔ foo — it works\n```\n\nDoctests are ignored, since they can't currently be named (pending [RFC #3311](https://github.com/rust-lang/rfcs/pull/3311)).\n\n### Function names with underscores\n\nTo avoid underscores in a snake-case function name from being replaced, put `_fn_` after the function name:\n\n```rust,ignore\n#[test]\nfn print_hello_world_fn_prints_hello_world() {}\n```\n\nbecomes:\n\n```txt\n✔ print_hello_world prints hello world\n```\n\n## Why\n\nBecause [test names should be sentences](https://bitfieldconsulting.com/posts/test-names).\n\nCompare [`gotestdox`](https://github.com/bitfield/gotestdox), a similar tool for Go tests.\n\nThis is an example project from my book [The Secrets of Rust: Tools](https://bitfieldconsulting.com/books/rust-tools).\n\n[![Secrets of Rust: Tools cover image](img/cover.png)](https://bitfieldconsulting.com/books/rust-tools)\n","funding_links":[],"categories":["Development tools"],"sub_categories":["Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfield%2Fcargo-testdox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfield%2Fcargo-testdox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfield%2Fcargo-testdox/lists"}