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
4 changes: 2 additions & 2 deletions test/benchmark/benchmark_sse.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
sys.path.insert(0, __testdir__)

import clang_native
from common import EMRUN, test_file
from common import EMCC, EMRUN, test_file

from tools import config
from tools.shared import CLANG_CXX, EMCC
from tools.shared import CLANG_CXX
from tools.utils import WINDOWS, run_process, write_file

# System info
Expand Down
4 changes: 2 additions & 2 deletions test/browser_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import common
import psutil
from common import (
EMCC,
TEST_ROOT,
RunnerCore,
compiler_for,
Expand All @@ -37,8 +38,7 @@

from tools import feature_matrix, utils
from tools.feature_matrix import OLDEST_SUPPORTED_FIREFOX, UNSUPPORTED
from tools.shared import EMCC, exit_with_error
from tools.utils import LINUX, MACOS, WINDOWS, memoize, path_from_root, read_binary
from tools.utils import LINUX, MACOS, WINDOWS, exit_with_error, memoize, path_from_root, read_binary

logger = logging.getLogger('common')

Expand Down
10 changes: 9 additions & 1 deletion test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from tools import building, config, shared, utils
from tools.feature_matrix import Feature
from tools.settings import COMPILE_TIME_SETTINGS
from tools.shared import EMCC, EMXX, get_canonical_temp_dir
from tools.shared import get_canonical_temp_dir
from tools.utils import (
WINDOWS,
exe_path_from_root,
Expand Down Expand Up @@ -76,8 +76,16 @@
EMCONFIGURE = exe_path_from_root('emconfigure')
EMCONFIG = exe_path_from_root('em-config')
EMRUN = exe_path_from_root('emrun')
EMCC = exe_path_from_root('emcc')
EMXX = exe_path_from_root('em++')
EMAR = exe_path_from_root('emar')
EMRANLIB = exe_path_from_root('emranlib')
FILE_PACKAGER = exe_path_from_root('tools/file_packager')
WASM_DIS = os.path.join(building.get_binaryen_bin(), 'wasm-dis')
WASM_LD = shared.llvm_tool_path('wasm-ld')
LLVM_COV = shared.llvm_tool_path('llvm-cov')
LLVM_OBJDUMP = shared.llvm_tool_path('llvm-objdump')
LLVM_PROFDATA = shared.llvm_tool_path('llvm-profdata')
PYTHON = sys.executable


Expand Down
4 changes: 2 additions & 2 deletions test/sockets_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import clang_native
import common
from common import PYTHON
from common import EMCC, PYTHON
from decorators import test_file

from tools import config
from tools.shared import CLANG_CC, EMCC
from tools.shared import CLANG_CC
from tools.utils import run_process

npm_checked = False
Expand Down
5 changes: 3 additions & 2 deletions test/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@
import zlib
from abc import ABC, abstractmethod
from pathlib import Path
from subprocess import PIPE

if __name__ == '__main__':
raise Exception('do not run this file directly; do something like: test/runner.py benchmark')

import clang_native
import common
import jsrun
from common import compiler_for, copy_asset, read_binary, read_file, test_file
from common import EMCC, compiler_for, copy_asset, read_binary, read_file, test_file
from decorators import needs_make, parameterized

from tools import utils
from tools.shared import CLANG_CC, CLANG_CXX, EMCC, PIPE, config
from tools.shared import CLANG_CC, CLANG_CXX, config
from tools.utils import run_process

# standard arguments for timing:
Expand Down
3 changes: 2 additions & 1 deletion test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
is_safari,
)
from common import (
EMCC,
FILE_PACKAGER,
WEBIDL_BINDER,
copy_asset,
copytree,
Expand Down Expand Up @@ -72,7 +74,6 @@
from tools import ports, shared, utils
from tools.feature_matrix import Feature
from tools.link import binary_encode
from tools.shared import EMCC, FILE_PACKAGER
from tools.utils import WINDOWS, delete_dir, write_binary, write_file


Expand Down
12 changes: 8 additions & 4 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@
import time
from functools import wraps
from pathlib import Path
from subprocess import PIPE

if __name__ == '__main__':
raise Exception('do not run this file directly; do something like: test/runner')

import clang_native
import common
from common import (
EMAR,
EMBUILDER,
EMCC,
EMXX,
FILE_PACKAGER,
LLVM_COV,
LLVM_PROFDATA,
NON_ZERO,
PYTHON,
WEBIDL_BINDER,
Expand Down Expand Up @@ -79,7 +86,6 @@
)

from tools import building, config, shared, utils, webassembly
from tools.shared import EMAR, EMCC, EMXX, FILE_PACKAGER, LLVM_COV, LLVM_PROFDATA, PIPE
from tools.utils import LINUX, MACOS, WINDOWS, delete_file, write_file

# decorators for limiting which modes a test can run in
Expand Down Expand Up @@ -6866,9 +6872,7 @@ def test_sse_diagnostics(self):
self.cflags.remove('-Werror')
src = test_file('sse/test_sse_diagnostic.cpp')

p = self.run_process(
[shared.EMXX, src, '-msse', '-DWASM_SIMD_COMPAT_SLOW'] + self.get_cflags(),
stderr=PIPE)
p = self.run_process([EMXX, src, '-msse', '-DWASM_SIMD_COMPAT_SLOW'] + self.get_cflags(), stderr=PIPE)
self.assertContained('Instruction emulated via slow path.', p.stderr)

@wasm_relaxed_simd
Expand Down
5 changes: 2 additions & 3 deletions test/test_emrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
import os
import shlex
import subprocess
from subprocess import PIPE

from browser_common import BrowserCore, get_browser, has_browser
from common import EMRUN, RunnerCore, path_from_root, read_file, test_file
from common import EMCC, EMRUN, RunnerCore, path_from_root, read_file, test_file
from decorators import also_with_pthreads

from tools.shared import EMCC, PIPE


class emrun(RunnerCore):
def test_emrun_info(self):
Expand Down
3 changes: 1 addition & 2 deletions test/test_jslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@

from subprocess import PIPE

from common import RunnerCore, copy_asset, create_file, read_file, test_file
from common import EMCC, RunnerCore, copy_asset, create_file, read_file, test_file
from decorators import also_with_wasm2js, also_with_wasm64, parameterized, requires_node_25

from tools.shared import EMCC
from tools.utils import delete_file


Expand Down
12 changes: 6 additions & 6 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,20 @@
import jsrun
import line_endings
from common import (
EMAR,
EMBUILDER,
EMCC,
EMCMAKE,
EMCONFIG,
EMCONFIGURE,
EMMAKE,
EMRANLIB,
EMXX,
FILE_PACKAGER,
NON_ZERO,
PYTHON,
TEST_ROOT,
WASM_LD,
WEBIDL_BINDER,
RunnerCore,
check_node_version,
Expand Down Expand Up @@ -107,16 +113,10 @@
from tools.shared import (
CLANG_CC,
CLANG_CXX,
EMAR,
EMCC,
EMRANLIB,
EMXX,
FILE_PACKAGER,
LLVM_AR,
LLVM_DWARFDUMP,
LLVM_DWP,
LLVM_NM,
WASM_LD,
config,
)
from tools.system_libs import DETERMINISTIC_PREFIX
Expand Down
5 changes: 3 additions & 2 deletions test/test_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

from common import (
EMBUILDER,
EMCC,
EMCONFIG,
EMXX,
RunnerCore,
create_file,
ensure_dir,
Expand All @@ -27,9 +29,8 @@
)
from decorators import no_windows, only_windows, parameterized, with_env_modify

from tools import building, cache, ports, response_file, shared, utils
from tools import building, cache, config, ports, response_file, shared, utils
from tools.config import EM_CONFIG
from tools.shared import EMCC, EMXX, config
from tools.utils import delete_dir, delete_file

SANITY_FILE = cache.get_path('sanity.txt')
Expand Down
4 changes: 1 addition & 3 deletions test/test_sockets_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
raise Exception('do not run this file directly; do something like: test/runner sockets_node')

import common
from common import NON_ZERO, RunnerCore, create_file
from common import EMCC, NON_ZERO, RunnerCore, create_file
from decorators import (
also_with_proxy_to_pthread,
crossplatform,
Expand All @@ -30,8 +30,6 @@
requires_python_dev_packages,
)

from tools.shared import EMCC


def requires_jspi_node(func):
# require_jspi() falls back to the d8/SpiderMonkey shells when node is too
Expand Down
3 changes: 1 addition & 2 deletions tools/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
LLVM_NM,
LLVM_OBJCOPY,
LLVM_OBJDUMP,
WASM_LD,
asmjs_mangle,
check_call,
demangle_c_symbol_name,
Expand All @@ -57,8 +56,8 @@
# Building
binaryen_checked = False
EXPECTED_BINARYEN_VERSION = 132
WASM_LD = shared.llvm_tool_path('wasm-ld')

_is_ar_cache: dict[str, bool] = {}
# the exports the user requested
user_requested_exports: set[str] = set()
# JS library symbols exported via the `__export` decorator.
Expand Down
3 changes: 0 additions & 3 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,6 @@ def init():
LLVM_DWARFDUMP = llvm_tool_path('llvm-dwarfdump')
LLVM_OBJCOPY = llvm_tool_path('llvm-objcopy')
LLVM_OBJDUMP = llvm_tool_path('llvm-objdump')
WASM_LD = llvm_tool_path('wasm-ld')
LLVM_PROFDATA = llvm_tool_path('llvm-profdata')
LLVM_COV = llvm_tool_path('llvm-cov')

EMCC = exe_path_from_root('emcc')
EMXX = exe_path_from_root('em++')
Expand Down
Loading