| 1 |
""" |
| 2 |
This disables the backend tests on non ARM64 platforms. |
| 3 |
Note that you need "--slow" to run translation tests. |
| 4 |
""" |
| 5 |
import os |
| 6 |
import sys |
| 7 |
import pytest |
| 8 |
from rpython.jit.backend import detect_cpu |
| 9 |
|
| 10 |
cpu = detect_cpu.autodetect() |
| 11 |
IS_ARM64 = cpu.startswith('aarch64') |
| 12 |
IS_MACOS = sys.platform == 'darwin' |
| 13 |
IS_PYPY = 'pypyjit' in sys.builtin_module_names |
| 14 |
THIS_DIR = os.path.dirname(__file__) |
| 15 |
|
| 16 |
@pytest.hookimpl(tryfirst=True) |
| 17 |
def pytest_ignore_collect(path, config): |
| 18 |
path = str(path) |
| 19 |
if not IS_ARM64: |
| 20 |
if os.path.commonprefix([path, THIS_DIR]) == THIS_DIR: |
| 21 |
return True |
| 22 |
|
| 23 |
def pytest_collect_file(): |
| 24 |
if not IS_ARM64: |
| 25 |
|
| 26 |
|
| 27 |
pytest.skip("ARM64 tests skipped: cpu is %r" % (cpu,)) |
| 28 |
|
| 29 |
if IS_ARM64 and IS_MACOS and IS_PYPY: |
| 30 |
|
| 31 |
@pytest.fixture(autouse=True) |
| 32 |
def raise_if_jit(): |
| 33 |
import pypyjit |
| 34 |
pypyjit.set_param("off") |