Point every harness's default toolchain at build/packages/ziran/build, drop the removed `zi2zx bundle` form, link the generated C each harness actually gets (whole generated folders where the test has no stubs, and Kryon's package-prefixed frame pacing module), and stop listing the header-only type module in the modal rules test. Twenty-two more test targets pass from a clean export; plans/2026-11-17-test-harnesses.md lists the 54 that still fail and why.
36 lines
1.1 KiB
Bash
36 lines
1.1 KiB
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
bin=${1:-"$root/build/packages/ziran/build/bin"}
|
|
work=$root/build/export-filename-zi-test
|
|
rm -rf "$work/generated"
|
|
mkdir -p "$work/generated"
|
|
"$bin/zi2c" --no-main --root "$root/src" \
|
|
-o "$work/generated" "$root/src/storage/export_filename.zi"
|
|
generated_sources=$(find "$work/generated" -name '*.c' | sort)
|
|
"${CC:-cc}" -std=c11 -Wall -Wextra -Werror \
|
|
-I"$root/build/packages/ziran/include" -I"$work/generated" \
|
|
$generated_sources \
|
|
-x c - -o "$work/test" <<'EOF'
|
|
#include "storage/export_filename.h"
|
|
#include <assert.h>
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
|
|
int main(void)
|
|
{
|
|
uint8_t name[32];
|
|
ExportFilenameAt(1781312523, name, sizeof name);
|
|
assert(strcmp((char *)name, "inbe-1781312523.zip") == 0);
|
|
ExportFilenameAt(0, name, sizeof name);
|
|
assert(strcmp((char *)name, "inbe.zip") == 0);
|
|
ExportFilenameAt(1781312523, name, 19);
|
|
assert(name[0] == 0);
|
|
ExportFilenameAt(1781312523, name, 20);
|
|
assert(strcmp((char *)name, "inbe-1781312523.zip") == 0);
|
|
return 0;
|
|
}
|
|
EOF
|
|
env -u DISPLAY -u WAYLAND_DISPLAY "$work/test"
|