Skip to content
mutastic

Rust edition

Errors

When mutastic can’t run, it says why on stderr, as mutastic: and one sentence naming what’s wrong in your words, then where it looked, and last the command to run, with your own values. It exits 2, or 3 when the tests fail without any mutant. In --format=agent and --format=jsonl, the same error is the last line on stdout, as the run-failed event, with a code for its kind: each kind has an entry here, under its code. Each output below is a kept copy of a real run, and each command an error gives as one to run as it is, is run by the docs test, and gets past the error.

A refusal that does nothing, such as ignore --remove for a mutant that isn’t ignored, or baseline when there’s one already, is said on stderr too, and exits 1. Stdout holds only results.

Both editions exit 0 when the run passes and 1 when it doesn’t, 2 for most errors on this page, and 3 when a test fails before any mutant (red-baseline), or caught mutants and then fails on its own: there’s a way past those, leaving the test out with a reason, so they’re told apart from a mistake in the command. The Java edition exits 4 for a bug in mutastic itself, where the Rust edition keeps 2 until its 2.0, so a script that wraps mutastic should treat any status above 1 as “couldn’t run”, and read the event’s code for which. See Differences from the Java edition.

Most codes are the same in both editions. Two name a failure the Java edition names another way, so a script that reads both should treat each pair as one kind:

Rust editionJava editionThe error
no-cargono-build-toolNo build tool to run the build with
workspace-rootmodule-without-java, at a build’s rootThe root of a workspace (a build of modules), which mutastic doesn’t test as one; it names the packages to test

Both editions keep these names for 1.x, as renaming either would break a script that reads it. A new edition uses the general name of each pair: no-build-tool, and build-root for the root of a build of modules.

The directory named isn’t there. mutastic says where it looked, offers a package or directory whose name is close, and ends in the command to run instead.

Terminal window
mutastic run fixtures/pricing/nosuch
Terminal window
mutastic: there's no directory fixtures/pricing/nosuch in /home/you/project.
The package there is pricing, in fixtures/pricing. To test it:
mutastic run fixtures/pricing

No Cargo.toml, pom.xml, build.gradle(.kts) or settings.gradle(.kts) in the directory or any above it. Go to your project, or name its directory.

Terminal window
mutastic run empty
Terminal window
mutastic: there's no project in empty for mutastic to test.
It looked in /home/you/project/empty and every directory above it, for Cargo.toml, pom.xml, build.gradle(.kts) or settings.gradle(.kts).
Go to your project, or name its directory:
mutastic run <project directory>

A workspace’s root, or a directory in a workspace but in none of its packages: mutastic tests one package at a time, and gives the command for each. Inside a member, it runs that member.

Terminal window
mutastic run fixtures/workspace
Terminal window
mutastic: fixtures/workspace is a workspace's root, and mutastic tests one package at a time.
It has 2 packages. To test one:
mutastic run fixtures/workspace/billing
mutastic run fixtures/workspace/shop

There’s no cargo to run: mutastic says where it looked, the CARGO variable when it’s set, or the PATH.

Terminal window
CARGO=/nowhere/cargo mutastic run fixtures/pricing
Terminal window
mutastic: CARGO is /nowhere/cargo, and there's no cargo there.
mutastic runs the cargo CARGO names. Point it at one, or unset it to use the cargo on the PATH:
unset CARGO

A command mutastic doesn’t have, or gate without open, check or close. A close one is offered, never run, in your line with only that word changed; with none close, the command that lists them.

Terminal window
mutastic verfiy mb2f8ae57 fixtures/pricing
Terminal window
mutastic: mutastic has no command verfiy. There's one called verify.
mutastic verify mb2f8ae57 fixtures/pricing

An option mutastic doesn’t have, including a short one such as -v: its options are all long ones. A close one is offered in your line; with none close, the command that lists its options.

Terminal window
mutastic run fixtures/pricing --formt=agent
Terminal window
mutastic: run has no option --formt. There's one called --format.
mutastic run fixtures/pricing --format=agent

A value an option doesn’t take, or none where it needs one. The valid ones are listed, and a close one offered. With none given, the line follows with one to fill in, --format=<format>. A value goes after an = or a space, --format=agent or --format agent; only --since’s, which is optional, needs the =.

