maint: add a dependency check to coverage

This commit implements a dependency check to the `maint/coverage`
script, that checks for the rustup, python3, and grcov binaries in
$PATH; the bs4 and lxml python packages; and the llvm-tools Rust
component.

Fixes #776
This commit is contained in:
Emil Engler 2023-02-16 15:38:38 +01:00
parent 943e4414fe
commit b4b8d040a0
No known key found for this signature in database
GPG Key ID: 2F6D4145C55FC7C7
1 changed files with 23 additions and 0 deletions

View File

@ -30,6 +30,29 @@ cd "$TOPDIR"
UNIT=no
INTEGRATION=no
# Check if all dependencies are satisfied
DEPS_BINARY=("rustup" "python3" "grcov")
DEPS_PYTHON=("bs4" "lxml")
for bin in "${DEPS_BINARY[@]}"; do
if ! type "$bin" > /dev/null; then
echo "Missing $bin in PATH"
exit 1
fi
done
for pkg in "${DEPS_PYTHON[@]}"; do
if ! python3 -c "import $pkg" > /dev/null; then
echo "Missing python package $pkg"
exit 1
fi
done
if ! rustup component list --installed | grep llvm-tools &> /dev/null; then
echo "Missing llvm-tools in the Rust toolchain"
exit 1
fi
while getopts "ch" opt ; do
case "$opt" in
h) usage