Expand description
Parallel mutation testing runner.
This module provides high-performance parallel execution of mutation tests. Each mutant is tested in an isolated temporary workspace to enable concurrent execution.
Re-exportsยง
use crate::MultiContractRunnerBuilder;๐use crate::cmd::test::FilterArgs;๐use crate::cmd::test::RerunFailure;๐use crate::mutation::mutant::Mutant;๐use crate::mutation::mutant::MutationResult;๐use crate::mutation::progress::MutationProgress;๐use crate::result::SuiteResult;๐use crate::workspace;๐use eyre::Result;๐use foundry_common::compile::ProjectCompiler;๐use foundry_common::fs::canonicalize_path;๐use foundry_common::sh_eprintln;๐use foundry_common::sh_println;๐use foundry_compilers::compilers::multi::MultiCompiler;๐use foundry_config::Config;๐use foundry_config::InlineConfig;๐use foundry_evm::backend::Backend;๐use foundry_evm::core::evm::EthEvmNetwork;๐use foundry_evm::core::evm::FoundryEvmNetwork;๐use foundry_evm::executors::ExecutorBuilder;๐use foundry_evm::opts::EvmOpts;๐use std::collections::BTreeMap;๐use std::fs;๐use std::panic;๐use std::panic::AssertUnwindSafe;๐use std::path::Path;๐use std::path::PathBuf;๐use std::sync::Arc;๐use std::sync::Mutex;๐use std::sync::atomic::AtomicBool;๐use std::sync::atomic::AtomicUsize;๐use std::sync::atomic::Ordering;๐use std::sync::mpsc;๐use std::thread::JoinHandle;๐use std::time::Duration;๐use std::time::Instant;๐use tempfile::TempDir;๐
Structsยง
- Mutant
Test Result - Result of testing a single mutant.
- Mutation
Batch Result - Result of a parallel mutation batch.
- Mutation
EvmConfig - Immutable EVM inputs shared by the baseline and every mutation worker.
- Shared
Mutation State - Tracks progress, cancellation, and timed-out workers across parallel workers.
Constantsยง
- MUTATION_
STACK_ ๐SIZE
Functionsยง
- apply_
mutation ๐ - Apply a mutation to a source file.
- compile_
and_ ๐test - Compiles and tests a mutant using the campaignโs already selected EVM and remote backend.
- run_
compile_ ๐and_ test_ with_ timeout - Run
compile_and_teston a worker thread and wait at mostbudgetfor it to complete. ReturnsTimedOuton overrun andInvalidon infrastructure errors / panics. - run_
mutations_ parallel_ with_ progress - Run mutation tests in parallel with optional progress display.
- test_
single_ ๐mutant_ isolated - Test a single mutant in an isolated temporary workspace.
- with_
mutation_ ๐test_ pool