Terminal window
mutastic run fixtures/pricing --format=agnt
Terminal window
mutastic: --format has no value agnt. There's one called agent.
mutastic run fixtures/pricing --format=agent

An option mutastic has, on a command that doesn’t take it. The command’s synopsis follows.

Terminal window
mutastic verify mb2f8ae57 fixtures/pricing --threshold=70
Terminal window
mutastic: verify doesn't take --threshold: mutastic verify ID... [DIR]

A word the command doesn’t take, after its directory.

Terminal window
mutastic mutants fixtures/pricing fixtures/workspace
Terminal window
mutastic: mutants doesn't take fixtures/workspace: mutastic mutants [DIR]

A command that needs a mutant’s id, m and eight hex digits as a card shows it, given something else; or ignore without its reason. It ends in your line with the <id>, or the <why>, to fill in.

Terminal window
mutastic verify fixtures/pricing
Terminal window
mutastic: fixtures/pricing is a directory, not a mutant id. verify needs a mutant id first, an m and eight hex digits as a run prints them:
mutastic verify <id> fixtures/pricing

An id that’s a mutant’s shape, but no mutant of the package: kept from before the code changed, or mistyped. An id one digit, or one swap, from a mutant’s is offered as that mutant’s, in your line; with none close, it ends in the command that lists the mutants.

Terminal window
mutastic verify mb2f8ae58 fixtures/pricing
Terminal window
mutastic: mb2f8ae58 isn't a mutant of pricing. There's one called mb2f8ae57.
mutastic verify mb2f8ae57 fixtures/pricing

--at asked for lines with no mutant on them, under the operators the run chooses and, with --since, on the change. A run of none would pass and say nothing, so it’s refused: the message names the nearest lines that have one, and ends in the mutants --at command that lists them. The lines are read from the file as it is on disk, so save an editor’s changes first.

Terminal window
mutastic run fixtures/pricing --at=src/lib.rs:24
Terminal window
mutastic: no mutant on lib.rs:24; there are on 26, 27, 29, 34 and 35. To see them:
mutastic mutants --at=src/lib.rs:26-35 fixtures/pricing

--at named a file that isn’t one of the package’s sources, a test say: only the code mutastic mutates has mutants. The message names the directories of the package’s crate roots. At a workspace’s root, the file picks its member; a member named stays, so another member’s file is outside its sources.

Terminal window
mutastic run fixtures/pricing --at=tests/pricing.rs:3
Terminal window
mutastic: tests/pricing.rs isn't in the package's sources: --at takes a line of the code mutastic mutates, in src

A mutastic.yaml, a rules file, or .mutastic/ignores.yaml that mutastic can’t read: the file and line, and what that line could hold.

Terminal window
mutastic run configured
Terminal window
mutastic: mutastic.yaml line 3: strem isn't an operator mutastic has. There's one called stream.
It takes a set (defaults, stronger, extended or all), a namespace (bigdecimal, library, mutastic, optional or stream) or an operator's id. To see each id:
mutastic mutants --operators=all

A variable that stands in for an option, MUTASTIC_FORMAT, MUTASTIC_VOCABULARY or MUTASTIC_PROGRESS, set to a value the option doesn’t take, or MUTASTIC_HEARTBEAT set to anything but a number of seconds above 0. A variable is set once and forgotten, so mutastic refuses it rather than quietly running with the default. Set it to one the error lists, or unset it; the option on the command line wins over it.

Terminal window
MUTASTIC_VOCABULARY=xyz mutastic run fixtures/pricing
Terminal window
mutastic: MUTASTIC_VOCABULARY: xyz isn't one of plain or classic

--fail-on-new with no .mutastic/baseline.yaml to tell new misses from.

Terminal window
mutastic run fixtures/pricing --fail-on-new
Terminal window
mutastic: --fail-on-new needs a baseline to tell new misses from, and /home/you/project/fixtures/pricing has no .mutastic/baseline.yaml: `mutastic baseline` writes one, to commit

