#!/usr/bin/env bash # Plays bot-only duos matches on a run of seeds, under nice, and prints one JSON line per # match, a summary and the verdict. See tools/duo_matches.gd for what is checked. # # tools/duo_matches.sh seeds 1 to 10 # DUO_MATCH_SEEDS=5 DUO_MATCH_FIRST=40 tools/duo_matches.sh set -uo pipefail cd "$(dirname "${BASH_SOURCE[0]}")/.." count="${DUO_MATCH_SEEDS:-10}" first="${DUO_MATCH_FIRST:-1}" raw="$(nice -n 15 tools/godot.sh --script res://tools/duo_matches.gd -- --seeds="$count" --first="$first" 2>&1)" code=$? grep -E '^\{|^duo-matches' <<<"$raw" if [[ "$code" -ne 0 ]] && ! grep -q '^duo-matches' <<<"$raw"; then echo "duo-matches FAIL: the run exited $code" tail -n 15 <<<"$raw" fi exit "$code"