hindsight_tests/lib.rs
1// Copyright (c) 2026 - present Nicholas D. Crosbie
2// SPDX-License-Identifier: MIT
3
4//! hindsight-tests: Test log processing for hindsight-mcp
5//!
6//! This library crate provides functionality to parse and process test results
7//! (particularly from cargo-nextest) for consumption by the hindsight-mcp server.
8
9#![warn(missing_docs)]
10
11//! # Example
12//!
13//! ```no_run
14//! use hindsight_tests::nextest::{parse_run_output, StreamingParser};
15//!
16//! // Parse complete run output
17//! let output = r#"{"type":"suite","event":"started","test_count":1}"#;
18//! let summary = parse_run_output(output).unwrap();
19//!
20//! // Or use streaming parser for incremental parsing
21//! let mut parser = StreamingParser::new();
22//! parser.process_line(output).unwrap();
23//! ```
24
25pub mod error;
26pub mod nextest;
27pub mod result;
28
29pub use error::TestsError;
30pub use nextest::{
31 LibtestEvent, StreamingParser, TestList, TestRunSummary, TestSuite, parse_list_output,
32 parse_run_output,
33};
34pub use result::{TestOutcome, TestResult};
35
36/// Re-export commonly used types
37pub mod prelude {
38 pub use crate::error::TestsError;
39 pub use crate::nextest::{StreamingParser, TestRunSummary, parse_run_output};
40 pub use crate::result::{TestOutcome, TestResult};
41}