diff options
author | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2021-08-27 11:11:31 +0100 |
---|---|---|
committer | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2021-08-27 11:11:31 +0100 |
commit | 0a3d61f3f1a7f27dba4de257400e57ba9a6c2dba (patch) | |
tree | 1a407b0daafa53d761db975bc2c8b0c3a2ea26c8 | |
parent | Use EDITOR in diffWith (diff) | |
download | util-0a3d61f3f1a7f27dba4de257400e57ba9a6c2dba.tar.bz2 util-0a3d61f3f1a7f27dba4de257400e57ba9a6c2dba.tar.xz util-0a3d61f3f1a7f27dba4de257400e57ba9a6c2dba.zip |
Derive a gcov for the same series as GCC, doesn't have to be an exact match
-rw-r--r-- | bashrc | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -41,8 +41,13 @@ cov() { local key=$cov/key local html=$cov/html local htmlfin=bin/cov - local gcov=$(which $(build $@ -qand1 variant=coverage | grep -w compile | \ - sed -n "s/.*\/gcc-\([0-9]\+\.[0-9]\+\.[0-9]\+\)\/.*/gcov-\1/p" | head -n1)) + local gcov=$(build $@ -qand1 variant=coverage | grep -w compile | \ + sed -n "s/.*\/gcc-\([0-9.]\+\)\/.*/gcov-\1/p" | head -n1) + if [[ -z $gcov ]] ; then + echo "Couldn't figure a gcov version" + return 1 + fi + gcov=$(find ${PATH//:/ } -name "$gcov*" 2> /dev/null | sort -Vr | head -n1) if [[ ! -x $gcov ]] ; then echo "Couldn't find a suitable gcov" return 1 |