openpgp-card-app/unit-tests/gen_coverage.sh
Charles-Edouard de la Vergne eab32ad7af
Add Unit Tests
2024-02-14 09:29:17 +01:00

16 lines
589 B
Bash
Executable File

#!/bin/bash
set -x
set -e
BUILD_DIRECTORY=$(realpath build/)
lcov --directory . -b "${BUILD_DIRECTORY}" --capture --initial -o coverage.base &&
lcov --rc lcov_branch_coverage=1 --directory . -b "${BUILD_DIRECTORY}" --capture -o coverage.capture &&
lcov --directory . -b "${BUILD_DIRECTORY}" --add-tracefile coverage.base --add-tracefile coverage.capture -o coverage.info &&
lcov --directory . -b "${BUILD_DIRECTORY}" --remove coverage.info '*/unit-tests/*' -o coverage.info &&
echo "Generated 'coverage.info'." &&
genhtml coverage.info -o coverage
rm -f coverage.base coverage.capture