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.
Exit codes, and the Java edition’s
Section titled “Exit codes, and the Java edition’s”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.
The same error in the Java edition
Section titled “The same error in 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 edition | Java edition | The error |
|---|---|---|
no-cargo | no-build-tool | No build tool to run the build with |
workspace-root | module-without-java, at a build’s root | The 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.
no-directory
Section titled “no-directory”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.
mutastic run fixtures/pricing/nosuchmutastic: 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/pricingno-project
Section titled “no-project”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.
mutastic run emptymutastic: 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>workspace-root
Section titled “workspace-root”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.
mutastic run fixtures/workspacemutastic: 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/shopno-cargo
Section titled “no-cargo”There’s no cargo to run: mutastic says where it looked, the CARGO variable when it’s set, or the
PATH.
CARGO=/nowhere/cargo mutastic run fixtures/pricingmutastic: 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 CARGOunknown-command
Section titled “unknown-command”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.
mutastic verfiy mb2f8ae57 fixtures/pricingmutastic: mutastic has no command verfiy. There's one called verify. mutastic verify mb2f8ae57 fixtures/pricingunknown-option
Section titled “unknown-option”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.
mutastic run fixtures/pricing --formt=agentmutastic: run has no option --formt. There's one called --format. mutastic run fixtures/pricing --format=agentoption-value
Section titled “option-value”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 =.
mutastic run fixtures/pricing --format=agntmutastic: --format has no value agnt. There's one called agent. mutastic run fixtures/pricing --format=agentoption-not-taken
Section titled “option-not-taken”An option mutastic has, on a command that doesn’t take it. The command’s synopsis follows.
mutastic verify mb2f8ae57 fixtures/pricing --threshold=70mutastic: verify doesn't take --threshold: mutastic verify ID... [DIR]extra-words
Section titled “extra-words”A word the command doesn’t take, after its directory.
mutastic mutants fixtures/pricing fixtures/workspacemutastic: mutants doesn't take fixtures/workspace: mutastic mutants [DIR]needs-id
Section titled “needs-id”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.
mutastic verify fixtures/pricingmutastic: 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/pricingunknown-id
Section titled “unknown-id”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.
mutastic verify mb2f8ae58 fixtures/pricingmutastic: mb2f8ae58 isn't a mutant of pricing. There's one called mb2f8ae57. mutastic verify mb2f8ae57 fixtures/pricingno-mutant-at
Section titled “no-mutant-at”--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.
mutastic run fixtures/pricing --at=src/lib.rs:24mutastic: 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/pricingoutside-sources
Section titled “outside-sources”--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.
mutastic run fixtures/pricing --at=tests/pricing.rs:3mutastic: tests/pricing.rs isn't in the package's sources: --at takes a line of the code mutastic mutates, in srcconfig
Section titled “config”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.
mutastic run configuredmutastic: 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=allenvironment
Section titled “environment”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.
MUTASTIC_VOCABULARY=xyz mutastic run fixtures/pricingmutastic: MUTASTIC_VOCABULARY: xyz isn't one of plain or classicno-baseline
Section titled “no-baseline”--fail-on-new with no .mutastic/baseline.yaml to tell new misses from.
mutastic run fixtures/pricing --fail-on-newmutastic: --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.
mutastic run fixtures/pricing --since=mainmutastic: --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 startOr to test all the code without --since: mutastic run fixtures/pricingshards
Section titled “shards”Shares --from-shards can’t put together as one run: none there, one missing or twice, from
different runs, code or versions.
mutastic run fixtures/pricing --from-shards=fixtures/workspacemutastic: fixtures/workspace holds no share's events.jsonl: each run with --shard keeps its own in shares/N-of-M, in target/mutasticboth-editions
Section titled “both-editions”A directory with both a Cargo.toml and a Maven or Gradle build, where either edition could run.
Say which with --edition.
mutastic run bothmutastic: /home/you/project/both has both Cargo.toml and pom.xml, so either edition could read it: say which with --edition=rust or --edition=javaswift-edition
Section titled “swift-edition”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.
mutastic run shopmutastic: 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 runbuild-failed
Section titled “build-failed”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.
copy-build-failed
Section titled “copy-build-failed”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.
red-baseline
Section titled “red-baseline”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.
tests-stopped
Section titled “tests-stopped”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.
tests-timed-out
Section titled “tests-timed-out”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.
no-tests
Section titled “no-tests”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.
nothing-covered
Section titled “nothing-covered”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.
java-edition
Section titled “java-edition”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.
proc-macro
Section titled “proc-macro”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.
internal
Section titled “internal”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.