Skip to main content

Module runner

Module runner 

Source
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ยง

MutantTestResult
Result of testing a single mutant.
MutationBatchResult
Result of a parallel mutation batch.
MutationEvmConfig
Immutable EVM inputs shared by the baseline and every mutation worker.
SharedMutationState
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_test on a worker thread and wait at most budget for it to complete. Returns TimedOut on overrun and Invalid on 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 ๐Ÿ”’