Expand description
#2842: the driver’s half of snapshot testing.
The compiler inlines each suite file’s stored snapshots into its test module
and the harness compares against them, reading nothing at test time. Only the
driver writes: under --update-snapshots the runner hands back, per snapshot
file, its counts and (when the file changes) the text to write, and
SnapshotRun::settle writes or deletes the files. A snapshots/ file no
suite takes a snapshot into any more is obsolete as a whole; the build says
which files are live (crate::project::ProjectOutput::snapshot_files).
Structs§
- Counts
- What a run did to the project’s snapshots, as the report states it: in every
output format (
snapshotsin the JSON document and the NDJSONrun-end).obsoletecounts snapshots no case takes any more — removed under--update-snapshots, otherwise left and reported. - File
Report - One snapshot file’s part of the runner’s report.
- Report
- The runner’s report: every selected module’s snapshot files.
- Snapshot
Run - The project’s snapshots for one run: which files the build takes snapshots into, and what is stored.
Enums§
Constants§
- REPORT_
ENV - Environment:
1makes the human-format runner print the report line.1when the driver wants the snapshot files a run touched reported. - REPORT_
MARKER - The marker the human-format runner puts at the start of the one line that
carries the report (
BYNK_SNAPSHOT_REPORT=1). - UPDATE_
ENV - Environment:
1makes the runner record rather than compare.1whenbynk test --update-snapshotsrewrites snapshots.