#!/bin/sh
# script/test: run the test suite.
set -eu

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

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

main "$@"
