From 81f4b41917ab259747c3a342d33fe21e3989e0aa Mon Sep 17 00:00:00 2001 From: Tamay Eser Uysal Date: Mon, 19 Oct 2026 22:52:06 +0200 Subject: [PATCH] Honour GEA_COMPILER_CLI and GEA_COMPILER_RUNTIME, which the release suite exports, in the four tests that still resolved the compiler as a sibling checkout --- packages/core/test/run-canvas-numeric-triangles.sh | 2 +- packages/core/test/run-compiled-audio-worklet.sh | 7 ++++--- .../core/test/run-native-typed-websocket-retirement.sh | 2 +- packages/core/test/run-reactive-list-position.sh | 8 +++++--- packages/core/test/test_reactive_list_position_main.cpp | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/core/test/run-canvas-numeric-triangles.sh b/packages/core/test/run-canvas-numeric-triangles.sh index 73758ef..36677b2 100644 --- a/packages/core/test/run-canvas-numeric-triangles.sh +++ b/packages/core/test/run-canvas-numeric-triangles.sh @@ -14,5 +14,5 @@ void __gea_top_level() {} CPP gea_build_native_test "$BUILD_DIR" "$BUILD_DIR/canvas-numeric-triangles" \ "$ROOT/packages/core/test/test_canvas_numeric_triangles_main.cpp" \ - "-I$ROOT/../compiler/src/targets/cpp/runtime" + "-I${GEA_COMPILER_RUNTIME:-$ROOT/../compiler/src/targets/cpp/runtime}" "$BUILD_DIR/canvas-numeric-triangles" diff --git a/packages/core/test/run-compiled-audio-worklet.sh b/packages/core/test/run-compiled-audio-worklet.sh index 50bebe4..dab2198 100755 --- a/packages/core/test/run-compiled-audio-worklet.sh +++ b/packages/core/test/run-compiled-audio-worklet.sh @@ -4,19 +4,20 @@ cd "$(dirname "$0")/../../.." out="$PWD/packages/geatsc-plugin-gea/dist" test -d "$out" export TMPDIR="$out" +export GEA_COMPILER_CLI="${GEA_COMPILER_CLI:-$PWD/../compiler/dist/cli.js}" node --input-type=module <<'JS' import assert from 'node:assert/strict' import path from 'node:path' import { createRequire } from 'node:module' import { validateWorkletRegistrations } from './packages/core/scripts/gea-worker-modules.mjs' -const ts = createRequire(path.resolve('../compiler/package.json'))('typescript') +const ts = createRequire(path.resolve(path.dirname(process.env.GEA_COMPILER_CLI), '../package.json'))('typescript') const implementation = path.resolve('packages/core/runtime/audio-worklet.ts') validateWorkletRegistrations(ts, path.resolve('packages/core/test/test_audio_worklet_compiled.ts'), implementation) assert.throws(() => validateWorkletRegistrations(ts, path.resolve('packages/core/test/test_audio_worklet_parameters_rejected.ts'), implementation), /AudioParam parameterDescriptors/) assert.throws(() => validateWorkletRegistrations(ts, path.resolve('packages/core/test/test_audio_worklet_unknown_constructor.ts'), implementation), /directly named class constructor/) assert.doesNotThrow(() => validateWorkletRegistrations(ts, path.resolve('packages/core/test/test_audio_worklet_abstract_constructor.ts'), implementation)) JS -GEATSC2_GEA_PLUGIN="$out/host-shims" node ../compiler/dist/cli.js compile \ +GEATSC2_GEA_PLUGIN="$out/host-shims" node "$GEA_COMPILER_CLI" compile \ packages/core/test/test_audio_worklet_compiled.ts --out-dir "$out" \ --plugin "$out/index.js" --realm-storage --entry-symbol gea_worklet_probe_entry source packages/core/test/native-host.sh @@ -31,7 +32,7 @@ import path from 'node:path' import { spawnSync } from 'node:child_process' const out = path.resolve('packages/geatsc-plugin-gea/dist') const result = spawnSync(process.execPath, [ - '../compiler/dist/cli.js', 'compile', 'packages/core/test/test_audio_worklet_abstract_constructor.ts', + process.env.GEA_COMPILER_CLI, 'compile', 'packages/core/test/test_audio_worklet_abstract_constructor.ts', '--out-dir', out, '--plugin', path.join(out, 'index.js'), '--realm-storage' ], { encoding: 'utf8', env: process.env }) assert.equal(result.error, undefined) diff --git a/packages/core/test/run-native-typed-websocket-retirement.sh b/packages/core/test/run-native-typed-websocket-retirement.sh index e92025c..8691daf 100644 --- a/packages/core/test/run-native-typed-websocket-retirement.sh +++ b/packages/core/test/run-native-typed-websocket-retirement.sh @@ -2,7 +2,7 @@ set -euo pipefail TEST_DIR=$(cd "$(dirname "$0")" && pwd) CORE_ROOT=$(cd "$TEST_DIR/../../.." && pwd) -COMPILER_ROOT=$(cd "$CORE_ROOT/../compiler" && pwd) +if [[ -n "${GEA_COMPILER_CLI:-}" ]]; then COMPILER_ROOT=$(cd "$(dirname "$GEA_COMPILER_CLI")/.." && pwd); else COMPILER_ROOT=$(cd "$CORE_ROOT/../compiler" && pwd); fi OUT_DIR="$TEST_DIR/.build/native-typed-websocket-retirement" mkdir -p "$OUT_DIR" CXX_BIN=${CXX:-clang++} diff --git a/packages/core/test/run-reactive-list-position.sh b/packages/core/test/run-reactive-list-position.sh index 9012de1..6b711d0 100755 --- a/packages/core/test/run-reactive-list-position.sh +++ b/packages/core/test/run-reactive-list-position.sh @@ -9,13 +9,15 @@ CXX_BIN="${CXX:-clang++}" export GEA_NATIVE_JOBS="${GEA_NATIVE_JOBS:-1}" export TMPDIR="$BUILD_DIR" source "$ROOT/packages/core/test/native-test-common.sh" -if [[ ! -f "$ROOT/../compiler/src/targets/cpp/runtime/gea_runtime.h" ]]; then - echo "SKIP: reactive list runtime test requires the sibling compiler checkout" >&2 +RUNTIME_DIR="${GEA_COMPILER_RUNTIME:-$ROOT/../compiler/src/targets/cpp/runtime}" +if [[ ! -f "$RUNTIME_DIR/gea_runtime.h" ]]; then + echo "SKIP: reactive list runtime test needs gea_runtime.h under $RUNTIME_DIR (the sibling compiler checkout, or GEA_COMPILER_RUNTIME)" >&2 exit 0 fi cat > "$BUILD_DIR/program.cpp" <<'CPP' void __gea_top_level() {} CPP gea_build_native_test "$BUILD_DIR" "$BUILD_DIR/reactive-list-position" \ - "$ROOT/packages/core/test/test_reactive_list_position_main.cpp" + "$ROOT/packages/core/test/test_reactive_list_position_main.cpp" \ + "-I$RUNTIME_DIR" "$BUILD_DIR/reactive-list-position" diff --git a/packages/core/test/test_reactive_list_position_main.cpp b/packages/core/test/test_reactive_list_position_main.cpp index 5243dbe..2b4cfe6 100644 --- a/packages/core/test/test_reactive_list_position_main.cpp +++ b/packages/core/test/test_reactive_list_position_main.cpp @@ -1,7 +1,7 @@ #define GEA_HOST_DECLARED 1 #include "gea/embedded.h" #include "graphics/font.h" -#include "../../../../compiler/src/targets/cpp/runtime/gea_runtime.h" +#include "gea_runtime.h" #include "native_test_harness.h" #include #include