diff --git a/MANIFEST.in b/MANIFEST.in index 4c02572c56..895fc6f2b4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,3 +6,5 @@ recursive-include numba_dppy *.spir include versioneer.py include numba_dppy/_version.py + +recursive-include numba_dppy/examples * diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 6b7ed01993..2b840fddfd 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -9,6 +9,7 @@ build: number: {{ GIT_DESCRIBE_NUMBER }} script_env: - WHEELS_OUTPUT_FOLDER + - NUMBA_DPPY_TESTING_GDB_ENABLE requirements: build: @@ -34,6 +35,7 @@ requirements: test: requires: - pytest + - pexpect about: home: https://github.com/IntelPython/numba-dppy diff --git a/conda-recipe/run_test.sh b/conda-recipe/run_test.sh index b39ec427b0..344ab0bb38 100644 --- a/conda-recipe/run_test.sh +++ b/conda-recipe/run_test.sh @@ -2,7 +2,24 @@ set -euxo pipefail -pytest -q -ra --disable-warnings --pyargs numba_dppy -vv +PYTEST_ARGS="-q -ra --disable-warnings" +PYARGS="numba_dppy -vv" +DEBUGGER_VERSION=10.2.4 + +if [[ -v NUMBA_DPPY_TESTING_GDB_ENABLE ]]; then + PYARGS="$PYARGS -k test_debug_dppy_numba" + + # Activate debugger + if [[ -v ONEAPI_ROOT ]]; then + set +ux + # shellcheck disable=SC1090 + source "${ONEAPI_ROOT}/debugger/${DEBUGGER_VERSION}/env/vars.sh" + set -ux + fi +fi + +# shellcheck disable=SC2086 +pytest $PYTEST_ARGS --pyargs $PYARGS if [[ -v ONEAPI_ROOT ]]; then set +u diff --git a/numba_dppy/tests/test_debug_dppy_numba.py b/numba_dppy/tests/test_debug_dppy_numba.py index b08d2df933..8a0e62a5ca 100644 --- a/numba_dppy/tests/test_debug_dppy_numba.py +++ b/numba_dppy/tests/test_debug_dppy_numba.py @@ -24,11 +24,29 @@ from numba_dppy import config pexpect = pytest.importorskip("pexpect") +if not sys.platform == "linux": + pytest.skip("OS is not linux", allow_module_level=True) -pytestmark = pytest.mark.skipif( - not shutil.which("gdb-oneapi"), - reason="IntelĀ® Distribution for GDB* is not available", -) + +def module_loaded(module_name): + import subprocess + + lsmod = subprocess.Popen(["lsmod"], stdout=subprocess.PIPE) + grep = subprocess.Popen(["grep", module_name], stdin=lsmod.stdout) + grep.communicate() + return grep.returncode == 0 + + +pytestmark = [ + pytest.mark.skipif( + not shutil.which("gdb-oneapi"), + reason="IntelĀ® Distribution for GDB* is not available", + ), + pytest.mark.skipif( + not module_loaded("igfxdcd"), + reason="Module igfxdcd is not loaded", + ), +] # TODO: go to helper