cargo_pretty_test/
lib.rs

1//! This crate can be used as a binary or a library.
2//!
3//! * library: [parse the output from `cargo test`][crate::parsing]
4//! * binary: `cargo install cargo-pretty-test`
5//!
6//! ```text
7//! $ cargo pretty-test --workspace --no-fail-fast
8//!
9//! Error details from `cargo test` if any ... (Omitted here)
10//!
11//! Generated by cargo-pretty-test
12//! ├── (OK) cargo_pretty_test ... (4 tests in 0.16s: ✅ 4)
13//! │   ├── (OK) tests/golden_master_test.rs ... (1 tests in 0.00s: ✅ 1)
14//! │   │   └─ ✅ golden_master_test
15//! │   ├── (OK) tests/mocking_project.rs ... (2 tests in 0.16s: ✅ 2)
16//! │   │   ├─ ✅ snapshot_testing_for_parsed_output
17//! │   │   └─ ✅ snapshot_testing_for_pretty_output
18//! │   └── (OK) tests/parsing.rs ... (1 tests in 0.00s: ✅ 1)
19//! │       └─ ✅ parse_stderr_stdout
20//! ├── (FAIL) integration ... (10 tests in 0.00s: ✅ 6; ❌ 2; 🔕 2)
21//! │   ├── (FAIL) src/lib.rs ... (8 tests in 0.00s: ✅ 4; ❌ 2; 🔕 2)
22//! │   │   ├── submod
23//! │   │   │   ├─ 🔕 ignore
24//! │   │   │   ├─ 🔕 ignore_without_reason
25//! │   │   │   ├─ ✅ normal_test
26//! │   │   │   └── panic
27//! │   │   │       ├─ ❌ panicked
28//! │   │   │       ├─ ✅ should_panic - should panic
29//! │   │   │       ├─ ❌ should_panic_but_didnt - should panic
30//! │   │   │       └─ ✅ should_panic_without_reanson - should panic
31//! │   │   └─ ✅ works
32//! │   ├── (OK) src/main.rs ... (1 tests in 0.00s: ✅ 1)
33//! │   │   └─ ✅ from_main_rs
34//! │   └── (OK) tests/parsing.rs ... (1 tests in 0.00s: ✅ 1)
35//! │       └─ ✅ from_integration
36//! └── (OK) Doc Tests ... (2 tests in 0.41s: ✅ 2)
37//!     ├── (OK) cargo-pretty-test ... (1 tests in 0.20s: ✅ 1)
38//!     │   └─ ✅ src/doc.rs - doc (line 3)
39//!     └── (OK) integration ... (1 tests in 0.21s: ✅ 1)
40//!         └─ ✅ tests/integration/src/lib.rs - doc (line 41)
41//!
42//! Status: FAIL; total 16 tests in 0.57s: 12 passed; 2 failed; 2 ignored; 0 measured; 0 filtered out
43//! ```
44//!
45//! ![](https://user-images.githubusercontent.com/25300418/270264132-89de6fd2-11f8-4e5b-b9dc-8475fa022a5f.png)
46//!
47//! [More screenshots.](https://github.com/josecelano/cargo-pretty-test/wiki/cargo%E2%80%90pretty%E2%80%90test-screenshots)
48
49#![allow(
50    clippy::missing_panics_doc,
51    clippy::missing_errors_doc,
52    clippy::must_use_candidate,
53    clippy::enum_glob_use
54)]
55
56#[doc(hidden)]
57pub mod doc;
58
59pub mod fetch;
60pub mod parsing;
61pub mod prettify;
62pub mod regex;
63
64pub type Error = String;
65pub type Result<T, E = Error> = ::std::result::Result<T, E>;