On this page
  1. Every time
    1. rmp fmt
    2. rmp lint
    3. rmp test
  2. When the change calls for more
  3. The same, inside the image
  4. Seen red first
  5. When the change is visual, look at it
  6. Say what ran

The verification ladder

A change is proved by running it, not by reading it: almost every bug this framework has had was found by looking at pixels, dumping a file or writing an assert. The ladder is what to run before a change leaves your machine, cheapest first, so that CI confirms what you already know instead of telling you something new twenty minutes later.

Every time#

rmp fmt
rmp lint
rmp test

All three run on your laptop, and all three have to end clean. Not mostly clean: a warning left for later is the one the next change hides behind.

rmp fmt#

Formats every C and C++ file under include/, src/, tests/ and examples/ with the clang-format the framework pins. rmp fmt check only reports the files it would change, which is what rmp test and CI do. Do not format by hand, and do not reformat a file you are not otherwise changing.

rmp lint#

Runs clang-tidy over src/, tests/ and examples/, and over the C the tools and the build compile, with the framework's .clang-tidy. What the tree still owes the style guide is written down in tools/lint_debt.txt, a count per check and file, and the run is held to it: a warning nobody owes fails, and so does a count that grew. After a change that pays some of it off, lower the file to what is left:

bash tools/lint.sh debt

Nothing is ever added to it. A new warning is fixed, or silenced on its line with // NOLINT(check) and the reason beside it. rmp lint fix applies what clang-tidy is sure of and formats the result; read every change it makes, because some of its fixes are wrong. What checks what lists every check and where it holds.

Two of the checks are the framework's own, and clang-tidy runs them only with --experimental-custom-checks; rmp lint passes it. A clang-tidy run by hand without the flag registers neither and says nothing about it.

rmp test#

Runs every stage below in this order and stops at the first that fails. Name a stage to run only that one; the first failure is usually all you need to run again.

StageWhat it checks
rmp test fmtevery file is clang-format clean
rmp test configthe .toml, the pinned versions — your clang tools among them — and every licence
rmp test repogit tracks sources, not build output
rmp test seamnothing in src/rmp reads the clock, the input or the random state by itself
rmp test workflowsevery reusable workflow gets what it asks for
rmp test portablethe scripts run on macOS's bash 3.2 and on the BSDs
rmp test shellno A && B || C in a script
rmp test namingthe names, in every branch of every #if
rmp test stylethe rules of the style guide clang-tidy cannot see, in every branch
rmp test ownershipnothing allocated or freed by hand, raylib's loads only in their owners
rmp test pointersno raw pointer and no C string a game can name
rmp test cppcheckcppcheck finds nothing in src/rmp, and each suppression says why
rmp test headersevery public header compiles on its own
rmp test costwhat each public header costs to include
rmp test gateseach gate above, seen red on a mistake planted in a copy of the tree
rmp test configuretools/configure.py, every refusal
rmp test rmpthe rmp command itself, and rmp new's manifest
rmp test binariesthe readers that judge a shipped .exe and Mac binary
rmp test sizeevery shipped binary has a size budget, and its reader works
rmp test unitthe unit tests, in order and then shuffled, and tests/game/
rmp test layoutthe UI laid out at four resolutions, with no window
rmp test propertythe test campaign's own checks, RapidCheck at its fixed seed, Hypothesis derandomized
rmp test ui-renderthe UI on a real GPU: a hidden window, read back
rmp test rendera frame drawn in software, checked and hashed
rmp test smokethe game built, booted and seen to draw, with no mistake reported

Commands has the list as rmp help test prints it, and Testing what each stage does in detail. Every stage is also a step of CI, in the lint job or in a job of its own, and a test holds the two lists to each other.

When the change calls for more#

Some stages are left out of rmp test because they take minutes or hours, and run only when named. The examples are the clearest case: building all of them on every check would keep a laptop compiling a folder that only grows. Run each of these when the change is the kind it is for:

