Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] fixed bad python version for coverage docs
- Loading branch information
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -x | ||
|
||
NB_CORES="$(grep --count '^processor' /proc/cpuinfo)" | ||
TMPDIR_RUN="$(mktemp -d)" | ||
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}" |