#!/bin/sh
# script/test: run the test suite. Reruns verbosely on failure so CI
# logs show which test failed.
set -eu

ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"

main() {
    cd "$ROOT"
    go test -timeout 30s -cover ./... || {
        echo "--- Rerunning with -v for details ---"
        go test -timeout 30s -v ./...
        exit 1
    }
}

main "$@"
