#!/usr/bin/env bash set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" SCRIPT="$REPO_ROOT/scripts/check-manifests.sh" PASS=0 FAIL=0 pass() { echo " PASS: $1"; PASS=$((PASS + 1)); } fail() { echo " FAIL: $1"; FAIL=$((FAIL + 1)); } # Several distinct faults all end in exit 1, and the bugs fixed below were precisely # about the WRONG one being reported (a corrupt manifest blamed on six unlisted plugin # directories, a legal manifest blamed for unresolvable paths). Exit-code-only # assertions cannot see that, so these cases assert on the message text. RUN_OUT="" RUN_RC=0 run_script() { RUN_OUT="$(bash "$SCRIPT" "$1" 2>&1)" && RUN_RC=0 || RUN_RC=$?; } # assert_fails_with