Copying the tree
By default, cargo-mutants copies your tree to a temporary directory before mutating and building it. This behavior is turned of by the --in-place
option, which builds mutated code in the original source directory.
When the --jobs
option is used, one build directory is created per job.
Some filters are applied while copying the tree, which can be configured by options.
Troubleshooting tree copies
If the baseline tests fail in the copied directory it is a good first debugging step to try building with --in-place
.
.git
and other version control directories
By default, files or directories matching these patterns are not copied, because they can be large and typically are not needed to build the source:
.git
.hg
.bzr
.svn
_darcs
.pijul
If your tree's build or tests require the VCS directory then it can be copied with --copy-vcs=true
or by setting copy_vcs = true
in .cargo/mutants.toml
.
.gitignore
From 23.11.2, by default, cargo-mutants will not copy files that are excluded by gitignore patterns, to make copying faster in large trees.
gitignore filtering is only used within trees containing a .git
directory.
The filter, based on the ignore
crate, also respects global git ignore configuration in the home directory, as well as .gitignore
files within the tree.
This behavior can be turned off with --gitignore=false
, causing ignored files to be copied.
Rust projects typically configure gitignore to exclude the target/
directory.
mutants.out
mutants.out
and mutants.out.old
are never copied, even if they're not covered by .gitignore
.