Skip to main content

dev_tools/
lib.rs

1//! # dev-tools
2//!
3//! Modular verification toolkit for AI-assisted Rust development.
4//! Umbrella crate over the `dev-*` suite.
5//!
6//! `dev-tools` is the convenient one-import entry point. Pick the
7//! features you need and pull them in with one line.
8//!
9//! ## Default features
10//!
11//! By default, you get:
12//!
13//! - [`report`]: structured machine-readable verdicts (always enabled).
14//! - [`fixtures`]: deterministic test environments.
15//! - [`bench`]: performance measurement and regression detection.
16//!
17//! ## Opt-in features
18//!
19//! Enable with `features = ["..."]`:
20//!
21//! - `async`: async-specific validation (deadlocks, hung futures, leaks).
22//! - `stress`: high-load stress testing (concurrency, volume).
23//! - `chaos`: failure injection and recovery testing.
24//! - `full`: all of the above.
25//!
26//! ## Quick example
27//!
28//! ```toml
29//! [dependencies]
30//! dev-tools = "0.1"
31//! ```
32//!
33//! ```rust
34//! use dev_tools::report::{Report, Verdict};
35//!
36//! let mut r = Report::new("my-crate", "0.1.0");
37//! // ... use r ...
38//! ```
39//!
40//! ## See also
41//!
42//! - [`dev-report`](https://crates.io/crates/dev-report) - schema only
43//! - [`dev-fixtures`](https://crates.io/crates/dev-fixtures) - test environments
44//! - [`dev-bench`](https://crates.io/crates/dev-bench) - performance
45//! - [`dev-async`](https://crates.io/crates/dev-async) - async validation
46//! - [`dev-stress`](https://crates.io/crates/dev-stress) - load testing
47//! - [`dev-chaos`](https://crates.io/crates/dev-chaos) - failure injection
48
49#![cfg_attr(docsrs, feature(doc_cfg))]
50#![warn(missing_docs)]
51#![warn(rust_2018_idioms)]
52
53/// Re-export of [`dev_report`]. Always available.
54pub use dev_report as report;
55
56/// Re-export of [`dev_fixtures`]. Available with the `fixtures` feature.
57#[cfg(feature = "fixtures")]
58#[cfg_attr(docsrs, doc(cfg(feature = "fixtures")))]
59pub use dev_fixtures as fixtures;
60
61/// Re-export of [`dev_bench`]. Available with the `bench` feature.
62#[cfg(feature = "bench")]
63#[cfg_attr(docsrs, doc(cfg(feature = "bench")))]
64pub use dev_bench as bench;
65
66/// Re-export of [`dev_async`]. Available with the `async` feature.
67#[cfg(feature = "async")]
68#[cfg_attr(docsrs, doc(cfg(feature = "async")))]
69pub use dev_async as r#async;
70
71/// Re-export of [`dev_stress`]. Available with the `stress` feature.
72#[cfg(feature = "stress")]
73#[cfg_attr(docsrs, doc(cfg(feature = "stress")))]
74pub use dev_stress as stress;
75
76/// Re-export of [`dev_chaos`]. Available with the `chaos` feature.
77#[cfg(feature = "chaos")]
78#[cfg_attr(docsrs, doc(cfg(feature = "chaos")))]
79pub use dev_chaos as chaos;
80
81#[cfg(test)]
82mod tests {
83    use super::*;
84
85    #[test]
86    fn report_module_is_always_available() {
87        let r = report::Report::new("self", "0.1.0");
88        assert_eq!(r.subject, "self");
89    }
90
91    #[cfg(feature = "fixtures")]
92    #[test]
93    fn fixtures_module_is_available_with_feature() {
94        let _ = fixtures::TempProject::new();
95    }
96
97    #[cfg(feature = "bench")]
98    #[test]
99    fn bench_module_is_available_with_feature() {
100        let _ = bench::Benchmark::new("x");
101    }
102}