Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,20 @@ jobs:
name: gui-screenshots
path: .zig-cache/native-sdk-automation/screenshot-*.png
if-no-files-found: ignore

scripts:
name: scripts (pure ASCII)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Assert scripts are pure ASCII
# A `curl | bash` installer must run on the oldest bundled bash (macOS
# ships 3.2.57): a non-ASCII byte next to a $variable under `set -u` folds
# into the variable name and aborts the install. Keep every script ASCII.
run: |
bad="$(LC_ALL=C perl -ne 'print "$ARGV:$.: $_" if /[^\x00-\x7F]/; close ARGV if eof' scripts/*.sh)"
if [ -n "$bad" ]; then
printf '%s\n' "$bad"
echo "::error::scripts/*.sh must be pure ASCII (see lines above)"
exit 1
fi
6 changes: 3 additions & 3 deletions scripts/install-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ curl -fSL --progress-bar -o "$tmp/$name" "$base/$name" || fail "download failed"

note "Verifying SHA-256"
got="$(shasum -a 256 "$tmp/$name" | awk '{ print $1 }')"
[ "$got" = "$sha" ] || fail "checksum mismatch expected $sha, got $got (not installing)"
[ "$got" = "$sha" ] || fail "checksum mismatch - expected $sha, got $got (not installing)"

note "Mounting the disk image"
mnt="$(hdiutil attach "$tmp/$name" -nobrowse -readonly | grep -o '/Volumes/.*' | head -1)"
Expand All @@ -52,7 +52,7 @@ mnt="$(hdiutil attach "$tmp/$name" -nobrowse -readonly | grep -o '/Volumes/.*' |
sudo=""
if [ ! -w /Applications ]; then
sudo="sudo"
note "/Applications needs administrator access you may be prompted for your password"
note "/Applications needs administrator access - you may be prompted for your password"
fi

note "Installing to /Applications"
Expand All @@ -66,4 +66,4 @@ $sudo xattr -dr com.apple.quarantine "$dest" 2>/dev/null || true

note "Opening $app"
open "$dest"
note "Done OCPP DebugKit Studio is installed in /Applications."
note "Done - OCPP DebugKit Studio is installed in /Applications."
4 changes: 2 additions & 2 deletions scripts/package-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# because the SDK's codesign invocation does not quote the bundle path: a path
# with spaces splits into multiple arguments and ad-hoc signing silently fails,
# leaving an unsigned bundle (which will not launch on Apple silicon). Signing
# the space-free name and renaming afterwards keeps the seal intact the ad-hoc
# signature covers bundle contents, not the directory name and we build the
# the space-free name and renaming afterwards keeps the seal intact - the ad-hoc
# signature covers bundle contents, not the directory name - and we build the
# .dmg ourselves so it wraps the renamed, signed bundle.
#
# Usage: scripts/package-macos.sh <version> (run after `native build`)
Expand Down
14 changes: 7 additions & 7 deletions scripts/smoke.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
#
# Automation-driven GUI test: launch the app, wait for its embedded automation
# server, then DRIVE the headline flows through the automation protocol
# server, then DRIVE the headline flows through the automation protocol -
# clicking real widgets and asserting the rendered semantics tree after each
# step and capture deterministic screenshots as artifacts. Portable: uses a
# step - and capture deterministic screenshots as artifacts. Portable: uses a
# virtual framebuffer (Xvfb) when available (CI), otherwise runs the window
# directly (local macOS). The app must be built with -Dautomation=true.
#
Expand All @@ -17,7 +17,7 @@ CANVAS=main-canvas
SAMPLE=src/ocpp/testdata/normal-session.json

if [ ! -x "$BIN" ]; then
echo "smoke: $BIN not found build first: native build -Dautomation=true" >&2
echo "smoke: $BIN not found - build first: native build -Dautomation=true" >&2
exit 1
fi

Expand Down Expand Up @@ -47,7 +47,7 @@ APP_PID=$!
trap 'kill "$APP_PID" >/dev/null 2>&1 || true' EXIT

# The numeric widget id for the widget whose accessibility name equals $1. Each
# snapshot line is `widget @w<win>/<view>#<id> role=<r> name="<label>" `; anchor
# snapshot line is `widget @w<win>/<view>#<id> role=<r> name="<label>" ...`; anchor
# on the id in that path so a name never mismatches. Prefer the `snapshot`
# command's output (a fresh publish); fall back to the dropbox snapshot.txt.
widget_id() {
Expand Down Expand Up @@ -79,7 +79,7 @@ shot() { # capture the canvas to a stably-named PNG artifact ($1)
# Block until the runtime publishes ready=true (or fail loudly on timeout).
native automate wait --timeout-ms 60000

# 1. The CLI load parse render path: launched with the sample trace, the app
# 1. The CLI load -> parse -> render path: launched with the sample trace, the app
# opens straight on the overview. Assertions read the semantics snapshot
# (GPU-independent), so they hold under software GL too.
native automate assert --timeout-ms 30000 \
Expand All @@ -103,7 +103,7 @@ click 'Clear'
native automate assert --absent --timeout-ms 30000 'of 22 events'

# 4. Switch to the live-capture surface: its control strip renders (endpoints +
# start control + the idle note). No capture is started that would spawn a
# start control + the idle note). No capture is started - that would spawn a
# real proxy subprocess.
click 'Live'
native automate assert --timeout-ms 30000 'Start capture' 'Ready to capture' 'Listen'
Expand All @@ -112,4 +112,4 @@ shot live
# 5. No runtime/dispatch errors surfaced across the whole run.
native automate assert --absent 'error event='

echo "smoke: ok automation drove the inspector, filter, and live surface"
echo "smoke: ok - automation drove the inspector, filter, and live surface"
Loading