Files
breeze/tests/media_store_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

45 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
set -eu
# The account's media library against a real SQLite database in a
# temporary directory, with the test host's stand-in image decoder.
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=$root/build/media-store-zi-test
include=$root/build/packages/ziran/include
exec 9>"$work.lock"
flock 9
rm -rf "$work"
mkdir -p "$work/generated"
cd "$root"
"$ziran" build --project --offline ${PACKAGE_FLAGS:-} --target=c \
--define PLATFORM_DESKTOP --root "$root/tests" \
--entry media_store_behavior:Check \
-o "$work/generated" "$root/tests/media_store_behavior.zi" \
"$root/tests/sync_test_host.zi"
cat > "$work/generated/main.c" <<'C'
#include "media_store_behavior.h"
#include <stdio.h>
/* Files are flushed by the browser's storage only on the web. */
void app_web_storage_flush(void) {}
int main(void)
{
int result = Check();
if (result != 0) fprintf(stderr, "media store check failed with code %d\n", result);
return result == 0 ? 0 : 1;
}
C
"${CC:-cc}" -std=c11 -O0 -ffunction-sections -fdata-sections \
-I"$include" -I"$work/generated" -I"$root/vendor-builds/sqlite" \
-I"$root/vendor-builds/linux/x86_64/inbe-liboqs/include" \
"$work/generated"/*.c "$root/vendor-builds/sqlite/sqlite3.c" "$liboqs" \
-Wl,--gc-sections -ldl -lpthread -lz -lm -o "$work/test"
APP_DATA_ROOT=$work/data
export APP_DATA_ROOT
env -u DISPLAY -u WAYLAND_DISPLAY "$work/test"
rm -rf "$work/data"
echo "Media library: one copy per photo, capture days, previews, Trash, queries and asset access passed"