bcore_mutation/lib.rs
1//! # Mutation Core
2//!
3//! A mutation testing tool for Bitcoin Core written in Rust.
4//!
5//! This library provides functionality to:
6//! - Generate mutants for Bitcoin Core source code
7//! - Analyze mutants by running tests against them
8//! - Generate detailed reports of surviving mutants
9//! - AST-based arid node detection to filter unproductive mutants
10//!
11//! ## Example
12//!
13//! ```rust,no_run
14//! use bcore_mutation::mutation;
15//! use std::collections::HashMap;
16//!
17//! #[tokio::main]
18//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
19//! // Generate mutants for a specific file with AST filtering
20//! mutation::run_mutation(
21//! None, // PR number
22//! Some("src/test.cpp".into()), // file path
23//! false, // one_mutant
24//! false, // only_security_mutations
25//! None, // range_lines
26//! None, // coverage
27//! false, // test_only
28//! HashMap::new(), // skip_lines
29//! true, // enable_ast_filtering
30//! None, // custom_expert_rule
31//! ).await?;
32//!
33//! Ok(())
34//! }
35//! ```
36
37pub mod analyze;
38pub mod ast_analysis;
39pub mod coverage;
40pub mod error;
41pub mod git_changes;
42pub mod mutation;
43pub mod operators;
44pub mod report;
45
46pub use error::{MutationError, Result};
47
48/// Re-export commonly used types
49pub mod prelude {
50 pub use crate::analyze::run_analysis;
51 pub use crate::ast_analysis::{AridNodeDetector, AstNode, AstNodeType};
52 pub use crate::coverage::parse_coverage_file;
53 pub use crate::error::{MutationError, Result};
54 pub use crate::mutation::run_mutation;
55}