For a value it does not know, proptest prints a warning and falls back
to ChaCha, so a reproduction run with a misspelled algorithm used a
different generator and could pass. `config` now parses the variable
itself: `xs`, `cc` and `rc` select their generators, `pt` and any other
value make it panic, and an unset variable keeps the generator from
`Config::default()`.
`TempDir::new_in` passed the root to `tempfile` as given, so when the root was
reached through a link that changed during the test, `path()` named the old
folder while drop and `close()` resolved the link again: the folder that was
made stayed and a folder with the same name under the new target could be
removed. The root is now canonicalized before the folder is made, and the
symlink-root test retargets the link before the drop.
On Unix a umask that removes owner read, write or search permission left the
new folder unusable (for example mode 0o300) while `TempDir::new` returned
Ok, since the owner probe needs only write and search; cleanup then failed.
`check` now returns PermissionDenied unless the owner has all three, before
the probe runs.
`TempDir::new` and `TempDir::file` also return InvalidInput for `<`, `>`,
`"`, `|`, `?`, `*` and control characters, which Windows does not allow in a
file name, on every platform. The README and doc comments list them.
The pass-through generator reads caller-supplied bytes instead of a u64
seed, so a runner built from `config` with `PROPTEST_RNG_ALGORITHM=pt`
panicked inside proptest with a message that did not name the variable.
`config` now panics with a message naming `PROPTEST_RNG_ALGORITHM`.
New child-process tests cover the rejected `pt` value and check that the
XorShift generator (`xs`) is kept with the pinned seed and repeats its draws.
`prop::config` uses `Config::rng_seed` and `RngSeed`, which proptest added
in 1.7, so the workspace requirement moves from "1" to "1.7". The locked
1.12.0 already satisfies it.
The README now says that `config` keeps the generator chosen by
`PROPTEST_RNG_ALGORITHM`, and that repeating a failing run needs the same
algorithm and other `PROPTEST_*` settings as well as the seed and count.
temp.rs calls TempDir::disable_cleanup, which tempfile 3.20.0 added, so
the dependency now asks for 3.20. The crate docs no longer link
temp::TempDir, which is not built for wasm32, and say the folder is
private on Unix and that removal on drop is best effort. The READMEs say
the same, that the umask can remove more bits from the requested 0o700,
and that the Unix check reads mode bits only, not access control lists.
The README's process-wide capture example called drop_the_plugin
without defining it, so a copied test did not compile. The example now
defines it as a function that logs a warning containing the text the
assertion looks for.
generate and generate_with no longer keep their own required variable
and skip_or_fail. A fixture that cannot be made now goes through
skip::skip with the variable generate is given (default
CRAFT_TEST_REQUIRED): unset or empty prints `SKIPPED: <reason>`, `1`
fails the test, and any other value, `0` included, fails it as a
configuration error. generate_with keeps the caller's required value
and prints the same skip line. The README paragraph and the test of the
variable's values follow the new rule.
The limit restarted after every call of the condition, so a thread that
kept raising the signal while the condition stayed false held wait_until
forever. The limit now counts from the start of the call, and each wait
lasts at most the time left. The condition is still called before the
limit is checked, so a condition that holds never fails.
Two tests cover it: an injected clock with a wait that always reports a
raise, and a real thread raising in a loop under with_deadline. Both
fail without the change.
with_deadline failed a body that returned or panicked after its limit, and
hammer failed a case that finished after its per-case limit, so a slow
runner could fail a test whose code was correct. Both now take whatever the
body or case produced, however late it arrives, and fail on the limit only
when nothing has arrived by then.
wait_until polled its condition with sleeps against a clock and failed a
true that came after the limit. It now takes a Signal: the condition is
called at once and again each time another thread calls Signal::raise, and
the limit only fails a wait that saw no raise in that time. A raise made
while the condition runs is not lost. No crate in this workspace calls
wait_until.
The tests use an injected wait for the limit and an injected clock instead
of real 50 ms limits, and new tests cover a value or panic that arrives
after the limit, a case that finishes after its limit, and a raise during
the condition. The tests of the removed behavior (a late result fails, the
pause schedule of the polling loop) are replaced by these.
pinned now fails the test when the folder variable name is empty or
holds `=` or a NUL character, before the environment is read, instead
of reading it as unset and skipping. The docs of verify and the README
also state what the containment check after the open covers on each
platform, that an Apple path query error fails verification, and that
the manifest parser does not check names against a file system's rules.
On Windows the folder gets the inheritable access entries of the
temporary directory and is not checked. The module docs and README now
say so, and that a TMP or TEMP naming a shared folder may let other
users open it.
close waited for the stderr thread only as long as close_grace, so with a
short or zero grace the bytes still in the pipe when the child exited could
be missing from CloseOutcome::stderr. It now waits up to 5 s after the child
exits, and only a process that keeps the child's stderr open waits that long.
skip::craft_fonts_cover and its tests need the new font-coverage feature,
so a crate that dev-depends on craft-testkit no longer builds skrifa
unless it asks for the feature. skrifa comes from the workspace
dependency. skip::required is the one parser for a required variable:
unset or empty is optional, 1 is required, and every other value is a
configuration error.