From 7209629bec3961fcc12b150ba6df546d3997b6c2 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 16 Aug 2024 10:53:10 -0700 Subject: [PATCH] Testing: Add an env var to pick the V8 binary (#6836) Also we had a mix of os.environ.get and os.getenv. Prefer the former, as the default value does actual work, so it's a little more efficient to not run it unnecessarily. That is, os.getenv('X', work()) is less efficient than os.environ.get('X') or work(). --- scripts/test/shared.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/test/shared.py b/scripts/test/shared.py index d593aa45b5a..91612a8d9d9 100644 --- a/scripts/test/shared.py +++ b/scripts/test/shared.py @@ -195,10 +195,10 @@ def is_exe(fpath): which('gcc') or which('clang')) NATIVEXX = (os.environ.get('CXX') or which('mingw32-g++') or which('g++') or which('clang++')) -NODEJS = os.getenv('NODE', which('node') or which('nodejs')) +NODEJS = os.environ.get('NODE') or which('node') or which('nodejs') MOZJS = which('mozjs') or which('spidermonkey') -V8 = which('v8') or which('d8') +V8 = os.environ.get('V8') or which('v8') or which('d8') BINARYEN_INSTALL_DIR = os.path.dirname(options.binaryen_bin) WASM_OPT = [os.path.join(options.binaryen_bin, 'wasm-opt')]