Skip to content

Releases: sourcefrog/cargo-mutants

v23.10.0

04 Oct 16:54
v23.10.0
Compare
Choose a tag to compare
  • The baseline test (with no mutants) now tests only the packages in which mutants will be generated, subject to any file or regex filters. This should both make baseline tests faster, and allow testing workspaces in which some packages have non-hermetic tests.

cargo-mutants 23.9.1

17 Sep 15:02
cargo-mutants-23.9.1
Compare
Choose a tag to compare

Lots more mutation patterns!

  • Mutate the known collection types BinaryHeap, BTreeSet, HashSet, LinkedList, and VecDeque to generate empty and one-element collections using T::new() and T::from_iter(..).

  • Mutate known container types like Arc, Box, Cell, Mutex, Rc, RefCell into T::new(a).

  • Mutate unknown types that look like containers or collections T<A> or T<'a, A>' and try to construct them from an A with T::from_iter, T::new, and T::from.

  • Minimum Rust version updated to 1.70.

  • Mutate Cow<'_, T> into Owned and Borrowed variants.

  • Mutate functions returning &[T] and &mut [T] to return leaked vecs of values.

  • Mutate (A, B, C, ...) into the product of all replacements for a, b, c, ...

  • The combination of options --list --diff --json is now supported, and emits a diff key in the JSON.

  • Mutate -> impl Iterator<Item = A> to produce empty and one-element iterators of the item type.

cargo-mutants 23.9.0

17 Sep 14:42
cargo-mutants-23.9.0
Compare
Choose a tag to compare

Live from http://rustconf.com/

  • Fixed a bug causing an assertion failure when cargo-mutants was run from a subdirectory of a workspace. Thanks to @adamchalmers!
  • Generate HttpResponse::Ok().finish() as a mutation of an Actix HttpResponse.

cargo-mutants 23.6.0

11 Jun 00:15
cargo-mutants-23.6.0
Compare
Choose a tag to compare

An exciting release that adds a lot more power to generate viable mutations of functions returning more complex types.

  • Generate Box::leak(Box::new(...)) as a mutation of functions returning &mut.

  • Add a concept of mutant "genre", which is included in the json listing of mutants. The only genre today is FnValue, in which a function body is replaced by a value. This will in future allow filtering by genre.

  • Recurse into return types, so that for example Result<bool> can generate Ok(true) and Ok(false), and Some<T> generates None and every generated value of T. Similarly for Box<T>, and Vec<T>.

  • Generate specific values for integers: [0, 1] for unsigned integers, [0, 1, -1] for signed integers; [1] for NonZero unsigned integers and [1, -1] for NonZero signed integers.

  • Generate specific values for floats: [0.0, 1.0, -1.0].

  • Generate (fixed-length) array values, like [0; 256], [1; 256] using every recursively generated value for the element type.

cargo-mutants 23.5.0

27 May 16:22
cargo-mutants-23.5.0
Compare
Choose a tag to compare

"Pickled crab"

  • cargo mutants can now successfully test packages that transitively depend on a different version of themselves, such as itertools. Previously, cargo-mutants used the cargo --package option, which is ambiguous in this case, and now it uses --manifest-path instead. #117

  • Mutate functions returning &'_ str (whether a lifetime is named or not) to return "xyzzy" and "".

  • Switch to CalVer numbering.

cargo-mutants 1.2.3

05 May 16:11
cargo-mutants-1.2.3
Compare
Choose a tag to compare
  • New --error option, to cause functions returning Result to be mutated to return the specified error.

  • New --no-config option, to disable reading .cargo/mutants.toml.

  • Mutate functions returning String to String::new() rather than "".into(): same result but a bit more idiomatic.

  • New --leak-dirs option, for debugging cargo-mutants.

  • Update to syn 2.0, adding support for new Rust syntax.

  • Minimum supported Rust version increased to 1.65 due to changes in dependencies.

cargo-mutants-1.2.2

01 Apr 18:54
cargo-mutants-1.2.2
Compare
Choose a tag to compare
  • Don't mutate unsafe fns.

  • Don't mutate functions that never return (i.e. -> !).

  • Minimum supported Rust version increased to 1.64 due to changes in dependencies.

  • Some command-line options can now also be configured through environment variables: CARGO_MUTANTS_JOBS, CARGO_MUTANTS_TRACE_LEVEL.

  • New command line option --minimum-test-timeout and config file variable minimum_test_timeout join existing environment variable CARGO_MUTANTS_MINIMUM_TEST_TIMEOUT, to allow boosting the minimum, especially for test environments with poor or uneven throughput.

  • Changed: Renamed fields in outcomes.json from cargo_result to process_status and from command to argv.

  • Warn if no mutants were generated or if all mutants were unviable.

cargo-mutants-1.2.1

07 Jan 20:22
cargo-mutants-1.2.1
Compare
Choose a tag to compare
  • Converted most of the docs to a book available at https://mutants.rs/.

  • Fixed: Correctly find submodules that don't use mod.rs naming, e.g. when descending from src/foo.rs to src/foo/bar.rs. Also handle module names that are raw identifiers using r#. (Thanks to @kpreid for the report.)

cargo-mutants 1.2.0

25 Nov 17:01
cargo-mutants-1.2.0
Compare
Choose a tag to compare

Thankful mutants!

  • Fixed: Files that are excluded by filters are also excluded from --list-files.

  • Fixed: --exclude-re and --re can match against the return type as shown in --list.

  • New: A .cargo/mutants.toml file can be used to configure standard filters and cargo args for a project.

cargo-mutants 1.1.1

31 Oct 18:33
cargo-mutants-1.1.1
Compare
Choose a tag to compare

Spooky mutants!

  • Fixed support for the Mold linker, or for other options passed via RUSTFLAGS or CARGO_ENCODED_RUSTFLAGS. (See the instructions in README.md).

  • Source trees are walked by following mod statements rather than globbing the directory. This is more correct if there are files that are not referenced by mod statements. Once attributes on modules are stable in Rust (rust-lang/rust#54727) this opens a path to skip mods using attributes.