feat: add QR code functional tests across 41 languages

Native QR generation for each language's ecosystem:
- 27 languages use package manager QR libraries (qrcode, rqrcode, ZXing, etc.)
- 10 languages use C FFI to libqrencode (dlopen, ISO_C_BINDING, @cImport, critcl)
- 2 shell languages use qrencode CLI (native shell paradigm)
- 1 language (Prolog) uses C FFI with CLI fallback

Section 9 added to test-sdk.sh with get_qr_file() mapping and
QR:unsandbox-qr-ok:ROWS pattern validation across the hydra matrix.
This commit is contained in:
russell@unturf.com 2026-01-27 18:24:54 -05:00
parent 0f4755620f
commit d7388d43ba
42 changed files with 562 additions and 0 deletions

View file

@ -12,6 +12,7 @@
# 6. Snapshots endpoint
# 7. Images endpoint
# 8. Key validation
# 9. QR code generation (native library or qrencode CLI fallback)
#
# Usage: test-sdk.sh LANGUAGE
@ -127,6 +128,57 @@ int main() { NSLog(@"test-ok"); return 0; }' ;;
esac
}
# Map language to QR code test file
get_qr_file() {
case "$1" in
python) echo "test/qr.py" ;;
javascript) echo "test/qr.js" ;;
typescript) echo "test/qr.ts" ;;
ruby) echo "test/qr.rb" ;;
php) echo "test/qr.php" ;;
perl) echo "test/qr.pl" ;;
lua) echo "test/qr.lua" ;;
bash) echo "test/qr.sh" ;;
r) echo "test/qr.r" ;;
awk) echo "test/qr.awk" ;;
tcl) echo "test/qr.tcl" ;;
scheme) echo "test/qr.scm" ;;
commonlisp) echo "test/qr.lisp" ;;
lisp) echo "test/qr.lisp" ;;
clojure) echo "test/qr.clj" ;;
elixir) echo "test/qr.ex" ;;
erlang) echo "test/qr.erl" ;;
groovy) echo "test/qr.groovy" ;;
raku) echo "test/qr.raku" ;;
julia) echo "test/qr.jl" ;;
dart) echo "test/qr.dart" ;;
prolog) echo "test/qr.pro" ;;
forth) echo "test/qr.forth" ;;
powershell) echo "test/qr.ps1" ;;
objc) echo "test/qr.m" ;;
v) echo "test/qr.v" ;;
go) echo "test/qr.go" ;;
rust) echo "test/qr.rs" ;;
c) echo "test/qr.c" ;;
cpp) echo "test/qr.cpp" ;;
java) echo "test/qr.java" ;;
kotlin) echo "test/qr.kt" ;;
csharp) echo "test/qr.cs" ;;
dotnet) echo "test/qr.cs" ;;
fsharp) echo "test/qr.fs" ;;
haskell) echo "test/qr.hs" ;;
ocaml) echo "test/qr.ml" ;;
d) echo "test/qr.d" ;;
nim) echo "test/qr.nim" ;;
zig) echo "test/qr.zig" ;;
crystal) echo "test/qr.cr" ;;
fortran) echo "test/qr.f90" ;;
cobol) echo "test/qr.cob" ;;
deno) echo "test/qr.ts" ;;
*) echo "" ;;
esac
}
SDK_FILE=$(get_sdk_file "$LANG")
echo "=== Functional Tests: $LANG ==="
@ -443,6 +495,23 @@ run_test "sdk_runs" \
echo ""
# ============================================================================
# SECTION 9: QR Code Generation Tests
# ============================================================================
echo "--- QR Code Generation ---"
QR_FILE=$(get_qr_file "$LANG")
if [ -n "$QR_FILE" ] && [ -f "$QR_FILE" ]; then
# Test 9.1: QR code generation produces structured output
run_test "qr_generate" \
"build/un -s '$LANG' '$QR_FILE'" \
"QR:unsandbox-qr-ok:ROWS:[0-9]+"
else
echo "SKIP: No QR test file for $LANG"
fi
echo ""
# ============================================================================
# Results Summary
# ============================================================================