#!/usr/bin/env bash
set -eu
cd "$(dirname "$0")/testing"
echo '== unit, fake, recorder, cleanup =='
go test -count=1 -v ./...
echo '== real HTTP boundary, fake storage =='
go test -count=1 -tags=integration -v ./...
echo '== race and vet =='
go test -count=1 -race -tags=integration ./...
go vet -tags=integration ./...
echo '== coverage =='
go test -count=1 -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
echo '== benchmark: three local observations, not a comparison =='
go test -run='^$' -bench=BenchmarkTotal -benchmem -benchtime=100ms -count=3
echo '== bounded fuzz =='
go test -run='^$' -fuzz=FuzzTotal -fuzztime=2s -parallel=2
echo '== helper callsite: expected failure =='
if go test -tags=demonstratefailure -run=TestHelperLocation -count=1; then exit 1; else echo expected_failure=true; fi
