Skip to content

Commit

Permalink
Create arch integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
yungsters committed Jul 19, 2023
1 parent fa3ae4f commit 6f341e0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/arch/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/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" >/dev/null
/usr/bin/arch -x86_64 "$NODE_BIN" "$THIS_DIR/yarn.js" >/dev/null

# for f in "$THIS_DIR"/require-*.js; do
# printf 'Running "%s"\n' "$(basename "$f")"
# for _ in {1..5}; do "$NODE_BIN" "$f"; done
# done
4 changes: 4 additions & 0 deletions test/arch/yarn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use strict';

require ('../../v8-compile-cache.js');
require('yarn/bin/yarn.js');

0 comments on commit 6f341e0

Please sign in to comment.