Raxol.RATE (Raxol v2.6.1)

View Source

RATE: Raxol Automated Testing Environment (golden render harness).

Modeled on FFmpeg's FATE, adapted for Raxol. Renders a corpus of deterministic fixtures through the pure Raxol.UI.Renderer.render_to_cells/1 path, canonically serializes the resulting cell grid, and hashes it (SHA-256). Reference hashes are committed under priv/rate/golden.refs; verify/0 compares the current render against them.

The render path uses no NIF, wall clock, or randomness, so a fixture hashes identically across architectures; an x86_64/aarch64 divergence is a determinism bug.

Run via mix raxol.rate (compare) or mix raxol.rate --gen (regenerate references). The golden test in test/rate/golden_test.exs runs the same corpus inside the normal suite, so CI exercises it on every arch it builds on.

Summary

Functions

Regenerate priv/rate/golden.refs from the current render (dev only).

The parsed reference map (name => hash).

Render every fixture, returning [{name, hash}] sorted by name.

Compare the current render against the committed references.

Functions

generate()

@spec generate() :: :ok

Regenerate priv/rate/golden.refs from the current render (dev only).

load_refs()

@spec load_refs() :: %{optional(String.t()) => String.t()}

The parsed reference map (name => hash).

run()

@spec run() :: [{String.t(), String.t()}]

Render every fixture, returning [{name, hash}] sorted by name.

verify()

@spec verify() :: {:ok, [{String.t(), String.t()}]} | {:error, map()}

Compare the current render against the committed references.

Returns {:ok, results} when everything matches, or {:error, %{mismatches: [...], missing: [...]}}.