Skip to main content

Module gate

Module gate 

Source
Expand description

Step 5: the definition of done for one port.

fmt, clippy (warnings are errors), cargo tests, no unexplained unsafe, every function ported, the built module exposes the original API, and the recorded behavior replays cleanly.

Structs§

Check
GateOutcome
TestCounts
Tests and assertions in the crate (src/ without the bindings, and tests/).

Constants§

MAX_GROWTH
How many times the source’s lines the port may take before gate calls it bloated, plus a fixed allowance for the imports and signatures every port has.

Functions§

gate
literals_check
Recorded values written into the port as literals although the original never spells them out: a port that answers the recorded cases from a table passes diff without porting anything. Fails on LITERALS_FAIL or more, or on any read of the recording itself; fewer pass with their names. A literal on a line with // recorded-literal: <reason> is left out. Recorded error text is left out too: the runtime often writes it (division by zero), and the port has to reproduce it.
ported_check
No function in src/port.rs is still unimplemented!.
rust_checks
The checks that hold for any Rust crate, bindings or not: fmt, clippy (warnings are errors), cargo test, and unsafe only with a // SAFETY: comment.
save_tests_baseline
Saves the crate’s test counts as the baseline the next tests check compares with.
test_counts
tests_check
Fails when tests or assertions were removed, or tests ignored, since the last passing gate: weakening the tests is not a way to pass.
text
Format the text output for a GateOutcome. Every check’s detail begins in the same column by padding check names to the longest check name.