spack/share/spack/qa/bashcov
Massimiliano Culpo 10695f1ed3
Use kcov from official Ubuntu 20.04 repository (#25385)
* Ubuntu 20.04 provides kcov, so don't build from source

* Use two undocumented options for kcov v3.8
2021-08-19 14:03:10 -07:00

16 lines
508 B
Bash
Executable File

#!/bin/bash
#
# This script acts like bash but runs kcov on the input script. We use it
# to get coverage for Spack's bash scripts.
#
if [ -z "$SPACK_ROOT" ]; then
echo "ERROR: SPACK_ROOT was not set!"
exit 1
fi
# Using a -- to separate the script to be tested from kcov is not documented
# as of v38, but seems to work. The same is true for the "--debug-force-bash-stderr"
# option, see https://github.com/SimonKagstrom/kcov/issues/61
kcov --debug-force-bash-stderr "$SPACK_ROOT/coverage" -- "$@"