scorpiox-bot-plugin-antigravity-login
โ†run.shbash
436 lines ยท 20 KBHEADBlameDownload
1#!/bin/sh
2# tests/run.sh - offline checks for plugin_antigravity_login across all 3 modes.
3#
4# Every check runs against ./plugin_antigravity_login with the credential paths
5# and both CLIs redirected at throwaway fixtures, so the suite proves the public
6# contract without touching a real Google session and without a network.
7#
8# What it proves:
9# - --meta is exactly {"name":"google","desc":"Google login"} and is reachable
10# with no password (discovery must never be gated)
11# - every action 401s without the node password, and 401 is a real CGI Status
12# - status parses the accounts array + sibling files + the CLI JSON and never
13# emits a token
14# - start returns the CLI's auth_url, finish rejects garbage codes locally and
15# re-reads state after a successful exchange
16# - refresh performs the grant, drops the access token, and surfaces failure
17# - the HTML page carries the bot theme handoff, no CDN and no <script src=>
18# - the source has no hard-coded secret, no internal address and no emoji
19#
20# Exit code 0 = everything passed.
21
22set -u
23
24ROOT=$(cd "$(dirname "$0")/.." && pwd)
25cd "$ROOT" || exit 1
26
27BIN=./plugin_antigravity_login
28ID=plugin_antigravity_login
29PASS=0
30FAIL=0
31
32if [ -t 1 ]; then
33 C_OK=$(printf '\033[32m'); C_BAD=$(printf '\033[31m'); C_B=$(printf '\033[1m'); C_0=$(printf '\033[0m')
34else
35 C_OK=; C_BAD=; C_B=; C_0=
36fi
37pass() { PASS=$((PASS + 1)); printf ' %sok%s %s\n' "$C_OK" "$C_0" "$1"; }
38fail() { FAIL=$((FAIL + 1)); printf ' %sFAIL%s %s\n' "$C_BAD" "$C_0" "$1"; }
39
40check() { # check <desc> <expected-substring> <actual>
41 if printf '%s' "$3" | grep -F -q -- "$2"; then pass "$1"; else
42 fail "$1 (want: $2)"; printf ' got: %s\n' "$(printf '%s' "$3" | head -c 400)"
43 fi
44}
45
46check_not() { # check_not <desc> <forbidden-substring> <actual>
47 if printf '%s' "$3" | grep -F -q -- "$2"; then
48 fail "$1 (must NOT contain: $2)"; else pass "$1"
49 fi
50}
51
52section() { printf '\n%s== %s ==%s\n' "$C_B" "$1" "$C_0"; }
53
54# strip CGI headers if present, drop CRs, keep the payload
55body() {
56 printf '%s\n' "$1" | tr -d '\r' | awk '
57 BEGIN { inhdr = 0 }
58 NR == 1 && ($0 ~ /^(Content-Type|Status|Cache-Control|X-Content-Type-Options|X-Frame-Options|Referrer-Policy|Content-Security-Policy):/) { inhdr = 1; next }
59 inhdr && $0 == "" { inhdr = 0; next }
60 inhdr { next }
61 { print }
62 '
63}
64
65json_ok() { # json_ok <desc> <json> [python-expression]
66 expr=${3:-True}
67 if printf '%s' "$2" | python3 -c "import json,sys; d=json.load(sys.stdin); sys.exit(0 if ($expr) else 1)" 2>/dev/null; then
68 pass "$1"
69 else
70 fail "$1 (invalid JSON or assertion failed)"; printf ' got: %s\n' "$(printf '%s' "$2" | head -c 400)"
71 fi
72}
73
74api() { body "$(QUERY_STRING="$1" $BIN)"; }
75apiraw() { QUERY_STRING="$1" $BIN; }
76
77# ---------------------------------------------------------------- build
78section "build"
79if [ ! -x "$BIN" ]; then
80 echo " building native binary..."
81 gcc -O2 -std=c99 -Wall -Wextra -I src -o "$BIN" src/plugin_antigravity_login.c || {
82 fail "native build"; exit 1; }
83fi
84pass "native binary present"
85
86# generated page header must match src/ui.html
87if python3 tools/gen_ui.py --check >/dev/null 2>&1; then
88 pass "src/ui_html.h is in sync with src/ui.html"
89else
90 fail "src/ui_html.h is stale - run tools/gen_ui.py"
91fi
92
93# the page header must not be hand-edited: it is generated from ui.html
94check "ui header is marked generated" \
95 "Generated by tools/gen_ui.py" "$(head -1 src/ui_html.h)"
96
97# ---------------------------------------------------------------- fixtures
98FIX=$(mktemp -d 2>/dev/null || mktemp -d -t agyfix)
99trap 'rm -rf "$FIX"' EXIT
100
101mkdir -p "$FIX/none" "$FIX/empty" "$FIX/full" "$FIX/full/scorpiox-env" "$FIX/pending"
102export ANTIGRAVITY_LOGIN_BIN="$ROOT/tests/mock_login.sh"
103export ANTIGRAVITY_TOKEN_BIN="$ROOT/tests/mock_token.sh"
104export ANTIGRAVITY_PENDING_PATH="$FIX/pending/antigravity-default.json"
105
106# empty credentials file (exists but has no accounts)
107: > "$FIX/empty/antigravity_accounts.json"
108
109# a realistic signed-in fixture: the accounts array + selected account + profile
110cat > "$FIX/full/antigravity_accounts.json" <<'JSON'
111[
112 {"email":"other@example.com","refresh_token":"1//other-refresh"},
113 {"email":"pico@example.com","refresh_token":"1//pico-refresh-value"}
114]
115JSON
116printf 'pico@example.com\n' > "$FIX/full/selected_account.txt"
117printf 'PROVIDER=google_gemini\nGOOGLE_TOKEN_SOURCE=local\nGOOGLE_ACCOUNT=pico@example.com\nGOOGLE_PROJECT_ID=proj-mock-42\nMODEL=gemini-3.7-flash-tiered\n' \
118 > "$FIX/full/scorpiox-env/antigravity.txt"
119
120# ---------------------------------------------------------------- metadata
121section "mode 1: discovery metadata"
122META=$("$BIN" --meta)
123if [ "$META" = '{"name":"google","desc":"Google login"}' ]; then
124 pass "--meta is exactly the contract line"
125else
126 fail "--meta mismatch"; printf ' got: %s\n' "$META"
127fi
128json_ok "--meta is valid JSON with name+desc" "$META" \
129 "d['name']=='google' and d['desc']=='Google login'"
130check "--meta desc is within 15 chars" "Google login" "$META"
131
132ENVMETA=$(SX_PLUGIN_META=1 "$BIN")
133check "SX_PLUGIN_META=1 works like --meta" '"name":"google"' "$ENVMETA"
134
135# --meta must not be gated by the node password
136META_PW=$(BOT_PASSWORD=testpw "$BIN" --meta)
137check "--meta ignores BOT_PASSWORD" '"name":"google"' "$META_PW"
138
139check "--version prints the plugin id and version" "$ID" "$("$BIN" --version)"
140
141# ---------------------------------------------------------------- auth
142section "node auth"
143export BOT_PASSWORD=testpw
144RAW=$(apiraw "action=status")
145check "unauthenticated action returns a 401 Status line" "Status: 401 Unauthorized" "$RAW"
146check "unauthenticated action body is JSON" '"error":"invalid node password"' "$RAW"
147
148RAW=$(apiraw "")
149check "unauthenticated HTML also 401s" "Status: 401 Unauthorized" "$RAW"
150
151HDR=$(api "action=status&pwd=testpw")
152check "?pwd= authenticates" '"ok":true' "$HDR"
153
154HDR=$(QUERY_STRING="action=status" HTTP_X_BOT_PASSWORD=testpw $BIN)
155check "X-Bot-Password authenticates" '"ok":true' "$(body "$HDR")"
156
157HDR=$(QUERY_STRING="action=status" HTTP_AUTHORIZATION="Bearer testpw" $BIN)
158check "Authorization: Bearer authenticates" '"ok":true' "$(body "$HDR")"
159
160WRONG=$(apiraw "action=status&pwd=nope")
161check "a wrong password still 401s" "Status: 401 Unauthorized" "$WRONG"
162unset BOT_PASSWORD
163
164# ---------------------------------------------------------------- status
165section "action=status"
166NOFIX=$(ANTIGRAVITY_CREDS_PATH="$FIX/none/antigravity_accounts.json" \
167 MOCK_STATUS_JSON='{"ok":true,"provider":"antigravity","logged_in":false,"expires_at":0,"expired":false,"has_refresh":false,"pending":false}' \
168 api "action=status")
169json_ok "status with no credentials is valid JSON" "$NOFIX" \
170 "d['ok'] is True and d['logged_in'] is False and d['has_refresh'] is False"
171check_not "status with no credentials emits no token field" "refresh_token" "$NOFIX"
172
173EMPTYJ=$(ANTIGRAVITY_CREDS_PATH="$FIX/empty/antigravity_accounts.json" api "action=status")
174json_ok "empty accounts file yields logged_in false" "$EMPTYJ" \
175 "d['ok'] is True and d['logged_in'] is False"
176
177FULL=$(ANTIGRAVITY_CREDS_PATH="$FIX/full/antigravity_accounts.json" \
178 MOCK_STATUS_JSON='{"ok":true,"provider":"antigravity","logged_in":true,"expires_at":4102444800000,"expired":false,"has_refresh":true,"pending":false,"identity":"pico@example.com"}' \
179 api "action=status")
180json_ok "signed-in status reports logged_in + has_refresh" "$FULL" \
181 "d['ok'] is True and d['logged_in'] is True and d['has_refresh'] is True"
182check_not "signed-in status never returns the refresh token" "1//pico-refresh-value" "$FULL"
183check_not "signed-in status never returns any token literal" "refresh_token\":" "$FULL"
184
185check "status reports the selected account email" "pico@example.com" "$FULL"
186check "status reads the companion project from the profile" "proj-mock-42" "$FULL"
187check "status reports the credentials path" "$FIX/full/antigravity_accounts.json" "$FULL"
188json_ok "status has the full contract field set" "$FULL" \
189 "all(k in d for k in ('logged_in','email','project_id','expires_at','expires_in_sec','expired','has_refresh','account','pending','profile'))"
190
191# expired session: the CLI says the expiry is in the past
192EXPIRED=$(ANTIGRAVITY_CREDS_PATH="$FIX/full/antigravity_accounts.json" \
193 MOCK_STATUS_JSON='{"ok":true,"provider":"antigravity","logged_in":true,"expires_at":1000000000000,"expired":true,"has_refresh":true,"pending":false}' \
194 api "action=status")
195json_ok "an expired session reports expired true and a negative remaining time" "$EXPIRED" \
196 "d['expired'] is True and d['expires_in_sec'] < 0"
197
198# a far-future expiry must not overflow: expires_in_sec used to be an int, so
199# any expiry past 2038 came out as -1987015054 while expired stayed false.
200FAR=$(ANTIGRAVITY_CREDS_PATH="$FIX/full/antigravity_accounts.json" \
201 MOCK_STATUS_JSON='{"ok":true,"provider":"antigravity","logged_in":true,"expires_at":4102444800000,"expired":false,"has_refresh":true}' \
202 api "action=status")
203json_ok "a post-2038 expiry reports a positive remaining time" "$FAR" \
204 "d['expires_in_sec'] > 0 and d['expired'] is False"
205json_ok "a post-2038 expiry normalises ms to seconds" "$FAR" \
206 "d['expires_at'] == 4102444800"
207
208# pending marker file present -> pending true even without CLI help
209: > "$FIX/pending/antigravity-default.json"
210PEND=$(ANTIGRAVITY_CREDS_PATH="$FIX/none/antigravity_accounts.json" \
211 MOCK_STATUS_JSON='{"ok":true,"provider":"antigravity","logged_in":false,"pending":false}' \
212 api "action=status")
213json_ok "the pending marker file makes status pending" "$PEND" "d['pending'] is True"
214rm -f "$FIX/pending/antigravity-default.json"
215
216# no CLI on PATH: status must still answer from the files alone
217NOCLI=$(ANTIGRAVITY_LOGIN_BIN="/nonexistent/login-cli" \
218 ANTIGRAVITY_CREDS_PATH="$FIX/full/antigravity_accounts.json" api "action=status")
219json_ok "status answers without the login CLI" "$NOCLI" \
220 "d['ok'] is True and d['logged_in'] is True"
221json_ok "cli_present is false when the CLI is missing" "$NOCLI" "d['cli_present'] is False"
222
223# format=json with no action means status
224FMT=$(ANTIGRAVITY_CREDS_PATH="$FIX/full/antigravity_accounts.json" \
225 MOCK_STATUS_JSON='{"ok":true,"logged_in":true,"has_refresh":true}' api "format=json")
226json_ok "format=json alone answers status" "$FMT" "d['ok'] is True and 'logged_in' in d"
227
228# ---------------------------------------------------------------- start
229section "action=start"
230START=$(api "action=start")
231json_ok "start returns ok + an auth_url" "$START" \
232 "d['ok'] is True and d['auth_url'].startswith('https://accounts.google.com/')"
233check "start reports the paste_code flow" '"flow":"paste_code"' "$START"
234check "start carries the PKCE challenge in the URL" "code_challenge=" "$START"
235check "start carries the S256 method" "code_challenge_method=S256" "$START"
236check "start reports an expiry window" "expires_in" "$START"
237
238# the plugin must not invent a client secret of its own
239check_not "start never echoes a client secret" "GOCSPX" "$START"
240
241NOCLISTART=$(ANTIGRAVITY_LOGIN_BIN="/nonexistent/login-cli" api "action=start")
242json_ok "start without the CLI returns a structured error" "$NOCLISTART" \
243 "d['ok'] is False and d['error']=='cli_unavailable'"
244
245# ---------------------------------------------------------------- finish
246section "action=finish"
247MISSING=$(api "action=finish")
248json_ok "finish without a code is a 400-style error object" "$MISSING" \
249 "d['ok'] is False and d['error']=='missing_code'"
250
251SHELLY=$(api "action=finish&code=\$(touch_/tmp/pwned)")
252json_ok "finish rejects shell metacharacters before running anything" "$SHELLY" \
253 "d['ok'] is False and d['error']=='invalid_code'"
254if [ -e /tmp/pwned ]; then fail "shell injection created /tmp/pwned"; rm -f /tmp/pwned; else pass "shell injection did not execute"; fi
255
256QUOTED=$(api "action=finish&code=abc%27def")
257json_ok "finish rejects a quote in the code" "$QUOTED" \
258 "d['ok'] is False and d['error']=='invalid_code'"
259
260FAILED=$(MOCK_FAIL=1 api "action=finish&code=4/0AX4XfWh-test-code")
261json_ok "a rejected exchange surfaces the CLI error" "$FAILED" \
262 "d['ok'] is False and d['error'] in ('exchange','finish_failed')"
263
264# successful exchange: the mock writes the credential files into $MOCK_WRITE_DIR
265mkdir -p "$FIX/finishdir"
266OKF=$(MOCK_WRITE_DIR="$FIX/finishdir" ANTIGRAVITY_CREDS_PATH="$FIX/finishdir/antigravity_accounts.json" \
267 api "action=finish&code=4/0AX4XfWh-test-code")
268json_ok "a successful exchange reports done + logged_in" "$OKF" \
269 "d['ok'] is True and d['state']=='done' and d['logged_in'] is True"
270check "the exchange result re-reads the new account" "pico@example.com" "$OKF"
271check_not "the exchange result never carries the token" "1//mock-refresh-token-value" "$OKF"
272
273# a full redirect URL is accepted (the CLI extracts code= itself)
274FULLURL=$(MOCK_WRITE_DIR="$FIX/finishdir" ANTIGRAVITY_CREDS_PATH="$FIX/finishdir/antigravity_accounts.json" \
275 api "action=finish&code=https%3A%2F%2Fantigravity.google%2Foauth-callback%3Fcode%3D4%2F0AX-test%26state%3Dxyz")
276json_ok "a whole redirect URL is accepted" "$FULLURL" "d['ok'] is True and d['state']=='done'"
277
278# POST body carrying the code
279POSTB=$(printf '{"code":"4/0AX4XfWh-post-code"}' | \
280 REQUEST_METHOD=POST CONTENT_LENGTH=32 \
281 MOCK_WRITE_DIR="$FIX/finishdir" ANTIGRAVITY_CREDS_PATH="$FIX/finishdir/antigravity_accounts.json" \
282 QUERY_STRING="action=finish" $BIN)
283json_ok "the code can arrive in a POST body" "$(body "$POSTB")" "d['ok'] is True"
284
285# ---------------------------------------------------------------- cancel
286section "action=cancel"
287CANCEL=$(api "action=cancel")
288json_ok "cancel reports a cancelled state" "$CANCEL" \
289 "d['ok'] is True and d['state']=='cancelled' and d['pending'] is False"
290
291# ---------------------------------------------------------------- refresh
292section "action=refresh"
293REFR=$(ANTIGRAVITY_CREDS_PATH="$FIX/full/antigravity_accounts.json" api "action=refresh")
294json_ok "refresh succeeds and reports refreshed" "$REFR" \
295 "d['ok'] is True and d['refreshed'] is True"
296check_not "refresh NEVER returns the access token" "ya29.MOCK-ACCESS-TOKEN-MUST-NOT-LEAK" "$REFR"
297check_not "refresh has no access_token key at all" "access_token" "$REFR"
298check "refresh reports the project from the token CLI" "proj-mock-42" "$REFR"
299
300REFRFAIL=$(MOCK_TOKEN_FAIL=1 api "action=refresh")
301json_ok "a failed refresh returns a structured error" "$REFRFAIL" \
302 "d['ok'] is False and d['error']=='refresh_failed'"
303
304REFRNOCLI=$(ANTIGRAVITY_TOKEN_BIN="/nonexistent/token-cli" api "action=refresh")
305json_ok "refresh without the token CLI says cli_unavailable" "$REFRNOCLI" \
306 "d['ok'] is False and d['error']=='cli_unavailable'"
307
308# ---------------------------------------------------------------- errors
309section "unknown routes and actions"
310UNK=$(api "action=teleport")
311json_ok "an unknown action is a structured error" "$UNK" \
312 "d['ok'] is False and d['error']=='unknown_action'"
313RAWUNK=$(apiraw "action=teleport")
314check "an unknown action returns a 404 Status" "Status: 404 Not Found" "$RAWUNK"
315check "the error carries the plugin contract headers" "Content-Type: application/json" "$RAWUNK"
316check_not "no response emits Content-Length" "Content-Length" "$RAWUNK"
317
318BADS=$(api "action=status")
319check_not "JSON responses carry Cache-Control: no-store" "Cache-Control: no-store" "$BADS"
320
321# ---------------------------------------------------------------- HTML
322section "mode 3: HTML UI"
323HTMLRAW=$(apiraw "")
324HTML=$(body "$HTMLRAW")
325check "HTML is served as text/html" "Content-Type: text/html; charset=utf-8" "$HTMLRAW"
326check "HTML declares a viewport" "name=\"viewport\"" "$HTML"
327check "HTML carries the CSP header" "Content-Security-Policy" "$HTMLRAW"
328check "HTML declares color-scheme via the theme tokens" "color-scheme" "$HTML"
329check "HTML includes the bot prepaint script" "bot_theme" "$HTML"
330check "HTML includes the theme handoff listener" "sx-theme" "$HTML"
331check "HTML has the status pill" 'id="pill"' "$HTML"
332check "HTML has the start button" 'id="btnStart"' "$HTML"
333check "HTML has the paste input" 'id="codeInput"' "$HTML"
334check "HTML has the finish button" 'id="btnFinish"' "$HTML"
335check "HTML has the cancel button" 'id="btnCancel"' "$HTML"
336check "HTML has the refresh button" 'id="btnRefresh"' "$HTML"
337check "HTML has the companion project card" "Companion project" "$HTML"
338check "HTML uses the two-route API helper" "plugin_antigravity_login" "$HTML"
339check "HTML hides the back link in embed mode" "embed-hide" "$HTML"
340check_not "HTML loads no CDN script" "<script src=" "$HTML"
341check_not "HTML references no external host script" "cdnjs" "$HTML"
342check_not "HTML makes no outbound fetch to a third party" "googleapis.com" "$HTML"
343check_not "HTML carries no emoji" "๐Ÿš€" "$HTML"
344
345if command -v python3 >/dev/null 2>&1; then
346 printf '%s' "$HTML" > "$FIX/page.html"
347 if python3 - "$FIX/page.html" <<'PY'
348import re, sys
349html = open(sys.argv[1], encoding='utf-8').read()
350# every id referenced by getElementById must exist in the markup
351ids = set(re.findall(r'id="([^"]+)"', html))
352missing = [i for i in re.findall(r"\$\('([^']+)'\)", html) if i not in ids]
353sys.exit(1 if missing else 0)
354PY
355 then pass "every JS element id exists in the markup"
356 else fail "the page JS references an element id that is not in the HTML"; fi
357fi
358
359# ---------------------------------------------------------------- source hygiene
360section "source hygiene"
361check_not "source has no OAuth client secret" "GOCSPX" "$(cat src/plugin_antigravity_login.c)"
362check_not "source has no Google API key" "AIza" "$(cat src/plugin_antigravity_login.c)"
363check_not "source has no GitHub token" "ghp_" "$(cat src/plugin_antigravity_login.c)"
364check_not "source has no internal address" "192.168." "$(cat src/plugin_antigravity_login.c src/ui.html)"
365check_not "source has no 10.x internal address" "10.0." "$(cat src/plugin_antigravity_login.c src/ui.html)"
366check_not "the page has no internal address either" "172.16" "$(cat src/ui.html)"
367
368# no emoji anywhere in the shipped sources (byte-level check, not a regex guess)
369if python3 - src/plugin_antigravity_login.c src/ui.html src/bot_theme_plugin.h <<'PY'
370import sys, unicodedata
371bad = []
372for path in sys.argv[1:]:
373 for n, line in enumerate(open(path, encoding='utf-8'), 1):
374 for ch in line:
375 o = ord(ch)
376 if o < 0x2000:
377 continue
378 if 0x2190 <= o <= 0x21FF: # arrows are typography, not emoji
379 continue
380 if unicodedata.category(ch) in ('So', 'Sk') or 0x1F000 <= o <= 0x1FAFF:
381 bad.append('%s:%d %r' % (path, n, ch))
382if bad:
383 print('\n'.join(bad[:10]))
384 sys.exit(1)
385PY
386then pass "no emoji in source, page or theme header"
387else fail "emoji found in the shipped sources"; fi
388
389# ---------------------------------------------------------------- extra builds
390section "cross-target builds"
391if command -v musl-gcc >/dev/null 2>&1; then
392 if musl-gcc -O2 -std=c99 -static -I src -o "$FIX/musl-bin" src/plugin_antigravity_login.c 2>/dev/null; then
393 pass "static musl build"
394 MUSLMETA=$("$FIX/musl-bin" --meta)
395 check "the musl binary reports the same metadata" '"name":"google"' "$MUSLMETA"
396 else fail "static musl build"; fi
397else
398 echo " skip musl-gcc not installed"
399fi
400
401if command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then
402 if x86_64-w64-mingw32-gcc -O2 -std=c99 -static -I src -o "$FIX/win-bin.exe" src/plugin_antigravity_login.c 2>/dev/null; then
403 pass "MinGW-w64 build"
404 if [ "$(head -c 2 "$FIX/win-bin.exe")" = "MZ" ]; then
405 pass "the Windows build has a real PE header"
406 else fail "the Windows build is not a PE (missing MZ)"; fi
407 else fail "MinGW-w64 build"; fi
408else
409 echo " skip x86_64-w64-mingw32-gcc not installed"
410fi
411
412if command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then
413 if aarch64-linux-gnu-gcc -O2 -std=c99 -static -I src -o "$FIX/arm-bin" src/plugin_antigravity_login.c 2>/dev/null; then
414 pass "static arm64 build"
415 else fail "static arm64 build"; fi
416else
417 echo " skip aarch64-linux-gnu-gcc not installed"
418fi
419
420# _FORTIFY_SOURCE=2: the sqlite plugin lost a whole build to this, so it is
421# part of every suite now.
422if gcc -O2 -std=c99 -D_FORTIFY_SOURCE=2 -I src -o "$FIX/fortify-bin" src/plugin_antigravity_login.c 2>/dev/null; then
423 FORTMETA=$("$FIX/fortify-bin" --meta)
424 check "a _FORTIFY_SOURCE=2 build runs --meta clean" '"name":"google"' "$FORTMETA"
425 FORTSTAT=$(ANTIGRAVITY_CREDS_PATH="$FIX/full/antigravity_accounts.json" \
426 QUERY_STRING="action=status" "$FIX/fortify-bin")
427 json_ok "a fortify build answers status without aborting" "$(body "$FORTSTAT")" "d['ok'] is True"
428else
429 fail "_FORTIFY_SOURCE=2 build"
430fi
431
432# ---------------------------------------------------------------- summary
433printf '\n%s== summary ==%s\n' "$C_B" "$C_0"
434printf ' %d passed, %d failed\n' "$PASS" "$FAIL"
435[ "$FAIL" -eq 0 ] || exit 1
436exit 0