From 618aa1870fdd205527c0069c605062737f662562 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Wed, 19 Jul 2023 11:59:42 -0700 Subject: [PATCH] Create arch integration test --- test/arch/run.sh | 17 +++++++++++++++++ test/arch/yarn.js | 4 ++++ 2 files changed, 21 insertions(+) create mode 100755 test/arch/run.sh create mode 100644 test/arch/yarn.js diff --git a/test/arch/run.sh b/test/arch/run.sh new file mode 100755 index 0000000..a85e45f --- /dev/null +++ b/test/arch/run.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -eo pipefail + +THIS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +: "${NODE_BIN:=node}" + +if [ "$(/usr/bin/arch)" != "arm64" ]; then + echo "arch/run.sh: This must be run on Apple Silicon." >&2 + exit +fi + +# shellcheck disable=SC2016 +"$NODE_BIN" "$THIS_DIR/yarn.js" config get init.author.name >/dev/null +/usr/bin/arch -x86_64 "$NODE_BIN" "$THIS_DIR/yarn.js" config get init.author.name >/dev/null + +echo "Success!" diff --git a/test/arch/yarn.js b/test/arch/yarn.js new file mode 100644 index 0000000..e4f8d2a --- /dev/null +++ b/test/arch/yarn.js @@ -0,0 +1,4 @@ +'use strict'; + +require ('../../v8-compile-cache.js'); +require('yarn/lib/cli.js');