--since and the gate ask git what changed, so they need git installed and a repository with a commit, and the commit named must be one git knows. A plain mutastic run needs no git. The message says which is missing: git itself, with where to install it; a repository, with the commands that make the directory one, its files the first commit; or a first commit. It ends in the command to run without git: yours without --since, or mutastic run in place of the gate.

Terminal window
mutastic run fixtures/pricing --since=main
Terminal window
mutastic: --since asks git what changed, and fixtures/pricing isn't in a git repository. To make it one, with its files as the first commit:
cd fixtures/pricing && git init && git add -A && git commit -m start
Or to test all the code without --since:
mutastic run fixtures/pricing

Shares --from-shards can’t put together as one run: none there, one missing or twice, from different runs, code or versions.

Terminal window
mutastic run fixtures/pricing --from-shards=fixtures/workspace
Terminal window
mutastic: fixtures/workspace holds no share's events.jsonl: each run with --shard keeps its own in shares/N-of-M, in target/mutastic

A directory with both a Cargo.toml and a Maven or Gradle build, where either edition could run. Say which with --edition.

Terminal window
mutastic run both
Terminal window
mutastic: /home/you/project/both has both Cargo.toml and pom.xml, so either edition could read it: say which with --edition=rust or --edition=java

A Swift package (Package.swift), an Xcode project (.xcodeproj) or an Xcode workspace (.xcworkspace), which the Swift edition reads, and it isn’t released yet: it’s planned for 1.5. MUTASTIC_SWIFT_ENGINE names a Swift edition’s mutastic built from its source, which then runs the command, or says why it can’t. See One command, two editions.

Terminal window
mutastic run shop
Terminal window
mutastic: shop is a Swift package, and the Swift edition isn't released yet: it's planned for 1.5. Until then mutastic tests Rust, Maven and Gradle projects. To run a Swift edition built from its source, name its mutastic in MUTASTIC_SWIFT_ENGINE:
MUTASTIC_SWIFT_ENGINE=<path to its mutastic> mutastic run

The package doesn’t build before any mutant is in it. mutastic checks the package as you wrote it and names each error by your file and line, then the cargo test --no-run that shows them in full. See The package doesn’t build.

Your package builds, but mutastic’s copy of it, with the mutants in, doesn’t: a bug in mutastic. The message has the copy’s first error, to report.

A test fails with no mutant in, every time it runs: how it failed, where its output is, the cargo test that runs it alone, and the way past it, leaving it out with a reason under exclude-tests: in mutastic.yaml. It exits 3, as in the Java edition. See A test fails before any mutant.

A test ended its test process with no mutant in, and no test failed as a test does: code it ran called std::process::exit, or it crashed. The message names the test and how its process ended, (it exited with status 3) or (it was stopped by SIGABRT), and ends in the cargo test that runs it alone. The Java edition has the same code for a test that ends the tests’ JVM.

A test ran past the five minutes each test gets with no mutant in, every time it ran, and no other test failed: it waits for something that never comes, or never stops. The message names it, (it timed out), and ends in the cargo test that runs it alone.

The package has tests, and every one of them is #[ignore]d, so none ran and there’s nothing to judge a mutant by. Take the #[ignore] off a test that calls the code, or write one. A package with no tests at all isn’t an error: its mutants are not covered, and the run says so. See No tests.

The tests ran and passed, and none of them reached any of the code with mutants. Scored, every mutant would be not covered: a 0% that measures nothing. Only a run of every mutant stops for it; with --only, --since or --shard, tests that reach none of the mutants run can be the honest answer. Write a #[test] that calls the code.

The Java edition can’t run: no JDK 25 or later where mutastic looked, a MUTASTIC_JAVA_HOME that isn’t one, a MUTASTIC_JAVA_ENGINE that isn’t a file, no HOME to keep it in, or no release to fetch. See One command, two editions.

A proc-macro crate, which mutastic can’t mutate yet.

A file mutastic reads or writes couldn’t be: a full disk, a directory that isn’t writable, or a file where it keeps a directory. The message names the file and gives the system’s reason, then what to do about those three.

An error with no code of its own yet. The message says what went wrong.

A bug in mutastic itself: it panicked. The message says where, and ends in where to report it, with the message. The Rust edition exits 2 for it until its 2.0, and 4 after, as the Java edition does.