#!/usr/bin/env bash # Checks that Voyager is the same machine as SplitBit. # # They share every line of the machine and differ only in what they present, and the way to # keep that true is to make the claim testable rather than to promise it in a comment. So # this runs the WHOLE MANIFEST through Voyager and holds it to the recorded results that # SplitBit is held to - not that the two look alike, but that one satisfies every recording # the other does, byte for byte, exit status included. # # It reuses Tests/run.sh rather than repeating it. A copy of the runner that drove the other # binary would drift from this one, and the first thing to go would be whichever awkward # case was added to only one of them. # # Voyager needs a window, and a machine running tests usually has no display, so it is run # with --headless. That flag exists for this: a front end that could only be exercised by a # person looking at it would be a front end nothing checks. # # Written by Anachronaut set -u ROOT="$(cd "$(dirname "$0")/.." && pwd)" # ---- Not built is not a failure ---- # # Voyager is built only where Raylib is, and the whole point of the split is that everything # else works without it. A suite that failed here on a machine with no graphics library # would be enforcing exactly the dependency the split exists to avoid. if [ ! -x "$ROOT/Voyager" ]; then echo "Voyager is not built, so it was not checked. Raylib is what it needs." exit 0 fi echo "Checking that Voyager is the same machine." SPLITBIT_EMULATOR="$ROOT/Voyager" SPLITBIT_EMULATOR_ARGS="--headless" "$ROOT/Tests/run.sh" \ | tail -3 exit "${PIPESTATUS[0]}"