Files
wadamesh/scripts/lua-harness/cyberspace/run.sh
T
Michael A. CojocariandClaude Opus 5.5 d1571d91ca lua: Cyberspace app, wada.net.request over verified https, wada.json, label:on_press
A client for cyberspace.online (cIRC rooms, C-Mail, the Feed) as a store app,
and the SDK pieces it needed:

- wada.net.request{url, method, headers, body, max}: any method, request
  headers, the real status code. https:// runs in a one-shot TLS task with the
  chain verified against the ISRG roots (CAP_LUA_HTTPS: off on the P4 boards,
  where TLS runs on the C6 unverified, and on the 2 MB Heltec V4).
- wada.json.decode/encode in C; 64-bit integers come back as exact text.
- label:on_press(fn): a label becomes a tap / long-press / cursor target.
- wada.store: get(key) with no default returned the store table for a missing
  key; flush wrote past its 192-byte line buffer; changes now reach the card
  within 2 s instead of only on close.

Host tests: test/test_lua_json.cpp and scripts/lua-harness/cyberspace/run.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01He9DHEuLWYQHXVBnNzzD6E
2026-10-30 20:36:57 -04:00

24 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
# Build the host runner and run the Cyberspace app test at several board sizes.
#
# scripts/lua-harness/cyberspace/run.sh # every size: both room sizes, and touchless
# scripts/lua-harness/cyberspace/run.sh 320 196 # one size
set -e
here=$(cd "$(dirname "$0")" && pwd)
root=$(cd "$here/../../.." && pwd)
app="$root/deploy/apps/cyberspace/1.0/cyberspace.lua"
bin="$here/host"
if [ ! -x "$bin" ] || [ "$here/host.cpp" -nt "$bin" ] || [ "$root/src/ui-touch/LuaJson.h" -nt "$bin" ]; then
obj=$(mktemp -d)
(cd "$obj" && for f in "$root"/lib/lua/src/*.c; do cc -c -O1 -w -I"$root/lib/lua/src" "$f"; done)
c++ -std=c++17 -w -I"$root/src" -I"$root/lib/lua/src" -o "$bin" "$here/host.cpp" "$obj"/*.o -lm
rm -rf "$obj"
fi
if [ $# -ge 2 ]; then sizes="$1x$2"; else sizes="320x196 240x280 222x400 480x222 720x1180"; fi
for s in $sizes; do
w=${s%x*}; h=${s#*x}
"$bin" "$here/test.lua" "$app" "$w" "$h" | tail -1
NMSG=230 "$bin" "$here/test.lua" "$app" "$w" "$h" | tail -1
TOUCH=0 "$bin" "$here/test.lua" "$app" "$w" "$h" | tail -1
done