Files
breeze/tests/lumi_authorization_zi_test.sh
waozi ef0de86e02
Cloudflare Pages / Build and verify the site (push) Successful in 3m29s
Integrate Breeze desktop, Android, and app updates
Use the verified dependency lock across native hosts and bundled apps. Preserve saved styles, local app reactivation, and offline packages while integrating the latest practice, Habits, Lumi, and figure preview updates.
2026-11-20 02:24:34 -03:00

41 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
ziran=${1:-"$root/build/packages/ziran/build/bin/ziran"}
liboqs=${2:-"$root/vendor-builds/linux/x86_64/inbe-liboqs/lib/liboqs.a"}
work=${LUMI_AUTHORIZATION_TEST_OUTPUT:-"$root/build/lumi-authorization-test"}
mkdir -p "$work/generated"
cd "$root"
"$ziran" build --project --offline ${PACKAGE_FLAGS:-} --target=c --define PLATFORM_DESKTOP --root "$root/tests" \
--entry lumi_authorization_behavior:Check -o "$work/generated" \
"$root/tests/lumi_authorization_behavior.zi" "$root/tests/sync_test_host.zi"
cat > "$work/generated/main.c" <<'C'
#include "lumi_authorization_behavior.h"
#include "network_transport.h"
AsyncTransport __wrap_network_transport_NetworkTransport(NetworkTransfer *transfer)
{
(void)transfer;
return OwnerPumpTestTransport();
}
#include <stdio.h>
int main(void)
{
int result = Check();
if (result != 0) fprintf(stderr, "owner consent check failed: %d\n", result);
return result == 0 ? 0 : 1;
}
C
monocypher=$root/build/packages/monocypher/src
"${CC:-cc}" -std=c11 -O0 -ffunction-sections -fdata-sections \
-I"$root/build/packages/ziran/include" -I"$work/generated" \
-I"$root/vendor-builds/sqlite" -I"$root/vendor-builds/linux/x86_64/inbe-liboqs/include" \
-I"$monocypher" -I"$monocypher/optional" \
"$work/generated"/*.c "$root/vendor-builds/sqlite/sqlite3.c" \
"$monocypher/monocypher.c" "$monocypher/optional/monocypher-ed25519.c" \
"$liboqs" -Wl,--gc-sections -Wl,--wrap=network_transport_NetworkTransport -ldl -lpthread -lz -lm -o "$work/test"
APP_DATA_ROOT=/tmp/inbe-lumi-authorization-test/data \
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
YUE_DESKTOP_RECOVERY=0 "$work/test"
printf '%s\n' 'Lumi owner consent signature, scope, envelope, clock and cancellation checks passed'