From 2d75fa9d86162737da84c698b0f15209df19ffff Mon Sep 17 00:00:00 2001 From: Brendan Szymanski Date: Tue, 11 Aug 2026 17:39:02 -0400 Subject: [PATCH] Update generator tier tooling --- regression/tier1/SmokeTests.swift | 6 ++--- regression/tier2/InterfaceSmoke.swift | 6 ++--- regression/tier3/PangoSmoke.swift | 6 ++--- regression/tier3/PixbufSmoke.swift | 6 ++--- regression/tier4/GdkSmoke.swift | 6 ++--- regression/tier4/GskSmoke.swift | 6 ++--- regression/tier5/GtkSmoke.swift | 6 ++--- regression/tier6/AdwSmoke.swift | 6 ++--- regression/tier6/GstSmoke.swift | 6 ++--- regression/tier6/SoupSmoke.swift | 6 ++--- scripts/compile-gate.sh | 10 +++++--- scripts/smoke-test.sh | 35 +++++++++++++++++++-------- 12 files changed, 61 insertions(+), 44 deletions(-) diff --git a/regression/tier1/SmokeTests.swift b/regression/tier1/SmokeTests.swift index b939a97..dbf4f64 100644 --- a/regression/tier1/SmokeTests.swift +++ b/regression/tier1/SmokeTests.swift @@ -6,9 +6,9 @@ // actually reachable and correct *through the wrappers* — real GLib/GObject // symbols, linked via pkg-config, invoked at runtime and their results checked. // -// This file is not generated. `scripts/smoke-test.sh` generates the tier-1 -// bindings with a SmokeTests target and copies this file in before running -// `swift test`. +// This file is not generated. `scripts/smoke-test.sh` copies the selected tier's +// fixtures into the SmokeTests target; tier 6/all copies every tier's fixtures +// into one full-stack package. import Testing diff --git a/regression/tier2/InterfaceSmoke.swift b/regression/tier2/InterfaceSmoke.swift index bcd4bdc..7a0a330 100644 --- a/regression/tier2/InterfaceSmoke.swift +++ b/regression/tier2/InterfaceSmoke.swift @@ -10,9 +10,9 @@ // `self.pointer`) reaches the real C symbol and returns the correct // result. // -// Not generated. `scripts/smoke-test.sh ` copies `regression/tier/*.swift` -// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before -// running `swift test`. Only installed for tier ≥ 2 (Gio's module). +// Not generated. `scripts/smoke-test.sh ` copies tier 1 and the selected +// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures +// into one full-stack SmokeTests target. Only installed for tier >= 2. import Testing diff --git a/regression/tier3/PangoSmoke.swift b/regression/tier3/PangoSmoke.swift index daca7ab..29dbed9 100644 --- a/regression/tier3/PangoSmoke.swift +++ b/regression/tier3/PangoSmoke.swift @@ -10,9 +10,9 @@ // strong-LTR script (Latin) and a strong-RTL script (Hebrew) and // asserting the opposite directions libpango is known to report. // -// Not generated. `scripts/smoke-test.sh ` copies `regression/tier/*.swift` -// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before -// running `swift test`. Only installed for tier >= 3 (Pango's module). +// Not generated. `scripts/smoke-test.sh ` copies tier 1 and the selected +// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures +// into one full-stack SmokeTests target. Only installed for tier >= 3. import Testing diff --git a/regression/tier3/PixbufSmoke.swift b/regression/tier3/PixbufSmoke.swift index 72c6452..c840c3b 100644 --- a/regression/tier3/PixbufSmoke.swift +++ b/regression/tier3/PixbufSmoke.swift @@ -10,9 +10,9 @@ // `gdk_pixbuf_get_height`, returning the values passed to the // constructor — not stubbed/placeholder data. // -// Not generated. `scripts/smoke-test.sh ` copies `regression/tier/*.swift` -// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before -// running `swift test`. Only installed for tier ≥ 3 (GdkPixbuf's module). +// Not generated. `scripts/smoke-test.sh ` copies tier 1 and the selected +// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures +// into one full-stack SmokeTests target. Only installed for tier >= 3. import Testing diff --git a/regression/tier4/GdkSmoke.swift b/regression/tier4/GdkSmoke.swift index 966c67a..8e7527c 100644 --- a/regression/tier4/GdkSmoke.swift +++ b/regression/tier4/GdkSmoke.swift @@ -11,9 +11,9 @@ // Both are display-free: no `GdkDisplay`/surface is created, so this runs // without a windowing backend. // -// Not generated. `scripts/smoke-test.sh ` copies `regression/tier/*.swift` -// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before -// running `swift test`. Only installed for tier >= 4 (Gdk's module). +// Not generated. `scripts/smoke-test.sh ` copies tier 1 and the selected +// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures +// into one full-stack SmokeTests target. Only installed for tier >= 4. import Testing diff --git a/regression/tier4/GskSmoke.swift b/regression/tier4/GskSmoke.swift index 6ce8889..2ebe96d 100644 --- a/regression/tier4/GskSmoke.swift +++ b/regression/tier4/GskSmoke.swift @@ -15,9 +15,9 @@ // generator (absent from regression/tier4/Gsk.json's bound set), so // `CairoRenderer()` alone carries the Gsk runtime-coverage requirement here. // -// Not generated. `scripts/smoke-test.sh ` copies `regression/tier/*.swift` -// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before -// running `swift test`. Only installed for tier >= 4 (Gsk's module). +// Not generated. `scripts/smoke-test.sh ` copies tier 1 and the selected +// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures +// into one full-stack SmokeTests target. Only installed for tier >= 4. import Testing diff --git a/regression/tier5/GtkSmoke.swift b/regression/tier5/GtkSmoke.swift index a9916b8..be05ed7 100644 --- a/regression/tier5/GtkSmoke.swift +++ b/regression/tier5/GtkSmoke.swift @@ -19,9 +19,9 @@ // is itself part of the proof that the pointer-free surface is complete // enough for real, non-toy usage. // -// Not generated. `scripts/smoke-test.sh ` copies `regression/tier/*.swift` -// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before -// running `swift test`. Only installed for tier >= 5 (Gtk's module). +// Not generated. `scripts/smoke-test.sh ` copies tier 1 and the selected +// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures +// into one full-stack SmokeTests target. Only installed for tier >= 5. import Testing diff --git a/regression/tier6/AdwSmoke.swift b/regression/tier6/AdwSmoke.swift index 454ba80..8dead5b 100644 --- a/regression/tier6/AdwSmoke.swift +++ b/regression/tier6/AdwSmoke.swift @@ -8,9 +8,9 @@ // functions never call `adw_init()`, so no GTK display connection is // required. Uses only plain-public API — no `@_spi` import. // -// Not generated. `scripts/smoke-test.sh ` copies `regression/tier/*.swift` -// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before -// running `swift test`. Only installed for tier >= 6 (Adw's module). +// Not generated. `scripts/smoke-test.sh ` copies tier 1 and the selected +// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures +// into one full-stack SmokeTests target. Only installed for tier >= 6. import Testing diff --git a/regression/tier6/GstSmoke.swift b/regression/tier6/GstSmoke.swift index 724c2f7..b53341e 100644 --- a/regression/tier6/GstSmoke.swift +++ b/regression/tier6/GstSmoke.swift @@ -8,9 +8,9 @@ // simplest possible real round-trip through the generated Gst module. Uses // only plain-public API — no `@_spi` import. // -// Not generated. `scripts/smoke-test.sh ` copies `regression/tier/*.swift` -// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before -// running `swift test`. Only installed for tier >= 6 (Gst's module). +// Not generated. `scripts/smoke-test.sh ` copies tier 1 and the selected +// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures +// into one full-stack SmokeTests target. Only installed for tier >= 6. import Testing diff --git a/regression/tier6/SoupSmoke.swift b/regression/tier6/SoupSmoke.swift index 57f8d81..f5634ef 100644 --- a/regression/tier6/SoupSmoke.swift +++ b/regression/tier6/SoupSmoke.swift @@ -8,9 +8,9 @@ // message, or network connection — display/network-free by construction. // Uses only plain-public API — no `@_spi` import. // -// Not generated. `scripts/smoke-test.sh ` copies `regression/tier/*.swift` -// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before -// running `swift test`. Only installed for tier >= 6 (Soup's module). +// Not generated. `scripts/smoke-test.sh ` copies tier 1 and the selected +// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures +// into one full-stack SmokeTests target. Only installed for tier >= 6. import Testing diff --git a/scripts/compile-gate.sh b/scripts/compile-gate.sh index 8c62a06..efe8fd4 100755 --- a/scripts/compile-gate.sh +++ b/scripts/compile-gate.sh @@ -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 [--fresh] # # 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 diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh index 7e21473..ea686e4 100755 --- a/scripts/smoke-test.sh +++ b/scripts/smoke-test.sh @@ -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/*.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/*.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- (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"