RunWhen the change touchesWhat it does
rmp test examplesthe public API, objects, collision, maps, scenes, input, the UI, or an examplebuilds every example for the software renderer, boots each one and saves a screenshot, plays the platformer to the flag at 60 and 240 Hz, and plays every e2e script
rmp test sanitizeanything that parses, casts, indexes or freesthe unit and layout tests again, built by GCC under its AddressSanitizer and UndefinedBehaviorSanitizer, every warning an error: a second compiler finds what the first passed over
rmp test fuzza reader of files: saves, rmp::Value, LDtk, Tiled, Aseprite, the resource pack, the loaderevery fuzz target built in build/fuzz, and every committed input replayed under the sanitizers; it fails unless every file ran
rmp test coverageany code in src/rmp/, and any test of itthe tests built with Clang's coverage, every file held to its floor and every public function to having a test that calls it — a gate in the build image only
rmp test mutationrarely by hand: it takes hours, in the build imageMull and mutmut over every module, each against its floor; bash tools/mutation.sh run MODULE does one
rmp test render-updatethe demo's frame, on purposerecords the frame's hash as the new golden
rmp test e2e-updatean e2e shot, on purposerecords every shot as its golden, inside the build image only

Outside the image, rmp test examples plays every script and reports a shot that differs from its golden without failing: outside the pinned build image: a difference is reported, not enforced. The goldens are drawn by the image's compiler and renderer, and a pixel of difference anywhere else proves nothing either way. A golden recorded on purpose is looked at, picture by picture, before it is committed.

The tests, examples and e2e, properties, fuzzing and mutation and coverage and gates pages say how to write what each of these runs, and how to update a floor that a change has earned.

The same, inside the image#

Your laptop is not CI. Before a pull request that changes C++, the build, or anything the image-only checks hold, run the ladder again in the pinned build image, on a checkout of its own, as Setting up shows:

IMAGE=ghcr.io/omardev29/raylib-build@$(sed -nE 's/^build_image_digest +//p' thirdparty/FROZEN_VERSIONS.md)
repo_git=$(git rev-parse --path-format=absolute --git-common-dir)
podman run --rm --init --network=none \
    -v "$PWD":/work -v "$repo_git":"$repo_git":ro -w /work "$IMAGE" \
    bash -c 'python3 tools/configure.py >/dev/null && xvfb-run -a ./rmp test'

Replace ./rmp test with ./rmp test examples or ./rmp test coverage for the stages that are exact only there. The display xvfb-run provides is what the UI render test and the smoke boot open their window on; without one, the boot fails inside raylib's window code under the sanitizers instead of saying what is wrong.

Seen red first#

A test you have not seen fail is a hope with a name. Every test and every gate is seen red on the mistake it exists for before its green counts:

  1. Write the test, or the gate.
  2. Put the mistake back: revert the fix, or plant the error by hand. Check that the text you changed was found exactly once, because a plant that did not apply proves nothing.
  3. Run it. It has to fail, and its message has to name the mistake: a FAIL line that says what it found, not a crash somewhere near it.
  4. Take the mistake out again, and see it pass.
  5. Write down what you saw: the command, and the line it failed with. It goes in the commit message and in the pull request.

rmp test gates does this for every tools/*_check.sh on every run: each gate is copied with what it reads into a scratch tree, a mistake of its kind is planted, and the gate has to say FAIL and name it. A new gate fails that stage until it has a planted mistake of its own.

When the change is visual, look at it#

An assert proves the boxes are where you said; it does not prove the screen looks right. rmp test examples leaves a screenshot of every example in build/examples-check/screenshots/, and, for every e2e shot that differs, the expected picture, the actual one and their difference in build/examples-check/e2e/. Open them.

rmp example 01_pong

builds one example and runs it in a window, by name or by its path under examples/; rmp example alone lists them.

Say what ran#

Report what actually happened: which stages ran, where — the laptop or the image — and what was skipped and why. A stage that skipped for a missing tool did not pass. For CI, name the run: a run number and its result is a fact, "CI passes" is a claim. The pull request template asks for exactly this, and Pull requests says how it is filled in.

Next: CI.