summaryrefslogtreecommitdiff
path: root/bashrc
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2021-08-27 11:11:31 +0100
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2021-08-27 11:11:31 +0100
commit0a3d61f3f1a7f27dba4de257400e57ba9a6c2dba (patch)
tree1a407b0daafa53d761db975bc2c8b0c3a2ea26c8 /bashrc
parentUse EDITOR in diffWith (diff)
downloadutil-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
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc9
1 files changed, 7 insertions, 2 deletions
diff --git a/bashrc b/bashrc
index 08a0e51..58a0c96 100644
--- a/bashrc
+++ b/bashrc
@@ -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