Update generator tier tooling
This commit is contained in:
parent
18e14a5b67
commit
2d75fa9d86
12 changed files with 61 additions and 44 deletions
|
|
@ -6,9 +6,9 @@
|
||||||
// actually reachable and correct *through the wrappers* — real GLib/GObject
|
// actually reachable and correct *through the wrappers* — real GLib/GObject
|
||||||
// symbols, linked via pkg-config, invoked at runtime and their results checked.
|
// 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
|
// This file is not generated. `scripts/smoke-test.sh` copies the selected tier's
|
||||||
// bindings with a SmokeTests target and copies this file in before running
|
// fixtures into the SmokeTests target; tier 6/all copies every tier's fixtures
|
||||||
// `swift test`.
|
// into one full-stack package.
|
||||||
|
|
||||||
import Testing
|
import Testing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@
|
||||||
// `self.pointer`) reaches the real C symbol and returns the correct
|
// `self.pointer`) reaches the real C symbol and returns the correct
|
||||||
// result.
|
// result.
|
||||||
//
|
//
|
||||||
// Not generated. `scripts/smoke-test.sh <tier>` copies `regression/tier<N>/*.swift`
|
// Not generated. `scripts/smoke-test.sh <tier>` copies tier 1 and the selected
|
||||||
// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before
|
// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures
|
||||||
// running `swift test`. Only installed for tier ≥ 2 (Gio's module).
|
// into one full-stack SmokeTests target. Only installed for tier >= 2.
|
||||||
|
|
||||||
import Testing
|
import Testing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@
|
||||||
// strong-LTR script (Latin) and a strong-RTL script (Hebrew) and
|
// strong-LTR script (Latin) and a strong-RTL script (Hebrew) and
|
||||||
// asserting the opposite directions libpango is known to report.
|
// asserting the opposite directions libpango is known to report.
|
||||||
//
|
//
|
||||||
// Not generated. `scripts/smoke-test.sh <tier>` copies `regression/tier<N>/*.swift`
|
// Not generated. `scripts/smoke-test.sh <tier>` copies tier 1 and the selected
|
||||||
// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before
|
// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures
|
||||||
// running `swift test`. Only installed for tier >= 3 (Pango's module).
|
// into one full-stack SmokeTests target. Only installed for tier >= 3.
|
||||||
|
|
||||||
import Testing
|
import Testing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@
|
||||||
// `gdk_pixbuf_get_height`, returning the values passed to the
|
// `gdk_pixbuf_get_height`, returning the values passed to the
|
||||||
// constructor — not stubbed/placeholder data.
|
// constructor — not stubbed/placeholder data.
|
||||||
//
|
//
|
||||||
// Not generated. `scripts/smoke-test.sh <tier>` copies `regression/tier<N>/*.swift`
|
// Not generated. `scripts/smoke-test.sh <tier>` copies tier 1 and the selected
|
||||||
// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before
|
// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures
|
||||||
// running `swift test`. Only installed for tier ≥ 3 (GdkPixbuf's module).
|
// into one full-stack SmokeTests target. Only installed for tier >= 3.
|
||||||
|
|
||||||
import Testing
|
import Testing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@
|
||||||
// Both are display-free: no `GdkDisplay`/surface is created, so this runs
|
// Both are display-free: no `GdkDisplay`/surface is created, so this runs
|
||||||
// without a windowing backend.
|
// without a windowing backend.
|
||||||
//
|
//
|
||||||
// Not generated. `scripts/smoke-test.sh <tier>` copies `regression/tier<N>/*.swift`
|
// Not generated. `scripts/smoke-test.sh <tier>` copies tier 1 and the selected
|
||||||
// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before
|
// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures
|
||||||
// running `swift test`. Only installed for tier >= 4 (Gdk's module).
|
// into one full-stack SmokeTests target. Only installed for tier >= 4.
|
||||||
|
|
||||||
import Testing
|
import Testing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@
|
||||||
// generator (absent from regression/tier4/Gsk.json's bound set), so
|
// generator (absent from regression/tier4/Gsk.json's bound set), so
|
||||||
// `CairoRenderer()` alone carries the Gsk runtime-coverage requirement here.
|
// `CairoRenderer()` alone carries the Gsk runtime-coverage requirement here.
|
||||||
//
|
//
|
||||||
// Not generated. `scripts/smoke-test.sh <tier>` copies `regression/tier<N>/*.swift`
|
// Not generated. `scripts/smoke-test.sh <tier>` copies tier 1 and the selected
|
||||||
// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before
|
// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures
|
||||||
// running `swift test`. Only installed for tier >= 4 (Gsk's module).
|
// into one full-stack SmokeTests target. Only installed for tier >= 4.
|
||||||
|
|
||||||
import Testing
|
import Testing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,9 @@
|
||||||
// is itself part of the proof that the pointer-free surface is complete
|
// is itself part of the proof that the pointer-free surface is complete
|
||||||
// enough for real, non-toy usage.
|
// enough for real, non-toy usage.
|
||||||
//
|
//
|
||||||
// Not generated. `scripts/smoke-test.sh <tier>` copies `regression/tier<N>/*.swift`
|
// Not generated. `scripts/smoke-test.sh <tier>` copies tier 1 and the selected
|
||||||
// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before
|
// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures
|
||||||
// running `swift test`. Only installed for tier >= 5 (Gtk's module).
|
// into one full-stack SmokeTests target. Only installed for tier >= 5.
|
||||||
|
|
||||||
import Testing
|
import Testing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@
|
||||||
// functions never call `adw_init()`, so no GTK display connection is
|
// functions never call `adw_init()`, so no GTK display connection is
|
||||||
// required. Uses only plain-public API — no `@_spi` import.
|
// required. Uses only plain-public API — no `@_spi` import.
|
||||||
//
|
//
|
||||||
// Not generated. `scripts/smoke-test.sh <tier>` copies `regression/tier<N>/*.swift`
|
// Not generated. `scripts/smoke-test.sh <tier>` copies tier 1 and the selected
|
||||||
// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before
|
// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures
|
||||||
// running `swift test`. Only installed for tier >= 6 (Adw's module).
|
// into one full-stack SmokeTests target. Only installed for tier >= 6.
|
||||||
|
|
||||||
import Testing
|
import Testing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@
|
||||||
// simplest possible real round-trip through the generated Gst module. Uses
|
// simplest possible real round-trip through the generated Gst module. Uses
|
||||||
// only plain-public API — no `@_spi` import.
|
// only plain-public API — no `@_spi` import.
|
||||||
//
|
//
|
||||||
// Not generated. `scripts/smoke-test.sh <tier>` copies `regression/tier<N>/*.swift`
|
// Not generated. `scripts/smoke-test.sh <tier>` copies tier 1 and the selected
|
||||||
// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before
|
// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures
|
||||||
// running `swift test`. Only installed for tier >= 6 (Gst's module).
|
// into one full-stack SmokeTests target. Only installed for tier >= 6.
|
||||||
|
|
||||||
import Testing
|
import Testing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@
|
||||||
// message, or network connection — display/network-free by construction.
|
// message, or network connection — display/network-free by construction.
|
||||||
// Uses only plain-public API — no `@_spi` import.
|
// Uses only plain-public API — no `@_spi` import.
|
||||||
//
|
//
|
||||||
// Not generated. `scripts/smoke-test.sh <tier>` copies `regression/tier<N>/*.swift`
|
// Not generated. `scripts/smoke-test.sh <tier>` copies tier 1 and the selected
|
||||||
// (plus `regression/tier1/SmokeTests.swift`) into the SmokeTests target before
|
// tier's fixtures for tiers 2 through 5. Tier 6/all copies every tier's fixtures
|
||||||
// running `swift test`. Only installed for tier >= 6 (Soup's module).
|
// into one full-stack SmokeTests target. Only installed for tier >= 6.
|
||||||
|
|
||||||
import Testing
|
import Testing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# compile-gate.sh — the generator's primary acceptance gate.
|
# 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
|
# 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
|
# 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
|
# committed baseline in regression/tierN/ (JSON files only) so that new
|
||||||
|
|
@ -11,12 +11,14 @@
|
||||||
# scripts/compile-gate.sh <tier|all> [--fresh]
|
# scripts/compile-gate.sh <tier|all> [--fresh]
|
||||||
#
|
#
|
||||||
# <tier> 1..6 (tier1 = GLib+GObject ... tier6 = full stack), or 'all'
|
# <tier> 1..6 (tier1 = GLib+GObject ... tier6 = full stack), or 'all'
|
||||||
# --fresh remove the tier's output directory before generating (use when
|
# 'all' is the full-stack tier-6 alias and only generates tier 6
|
||||||
# the generated file set shrinks and stale files would linger)
|
# --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
|
# Output goes to ${TMPDIR:-/tmp}/gobject-generator-gate/tier-N; a stable path so
|
||||||
# incremental swift builds stay fast between runs.
|
# incremental swift builds stay fast between runs.
|
||||||
|
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
|
@ -32,7 +34,7 @@ if [[ -z "$TIER_ARG" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TIER_ARG" == "all" ]]; then
|
if [[ "$TIER_ARG" == "all" ]]; then
|
||||||
TIERS=(1 2 3 4 5 6)
|
TIERS=(6)
|
||||||
else
|
else
|
||||||
TIERS=("$TIER_ARG")
|
TIERS=("$TIER_ARG")
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,18 @@
|
||||||
#!/usr/bin/env bash
|
#!/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:
|
# 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
|
# 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
|
# pkg-config, and runs hand-written swift-testing cases from the selected tier's
|
||||||
# regression/tier<N>/*.swift (plus regression/tier1/SmokeTests.swift for all tiers)
|
# 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, …
|
# tier 1..6 (default 1). tier1 = GLib+GObject, tier2 = +GModule+Gio, ...
|
||||||
# --fresh wipe the tier's output directory before generating
|
# 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
|
# Output goes to ${TMPDIR:-/tmp}/gobject-generator-smoke/tier-<N> (a stable path so
|
||||||
# incremental swift builds stay fast between runs).
|
# incremental swift builds stay fast between runs).
|
||||||
|
|
@ -28,6 +31,18 @@ for arg in "$@"; do
|
||||||
fi
|
fi
|
||||||
done
|
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"
|
CONFIG="$ROOT/regression/tier${TIER}/config.toml"
|
||||||
OUT="${TMPDIR:-/tmp}/gobject-generator-smoke/tier-${TIER}"
|
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"
|
echo "==> Installing smoke tests"
|
||||||
mkdir -p "$OUT/Tests/SmokeTests"
|
mkdir -p "$OUT/Tests/SmokeTests"
|
||||||
# Install foundational tier1 smoke tests (GLib/GObject) plus tier-specific tests.
|
for smoke_tier in "${SMOKE_TIERS[@]}"; do
|
||||||
cp "$ROOT/regression/tier1/SmokeTests.swift" "$OUT/Tests/SmokeTests/"
|
cp "$ROOT/regression/tier${smoke_tier}/"*.swift "$OUT/Tests/SmokeTests/"
|
||||||
cp "$ROOT/regression/tier${TIER}/"*.swift "$OUT/Tests/SmokeTests/"
|
done
|
||||||
|
|
||||||
echo "==> Running smoke tests against the real C libraries"
|
echo "==> Running smoke tests against the real C libraries"
|
||||||
swift test --package-path "$OUT"
|
swift test --package-path "$OUT"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue