From 94f1cb5efdda293f169ea7047724de24197265ff Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Tue, 3 Sep 2024 16:27:55 +0100 Subject: [PATCH] Update QuickJS test suite to bootstrap its own QuickJS runtime. --- tests/quickjs/.gitignore | 3 ++- tests/quickjs/bootstrap.sh | 13 +++++++++++++ tests/quickjs/premake5.lua | 2 +- tests/quickjs/test.sh | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100755 tests/quickjs/bootstrap.sh diff --git a/tests/quickjs/.gitignore b/tests/quickjs/.gitignore index 36316b01..b276e0f3 100644 --- a/tests/quickjs/.gitignore +++ b/tests/quickjs/.gitignore @@ -1,4 +1,5 @@ -gen +runtime/ +gen/ *.so *.dylib *.dll diff --git a/tests/quickjs/bootstrap.sh b/tests/quickjs/bootstrap.sh new file mode 100755 index 00000000..c0d1666e --- /dev/null +++ b/tests/quickjs/bootstrap.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -e +dir=$(cd "$(dirname "$0")"; pwd) +rootdir="$dir/../.." + +if [ ! -d runtime ]; then + git clone https://github.com/quickjs-ng/quickjs.git runtime + git -C runtime reset --hard 0e5e9c2c49db15ab9579edeb4d90e610c8b8463f +fi + +if [ ! -f runtime/build/qjs ]; then + make -C runtime/ +fi diff --git a/tests/quickjs/premake5.lua b/tests/quickjs/premake5.lua index d80e004d..784ede1b 100644 --- a/tests/quickjs/premake5.lua +++ b/tests/quickjs/premake5.lua @@ -1,4 +1,4 @@ -local qjs_dir = path.getabsolute("../../deps/quickjs") +local qjs_dir = path.getabsolute("./runtime") local runtime = "../../src/Generator/Generators/QuickJS/Runtime" workspace "qjs" diff --git a/tests/quickjs/test.sh b/tests/quickjs/test.sh index b97be557..046657c4 100755 --- a/tests/quickjs/test.sh +++ b/tests/quickjs/test.sh @@ -5,7 +5,7 @@ rootdir="$dir/../.." dotnet_configuration=Release configuration=debug platform=x64 -jsinterp="$rootdir/deps/quickjs/qjs-debug" +jsinterp="$dir/runtime/build/qjs" red=`tput setaf 1` green=`tput setaf 2`