#!/bin/sh
set -eu
cd "$(dirname "$0")"
go version
go test ./...
go test -race ./...
go vet ./...
CGO_ENABLED=0 go build -trimpath -o api .
./api runtime
GOMAXPROCS=3 ./api runtime
./api memory
python3 signal_check.py
if CGO_ENABLED=0 go build -o cgo-negative ./negative/cgo > cgo-negative.log 2>&1; then
 echo 'unexpected cgo build success'; exit 1
fi
cat cgo-negative.log
CGO_ENABLED=1 go run ./negative/cgo
