Expand description
Generated artifacts from markdown code blocks: one integration-test target per package with a module per page (plain rust blocks), and one example per package with a module per capture block. CI compares regenerated content against disk, so stale artifacts fail.
Structs§
- Generated
- One generated file, its path relative to the package directory.
Constants§
- CAPTURE_
DIR - The one example target every capture block of a package compiles into.
- CAPTURE_
DISABLED - Exit status of the capture example for a block whose
feature=tag is not enabled in this build. The stderr line starts with the sentinel. - CAPTURE_
EXAMPLE - Cargo’s name for the
CAPTURE_DIRexample. - CAPTURE_
UNKNOWN - Exit status of the capture example for a block id it does not contain.
- DOC_
TESTS_ DIR - The one integration-test target the doc tests of a package compile into.
- GENERATED_
HEADER - First line of every generated file;
docs checkuses it to tell generated artifacts from hand-written ones. - OWNED
- Where generated files live, as (directory, file-name prefix, replaced by),
relative to the package directory. A file there that starts with
GENERATED_HEADERbelongs to gen-tests: it is rewritten when expected and removed when not. An entry with an empty prefix is a target directory gen-tests owns outright; a prefixed entry is the per-page or per-block layout of earlier releases and names the target directory that replaced it.
Functions§
- capture_
ids - Block ids for one page’s capture blocks, in capture order: the argument the capture example takes to run that block.
- capture_
set - Every capture file a package needs: one
block_<id>.rsmodule per capture block underCAPTURE_DIR, and themain.rsthat runs the block its first argument names. Empty when no page has a capture block. - doc_
test_ set - Every doc-test file a package needs: one module per page with testable
blocks under
DOC_TESTS_DIR, and themain.rsthat declares them. Empty when no page has a testable block. An error names two pages whose paths sanitize to the same module. - owning_
target - For
rel_path(relative to the package directory) in a place gen-tests writes, perOWNED: the target directory it belongs to, and whether it is a leftover of the layout that target replaced. The file’s header decides ownership. - recorded_
source - The page a generated file was generated from, and the line of the block
when it is one block’s file, read from its
// source: PAGE[ line N]line. - sanitized_
stem docs/measuring.md→soothfast_doc_docs_measuring.- test_
file - Module content for one markdown page’s doc tests, or None when it has no testable blocks (all ignored / non-rust / capture).