summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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