Skip to main content

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//!         None,                        // sqlite_path
32//!     ).await?;
33//!
34//!     Ok(())
35//! }
36//! ```
37
38pub mod analyze;
39pub mod ast_analysis;
40pub mod coverage;
41pub mod db;
42pub mod error;
43pub mod git_changes;
44pub mod mutation;
45pub mod operators;
46pub mod report;
47
48pub use error::{MutationError, Result};
49
50/// Re-export commonly used types
51pub mod prelude {
52    pub use crate::analyze::run_analysis;
53    pub use crate::ast_analysis::{AridNodeDetector, AstNode, AstNodeType};
54    pub use crate::coverage::parse_coverage_file;
55    pub use crate::error::{MutationError, Result};
56    pub use crate::mutation::run_mutation;
57}