diff --git a/scripts/generate-coverage-docs.sh b/scripts/generate-coverage-docs.sh index 49c59f713..e18943243 100644 --- a/scripts/generate-coverage-docs.sh +++ b/scripts/generate-coverage-docs.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash set -e -set -x NB_CORES="$(grep --count '^processor' /proc/cpuinfo)" TMPDIR_RUN="$(mktemp -d)" @@ -9,14 +8,15 @@ TMPDIR_COV="$(mktemp)" GEF_DIR="$(pwd)" GEF_TESTS_DIR="${GEF_DIR}/tests" GEF_DOCS_DIR="${GEF_DIR}/docs/coverage" +PY_VER=$(gdb -q -nx -ex 'pi print(f"{sys.version_info.major}.{sys.version_info.minor}", end="")' -ex quit) rm -f -- "${GEF_DOCS_DIR}"/* echo "[+] Generating coverage report in '${TMPDIR_RUN}'" -COVERAGE_DIR="${TMPDIR_RUN}" python3.9 -m pytest -n ${NB_CORES} "${GEF_TESTS_DIR}" +COVERAGE_DIR="${TMPDIR_RUN}" python${PY_VER} -m pytest -n ${NB_CORES} "${GEF_TESTS_DIR}" echo "[+] Combining data to '${TMPDIR_COV}'" -python3.9 -m coverage combine --data-file=${TMPDIR_COV} "${TMPDIR_RUN}"/* +python${PY_VER} -m coverage combine --data-file=${TMPDIR_COV} "${TMPDIR_RUN}"/* echo "[+] Generating HTML report to '${GEF_DOCS_DIR}'" -python3.9 -m coverage html --data-file="${TMPDIR_COV}" --include='*/gef.py' --directory="${GEF_DOCS_DIR}" +python${PY_VER} -m coverage html --data-file="${TMPDIR_COV}" --include='*/gef.py' --directory="${GEF_DOCS_DIR}"