Update generator tier tooling
This commit is contained in:
parent
18e14a5b67
commit
2d75fa9d86
12 changed files with 61 additions and 44 deletions
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
# compile-gate.sh — the generator's primary acceptance gate.
|
||||
#
|
||||
# Generates the tier's monorepo from regression/tierN/config.toml, then requires the
|
||||
# Generates the selected tier's monorepo from regression/tierN/config.toml, then requires the
|
||||
# generated package to `swift build` with ZERO errors. Pass/fail only: error
|
||||
# counts are not a metric. Also diffs each module's skip report against the
|
||||
# committed baseline in regression/tierN/ (JSON files only) so that new
|
||||
|
|
@ -11,12 +11,14 @@
|
|||
# scripts/compile-gate.sh <tier|all> [--fresh]
|
||||
#
|
||||
# <tier> 1..6 (tier1 = GLib+GObject ... tier6 = full stack), or 'all'
|
||||
# --fresh remove the tier's output directory before generating (use when
|
||||
# the generated file set shrinks and stale files would linger)
|
||||
# 'all' is the full-stack tier-6 alias and only generates tier 6
|
||||
# --fresh remove the selected tier's output directory before generating
|
||||
# (use when the generated file set shrinks and stale files would linger)
|
||||
#
|
||||
# Output goes to ${TMPDIR:-/tmp}/gobject-generator-gate/tier-N; a stable path so
|
||||
# incremental swift builds stay fast between runs.
|
||||
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
|
@ -32,7 +34,7 @@ if [[ -z "$TIER_ARG" ]]; then
|
|||
fi
|
||||
|
||||
if [[ "$TIER_ARG" == "all" ]]; then
|
||||
TIERS=(1 2 3 4 5 6)
|
||||
TIERS=(6)
|
||||
else
|
||||
TIERS=("$TIER_ARG")
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,15 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
# smoke-test.sh — runtime smoke tests for the generated bindings.
|
||||
# smoke-test.sh - runtime smoke tests for the generated bindings.
|
||||
#
|
||||
# The compile gate proves the generated Swift type-checks. This goes further:
|
||||
# it generates a tier's bindings, links them against the REAL C libraries via
|
||||
# pkg-config, and runs hand-written swift-testing cases from
|
||||
# regression/tier<N>/*.swift (plus regression/tier1/SmokeTests.swift for all tiers)
|
||||
# it generates a selected tier's bindings, links them against the REAL C libraries via
|
||||
# pkg-config, and runs hand-written swift-testing cases from the selected tier's
|
||||
# regression/tier<N>/*.swift files. Tier 6 installs every tier's fixtures into one
|
||||
# full-stack package.
|
||||
#
|
||||
# Usage: scripts/smoke-test.sh [tier] [--fresh]
|
||||
# Usage: scripts/smoke-test.sh [tier|all] [--fresh]
|
||||
#
|
||||
# tier 1..6 (default 1). tier1 = GLib+GObject, tier2 = +GModule+Gio, …
|
||||
# --fresh wipe the tier's output directory before generating
|
||||
# tier 1..6 (default 1). tier1 = GLib+GObject, tier2 = +GModule+Gio, ...
|
||||
# tier 6/all installs the accumulated fixtures from tiers 1 through 6
|
||||
# all alias for tier 6
|
||||
# --fresh wipe the selected tier's output directory before generating
|
||||
#
|
||||
# Output goes to ${TMPDIR:-/tmp}/gobject-generator-smoke/tier-<N> (a stable path so
|
||||
# incremental swift builds stay fast between runs).
|
||||
|
|
@ -28,6 +31,18 @@ for arg in "$@"; do
|
|||
fi
|
||||
done
|
||||
|
||||
if [[ "$TIER" == "all" ]]; then
|
||||
TIER="6"
|
||||
fi
|
||||
|
||||
if [[ "$TIER" == "1" ]]; then
|
||||
SMOKE_TIERS=(1)
|
||||
elif [[ "$TIER" == "6" ]]; then
|
||||
SMOKE_TIERS=(1 2 3 4 5 6)
|
||||
else
|
||||
SMOKE_TIERS=(1 "$TIER")
|
||||
fi
|
||||
|
||||
CONFIG="$ROOT/regression/tier${TIER}/config.toml"
|
||||
OUT="${TMPDIR:-/tmp}/gobject-generator-smoke/tier-${TIER}"
|
||||
|
||||
|
|
@ -48,9 +63,9 @@ echo "==> Generating tier $TIER bindings (with SmokeTests target) into $OUT"
|
|||
|
||||
echo "==> Installing smoke tests"
|
||||
mkdir -p "$OUT/Tests/SmokeTests"
|
||||
# Install foundational tier1 smoke tests (GLib/GObject) plus tier-specific tests.
|
||||
cp "$ROOT/regression/tier1/SmokeTests.swift" "$OUT/Tests/SmokeTests/"
|
||||
cp "$ROOT/regression/tier${TIER}/"*.swift "$OUT/Tests/SmokeTests/"
|
||||
for smoke_tier in "${SMOKE_TIERS[@]}"; do
|
||||
cp "$ROOT/regression/tier${smoke_tier}/"*.swift "$OUT/Tests/SmokeTests/"
|
||||
done
|
||||
|
||||
echo "==> Running smoke tests against the real C libraries"
|
||||
swift test --package-path "$OUT"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue