The codex-daochi-client-mesh-client-rename integration, committed as that task staged it: mesh_client replaces daochi_client, account storage and tests move to the Mesh names, and docs, locales and CI follow, with existing accounts, encrypted records and local storage kept compatible. The task stopped before its dependency versions were pushed; the next commit moves Breeze to the pushed pins it needs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
69 lines
3.0 KiB
Bash
69 lines
3.0 KiB
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
bin=${1:-"$root/build/packages/ziran/build/bin"}
|
|
work=${NAVIGATION_ROUTES_TEST_BUILD_DIR:-"$root/build/navigation-routes-test"}
|
|
source=$root/tests/navigation_routes_behavior.zi
|
|
include=${ZIRAN_INCLUDE:-"$root/build/packages/ziran/include"}
|
|
|
|
mkdir -p "$work/ir"
|
|
"$bin/zi2zir" --root "$root/tests" --module-path "$root/src" \
|
|
--module-path "$root/build/packages/kryon/src/ui" \
|
|
--module-path "$root/build/packages/ziran/std" --module-path "$root/build/packages/mesh-client" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") --module-path "$root/build/packages/kryon/src/backend" \
|
|
-o "$work/ir" "$source"
|
|
|
|
for input in source saved; do
|
|
if [ "$input" = source ]; then
|
|
file=$source
|
|
module_root=$root/tests
|
|
module_path=$root/src
|
|
else
|
|
file=$work/ir/navigation_routes_behavior.zir
|
|
module_root=$work/ir
|
|
module_path=$work/ir
|
|
fi
|
|
output=$work/$input
|
|
rm -rf "$output/c" "$output/go"
|
|
mkdir -p "$output/c" "$output/go"
|
|
"$bin/zi2zx" --root "$module_root" \
|
|
--module-path "$module_path" \
|
|
--module-path "$root/build/packages/kryon/src/ui" \
|
|
--module-path "$root/build/packages/ziran/std" --module-path "$root/build/packages/mesh-client" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") --module-path "$root/build/packages/kryon/src/backend" \
|
|
--entry navigation_routes_behavior:Answer \
|
|
-o "$output/navigation_routes.zx" "$file"
|
|
[ "$("$bin/zi2zx" run "$output/navigation_routes.zx")" = 42 ]
|
|
|
|
"$bin/zi2c" --no-main --root "$module_root" \
|
|
--module-path "$module_path" \
|
|
--module-path "$root/build/packages/kryon/src/ui" \
|
|
--module-path "$root/build/packages/ziran/std" --module-path "$root/build/packages/mesh-client" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") --module-path "$root/build/packages/kryon/src/backend" \
|
|
-o "$output/c" "$file"
|
|
cat > "$output/c/main.c" <<'C'
|
|
#include "navigation_routes_behavior.h"
|
|
int main(void) { return Answer() == 42 ? 0 : 1; }
|
|
C
|
|
"${CC:-cc}" -std=c11 -I"$include" -I"$output/c" \
|
|
"$output/c/"*.c -o "$output/c/test"
|
|
env -u DISPLAY -u WAYLAND_DISPLAY "$output/c/test"
|
|
|
|
"$bin/zi2go" --no-main --root "$module_root" \
|
|
--module-path "$module_path" \
|
|
--module-path "$root/build/packages/kryon/src/ui" \
|
|
--module-path "$root/build/packages/ziran/std" --module-path "$root/build/packages/mesh-client" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") --module-path "$root/build/packages/kryon/src/backend" \
|
|
-o "$output/go" "$file"
|
|
cat > "$output/go/navigation_routes_behavior_test.go" <<'GO'
|
|
package ziran
|
|
import "testing"
|
|
func TestNavigationRoutes(t *testing.T) {
|
|
if got := NavigationRoutesBehavior_Answer(); got != 42 {
|
|
t.Fatalf("navigation routes: got %d, want 42", got)
|
|
}
|
|
}
|
|
GO
|
|
GO111MODULE=off go test "$output/go"/*.go
|
|
done
|
|
|
|
cmp "$work/source/navigation_routes.zx" "$work/saved/navigation_routes.zx"
|
|
echo "navigation routes Ziran test passed"
|