Matches the project structure and binary name defined in the Deklarix product spec. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
28 lines
708 B
Bash
Executable File
28 lines
708 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Deklarix — Test-Skript
|
|
#
|
|
# Führt alle Go-Tests aus + Vet + Build-Check.
|
|
# Wird auch im CI/vor jedem Release ausgeführt.
|
|
|
|
set -euo pipefail
|
|
|
|
REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
export PATH=$PATH:/usr/local/go/bin
|
|
|
|
GRN='\033[0;32m'; RED='\033[0;31m'; NC='\033[0m'
|
|
log() { echo -e "${GRN}[test]${NC} $*"; }
|
|
fail() { echo -e "${RED}[FAIL]${NC} $*"; exit 1; }
|
|
|
|
cd "$REPO_DIR"
|
|
|
|
log "go vet ..."
|
|
go vet ./... || fail "go vet fehlgeschlagen"
|
|
|
|
log "go test ./... "
|
|
go test -race -count=1 ./... || fail "Tests fehlgeschlagen"
|
|
|
|
log "Build-Check (amd64) ..."
|
|
GOARCH=amd64 GOOS=linux go build -o /dev/null ./cmd/deklarix/ || fail "Build fehlgeschlagen"
|
|
|
|
log "Alle Tests bestanden ✓"
|