Skip to content

Commit

Permalink
[docs] fixed bad python version for coverage docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hugsy committed Oct 13, 2022
1 parent 1fd0f34 commit b54508a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/generate-coverage-docs.sh
@@ -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}"

0 comments on commit b54508a

Please sign in to comment.