From fcd92575d08bacffdd44d4ad95570405f69f85d6 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 10 Nov 2023 18:49:44 -0800 Subject: [PATCH] Better news about package changes --- NEWS.md | 4 ++-- book/src/workspaces.md | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index 5cc48a8a..5b6836be 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,12 +2,12 @@ ## Unreleased +- Changed: `cargo mutants` now tries to match the behavior of `cargo test` when run within a workspace. If run in a package directory, it tests only that package. If run in a workspace that is not a package (a "virtual workspace"), it tests the configured default packages, or otherwise all packages. This can all be overridden with the `--package` or `--workspace` options. + - New: generate key-value map values from types like `BTreeMap>`. - Changed: Send trace messages to stderr rather stdout, in part so that it won't pollute json output. -- New: `--package` option tests only mutants from that package. - ## 23.10.0 - The baseline test (with no mutants) now tests only the packages in which diff --git a/book/src/workspaces.md b/book/src/workspaces.md index d049ec68..b944093f 100644 --- a/book/src/workspaces.md +++ b/book/src/workspaces.md @@ -9,13 +9,13 @@ By default, cargo-mutants has [the same behavior as Cargo](https://doc.rust-lang * If the starting directory (or `-d` directory) is in a package, that package is tested. * Otherwise, the starting directory must be in a virtual workspace. If it specifies default members, they are tested. Otherwise, all packages are tested. -You can use the `--file` options to restrict cargo-mutants to testing only files -from some subdirectory, e.g. with `-f "utils/**/*.rs"`. (Remember to quote globs -on the command line, so that the shell doesn't expand them.) You can use `--list` or -`--list-files` to preview the effect of filters. - For each mutant, only the containing package's tests are run, on the theory that each package's tests are responsible for testing the package's code. The baseline tests exercise all and only the packages for which mutants will be generated. + +You can also use the `--file` options to restrict cargo-mutants to testing only files +from some subdirectory, e.g. with `-f "utils/**/*.rs"`. (Remember to quote globs +on the command line, so that the shell doesn't expand them.) You can use `--list` or +`--list-files` to preview the effect of filters.