Releases: sourcefrog/cargo-mutants
v26.0.0
-
Changed: The default is now not to shuffle mutants: they run in the deterministic order they are generated in the source tree. This should give somewhat better locality of reference due to consecutively testing changes in each package or module. The previous behavior can be restored with
--shuffle. -
New:
--cargo-test-argoption to pass additional arguments tocargo test. -
New:
--shardingoption to control how mutants are distributed across multiple machines, with choices ofsliceorround-robin. -
Changed: The default sharding strategy is now
slice; previously it wasround-robin. Sliced sharding gives each worker better locality of reference due to testing changes to related packages, but may make the runtime more uneven between workers if some packages are slower to test than others. -
Changed: Tree copying now attempts to use reflinks (copy-on-write) for faster copying on supported filesystems (Btrfs, XFS, APFS), with automatic fallback to regular copying.
-
Book: Recommend using the
-Zunstable-options --fail-fastargument to test targets to speed up mutation testing, on recent nightly toolchains. -
Fixed: Don't error if the
--in-diffpatch file contains non-UTF-8 data in non-Rust files, or contains messages about binary files or git index changes. -
New:
start_timeandend_timefields inoutcomes.json. -
New: Delete individual fields from struct literals that have a base (default) expression like
..Default::default()or..base_value. This checks that tests verify each field is set correctly and not just relying on default values. -
New:
cargo_mutants_versionfield inoutcomes.json. -
Changed: Functions with attributes whose path ends with
testare now skipped, not just those with the plain#[test]attribute. This means functions with#[tokio::test],#[sqlx::test], and similar testing framework attributes are automatically excluded from mutation testing. -
Changed: The bitwise assignment operators
&=and|=are no longer mutated to^=. In code that accumulates bits into a bitmap starting from zero (e.g.,bitmap |= new_bits),|=and^=produce the same result, making such mutations uninformative.
v25.3.1
- Fixed: cargo-mutants' own tests were failing on nightly due to a change in the format of messages emitted by tests.
v25.3.0
-
New: A specific clearer error if a valid non-empty diff changes no Rust source files, and so matches no mutants. Thanks to @brunoerg.
-
New: cargo-mutants can emit GitHub Actions structured annotations for missed mutants, which appear as warnings outside of the log text. This behavior is on by default when the
GITHUB_ACTIONenvironment variable is set, can be forced on with--annotations=githuband forced off with--annotations=none.
v25.2.2
-
Changed: The mutant name of "replace match guard" mutations now includes the original match guard, for example
replace match guard path.path.is_ident("str") with true in type_replacements. Similarly, the "delete match arm" mutation includes the pattern of the arm, for exampledelete match arm BinOp::BitOr(_) in .... -
Internal: Automatically publish cargo-mutants to crates.io from GitHub Actions.
v25.2.2-pre2
- Release packages from a github environment for added security.
v25.2.2-pre0
- Changed: The mutant name of "replace match guard" mutations now includes the original match guard, for example
replace match guard path.path.is_ident("str") with true in type_replacements. Similarly, the "delete match arm" mutation includes the pattern of the arm, for exampledelete match arm BinOp::BitOr(_) in ....
v25.2.1
- Fixed: Updated to
syn2.0.104, which understands new Rust syntax including impl trait precise capturing.
v25.2.0
-
New:
gitignoreconfig key in.cargo/mutants.tomlto control whether.gitignorepatterns are respected when copying source trees, corresponding to--gitignore. -
Changed: The mutant name for mutations of
matchstatements and guard expressions now includes the enclosing function name, for examplereplace match guard with true in find_path_attribute.
v25.1.0
-
Changed: The
--gitignoreoption now defaults tofalse, meaning.gitignorepatterns are no longer respected when copying source trees by default. The/targetdirectory is still excluded by default through explicit filtering. To restore the previous behavior, use--gitignore=true. -
New: Mutate
>to>=and<to<=. -
Changed: Mutate
&TtoBox::leak(Box::new(...)), instead of a reference to a value, so that mutants aren't unviable due to returning references to temporary values. -
New:
--copy-targetoption allows copying the/targetdirectory to build directories. By default, the target directory is excluded to avoid copying large build artifacts, but--copy-target=truecan be used if tests depend on existing build artifacts. -
New: Feature-related options can now be configured in
.cargo/mutants.toml:features,all_features, andno_default_features. Command line arguments take precedence over config file settings for boolean options, while features from both sources are combined. -
New: Produce a json schema for the config file with
--emit-schema=configto support schema-guided editing. The schema has been proposed to SchemaStore so many editors should in future support it automatically. -
New: The config file path can be specified with the
--configoption, overriding the default of.cargo/mutants.toml. (The pre-existing--no-configoption turns it off.)
v25.0.1
-
New: Additional mutation patterns: delete
matcharms if there is a default arm, and replaceifguards from match arms withtrueandfalse. -
Changed: Show more type parameters in mutant names, like
impl From<&str> for Foorather thanimpl From for Foo. -
Fixed: Support crates that use a non-default Cargo registry. Previously,
cargo metadatafailed with "registry index was not found." -
Improved: Warn if
--jobsis set higher than 8, which is likely to be too high. -
Improved: Don't warn about expected/harmless exit codes from Nextest.