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 ebd5b31a96..28c87f1ff2 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..036a9fff3e 100644 --- a/conda-recipe/run_test.sh +++ b/conda-recipe/run_test.sh @@ -2,7 +2,46 @@ set -euxo pipefail -pytest -q -ra --disable-warnings --pyargs numba_dppy -vv +DEBUGGER_VERSION=10.1.2 +if [[ -v ONEAPI_ROOT ]]; then + DEBUGGER_DIR="${ONEAPI_ROOT}/debugger/${DEBUGGER_VERSION}" +else + DEBUGGER_DIR="/opt/intel/oneapi/debugger/${DEBUGGER_VERSION}" +fi + +if [[ -d "${DEBUGGER_DIR}" ]]; then + echo "Using debugger from: ${DEBUGGER_DIR}" + set +x + # shellcheck disable=SC1091 + . "${DEBUGGER_DIR}/env/vars.sh" + set -x +else + echo "Debugger is not installed: ${DEBUGGER_DIR}" +fi + +PYARGS="-k test_debug_dppy_numba -k dummy" +pytest -q -ra --disable-warnings --pyargs numba_dppy -vv ${PYARGS} + +exit 0 + +# PYTEST_ARGS="-q -ra --disable-warnings" +# PYARGS="numba_dppy -vv" +# DEBUGGER_VERSION=10.1.2 + +# if [ -n "$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 c9ae3e3b1c..a165416a97 100644 --- a/numba_dppy/tests/test_debug_dppy_numba.py +++ b/numba_dppy/tests/test_debug_dppy_numba.py @@ -25,10 +25,26 @@ pexpect = pytest.importorskip("pexpect") -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 @@ -45,8 +61,8 @@ def spawn(self): env["NUMBA_OPT"] = "0" self.child = pexpect.spawn("gdb-oneapi -q python", env=env, encoding="utf-8") - if config.DEBUG: - self.child.logfile = sys.stdout + # if config.DEBUG: + self.child.logfile = sys.stdout def setup_gdb(self): self.child.expect("(gdb)", timeout=5) @@ -108,6 +124,10 @@ def app(): return gdb() +def test_dummy(): + assert True + + @pytest.mark.parametrize("api", ["numba", "numba-dppy"]) def test_breakpoint_row_number(app, api): app.breakpoint("dppy_numba_basic.py:25")