Skip to content

Commit f129669

Browse files
committed
add example to run one mutant
1 parent 9d137db commit f129669

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/mutation-testing.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,20 @@ cargo install --version 24.7.1 cargo-mutants --locked
108108
--test-tool=nextest \
109109
-- --all-targets --test-threads 1
110110
```
111+
112+
## How to run one specific mutant to test it
113+
114+
Example of output which had a missing mutant
115+
```sh
116+
MISSED stacks-signer/src/runloop.rs:424:9: replace <impl SignerRunLoop for RunLoop<Signer, T>>::run_one_pass -> Option<Vec<SignerResult>> with None in 3.0s build + 9.3s test
117+
```
118+
119+
Example of fix for it
120+
```sh
121+
RUST_BACKTRACE=1 BITCOIND_TEST=1 cargo mutants -vV -F "replace process_stackerdb_event" -E ": replace <impl SignerRunLoop for RunLoop<Signer, T>>::run_one_pass -> Option<Vec<SignerResult>> with None in " --test-tool=nextest -- --run-ignored all --fail-fast --test-threads 1
122+
```
123+
124+
General command to run
125+
```sh
126+
RUST_BACKTRACE=1 BITCOIND_TEST=1 cargo mutants -vV -F "replace process_stackerdb_event" -E ": replace [modify this] with [modify this] in " --test-tool=nextest -- --run-ignored all --fail-fast --test-threads 1
127+
```

0 commit comments

Comments
 (0)