Debian Codegraph @

rpython/jit/backend/riscv/test/conftest.py

raw symbols SCIP
1 """
2 This disables the backend tests on non riscV platforms.
3 Note that you need "--slow" to run translation tests.
4 """
5 import os
6 import pytest
7 from rpython.jit.backend import detect_cpu
8
9 cpu = detect_cpu.autodetect()
10 IS_RISCV = cpu.startswith( 'riscv64')
11 THIS_DIR = os.path.dirname(__file__)
12
13 @pytest.hookimpl(tryfirst=True)
14 def pytest_ignore_collect(path, config):
15 path = str(path)
16 if not IS_RISCV:
17 if os.path.commonprefix([path, THIS_DIR]) == THIS_DIR: # workaround for bug in pytest<3.0.5
18 return True
19
20 def pytest_collect_file():
21 if not IS_RISCV:
22 # We end up here when calling py.test .../test_foo.py with a wrong cpu
23 # It's OK to kill the whole session with the following line
24 pytest.skip("RISCV tests skipped: cpu is %r" % (cpu,))