Skip to main content

Crate foch_test

Crate foch_test 

Source
Expand description

In-game tests for EU4 mods, modeled on pytest and Rust’s test harness.

The library computes; its caller does input and output. It never walks directories, reads configuration, launches processes or prints. A run is a sequence of plain-data stages, each testable on its own:

SourceFile ─collect→ Collection ─expand→ Expanded ─lint→ LintResult
                                             └──────group──→ Plan
Plan ─compile→ Bundle ─(caller runs the runner)→ RunArtifacts ─judge→ CaseResult
CaseResult* ─→ Report

judge is the single place that decides whether a case passed. Sharing a game session between cases is an optimization decided by group from each case’s declared needs and its estimated footprint; a case’s verdict must not depend on it.

Re-exports§

pub use collect::Collection;
pub use collect::collect;
pub use compile::Bundle;
pub use compile::RunContext;
pub use compile::RunnerCapabilities;
pub use compile::check_capabilities;
pub use compile::compile;
pub use diagnostic::Diagnostic;
pub use diagnostic::DiagnosticCode;
pub use diagnostic::blocks_run;
pub use judge::CaseResult;
pub use judge::RunArtifacts;
pub use judge::RunnerExit;
pub use judge::Status;
pub use judge::Timing;
pub use judge::judge;
pub use judge::reconcile;
pub use lint::Footprint;
pub use lint::LintResult;
pub use lint::ProjectFacts;
pub use lint::lint;
pub use plan::ExpandOptions;
pub use plan::Expanded;
pub use plan::GroupOptions;
pub use plan::Plan;
pub use plan::expand;
pub use plan::group;
pub use report::Report;
pub use select::Selector;
pub use source::SourceFile;
pub use source::SourceKind;

Modules§

collect
Collect cases, fixtures and events from source text.
compile
Generate the test layer and launch description for one game session.
diagnostic
Problems found before a game is launched.
judge
Turn what a runner produced into one status per case.
lint
Checks before launching the game, and what each case may touch.
model
The test model shared by every stage.
plan
From collected cases to game sessions.
report
Summaries and machine-readable output of a completed run.
select
Choosing cases: node-ID prefixes, -k keyword and -m mark expressions.
source
Source text handed to the library by its caller.

Structs§

RelPath
A /-separated path relative to the mod root, without . or .. segments. It never names a location outside the mod.

Enums§

Severity