#!/usr/bin/env bash # tests/fix-round-4-5b-red.sh # The red proof of fix round 4-5b (brief: fixed boundary 4), as a wrapper over # the shared red script tests/helpers/red-round.sh. Every id of the round has # tests whose names start with "[id]"; each of them must fail on an assertion # at the round's start point be0b631, or, for an id a mutation names, under # that mutation. # This wrapper passes the shared script: # --base BASE, --ids IDS (the round's 41 ids), the round's FILES; # --other-ids: the ids of fix round 4-5a, read with sed from the IDS= line # of tests/fix-round-4-5a-red.sh (a tag on that list is not judged); # --mutations tests/fix-round-4-5b-mutations.mjs (its ids are pass-ids at # the start point and are proven red under their mutations); # --require-sha256: the round has SHA-256 tests, so a git that cannot # create a SHA-256 repository is a setup failure, not a silent skip. # The shared script clones the start point outside the repo, puts the working # tree's tests/ in it, runs every tagged test of the files once, lets # tests/helpers/red-judge.mjs decide, then applies each mutation, runs that # id's tests, judges and restores. # Exit 0 all red, 1 a rule broken (the judge names it), 2 a setup failure # (also: no ids on the 4-5a IDS= line); never 0 on a setup failure. # bash 3.2 compatible, ASCII only, no arrays. set -u set -f cd "$(dirname "$0")/.." || { echo "red script: setup failure: cannot cd to the repo root" >&2; exit 2; } ROOT="$(pwd -P)" BASE=be0b631fed21942b6c0fdae570b58e4112f8242d IDS='M6 M11 M4 m4 M3 M7 M7r E22c E22e M5 S3 E20 M9 M2 K3 M1 M1r E23a E23b E23d E23f M8 M10 DJ5 M13 K2 DJ1 DJ2 DJ4 DJ4r E14 E16a E17a E17b E18a Da Db K4 ARG PTR RS' FILES='tests/lib/verdict-gate.test.mjs tests/lib/done-line.test.mjs tests/lib/park-attempt-files.test.mjs tests/scripts/trekreview-armb-workflow.test.mjs tests/lib/coordinator-contract.test.mjs tests/lib/red-judge.test.mjs tests/lib/red-script.test.mjs tests/lib/review-recurrence.test.mjs tests/lib/arg-parser.test.mjs tests/commands/trekendsession.test.mjs tests/validators/next-session-prompt-validator.test.mjs tests/lib/fix-round-4-5b-prose.test.mjs tests/lib/fix-round-4-5a-prose.test.mjs tests/scripts/release-check.test.mjs' OTHER=$(sed -n "s/^IDS='\(.*\)'\$/\1/p" "$ROOT/tests/fix-round-4-5a-red.sh") if [ -z "$OTHER" ]; then echo "red script: setup failure: no ids on the IDS= line of $ROOT/tests/fix-round-4-5a-red.sh" >&2 exit 2 fi exec /bin/bash "$ROOT/tests/helpers/red-round.sh" --base "$BASE" --ids "$IDS" --other-ids "$OTHER" --mutations "$ROOT/tests/fix-round-4-5b-mutations.mjs" --require-sha256 $FILES