Skip to content

Commit

Permalink
adjust the code blocks with line breaks for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
ASuciuX committed Aug 8, 2024
1 parent f129669 commit 5cc974e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
3 changes: 2 additions & 1 deletion contrib/tools/local-mutation-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ run_mutants() {

if [ "$mutant_count" -gt "$threshold" ]; then
echo "Running mutants for $package ($mutant_count mutants)"
RUST_BACKTRACE=1 BITCOIND_TEST=1 cargo mutants --timeout-multiplier 1.5 --no-shuffle -vV \
RUST_BACKTRACE=1 BITCOIND_TEST=1 \
cargo mutants --timeout-multiplier 1.5 --no-shuffle -vV \
-F "$regex_pattern" \
-E ": replace .{1,2} with .{1,2} in " \
--output "$output_dir" \
Expand Down
23 changes: 21 additions & 2 deletions docs/mutation-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ cargo install --version 24.7.1 cargo-mutants --locked
```sh
regex_pattern=$(sed 's/[][()\.^$*+?{}|]/\\&/g' "mutants_by_package/stackslib.txt" | paste -sd'|' -)
RUST_BACKTRACE=1 BITCOIND_TEST=1 \
cargo mutants --timeout-multiplier 1.5 --no-shuffle -vV \
-F "$regex_pattern" \
-E ": replace .{1,2} with .{1,2} in " \
Expand All @@ -79,6 +80,7 @@ cargo install --version 24.7.1 cargo-mutants --locked
```sh
regex_pattern=$(sed 's/[][()\.^$*+?{}|]/\\&/g' "mutants_by_package/testnet.txt" | paste -sd'|' -)
RUST_BACKTRACE=1 BITCOIND_TEST=1 \
cargo mutants --timeout-multiplier 1.5 --no-shuffle -vV \
-F "$regex_pattern" \
-E ": replace .{1,2} with .{1,2} in " \
Expand All @@ -90,6 +92,7 @@ cargo install --version 24.7.1 cargo-mutants --locked
```sh
regex_pattern=$(sed 's/[][()\.^$*+?{}|]/\\&/g' "mutants_by_package/stacks-signer.txt" | paste -sd'|' -)
RUST_BACKTRACE=1 BITCOIND_TEST=1 \
cargo mutants --timeout-multiplier 1.5 --no-shuffle -vV \
-F "$regex_pattern" \
-E ": replace .{1,2} with .{1,2} in " \
Expand Down Expand Up @@ -118,10 +121,26 @@ MISSED stacks-signer/src/runloop.rs:424:9: replace <impl SignerRunLoop for Run
Example of fix for it
```sh
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
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
```
General command to run
```sh
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
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
```

0 comments on commit 5cc974e

Please sign in to comment.