Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/test/run-canvas-numeric-triangles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
7 changes: 4 additions & 3 deletions packages/core/test/run-compiled-audio-worklet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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++}
Expand Down
8 changes: 5 additions & 3 deletions packages/core/test/run-reactive-list-position.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion packages/core/test/test_reactive_list_position_main.cpp
Original file line number Diff line number Diff line change
@@ -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 <cassert>
#include <cstdio>
Expand Down
Loading