Skip to content

Commit

Permalink
disable make cover as no gcov was found
Browse files Browse the repository at this point in the history
  • Loading branch information
Vollstrecker committed Dec 25, 2024
1 parent 967358e commit dc34211
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@ infcover: infcover.o libz.a
$(CC) $(CFLAGS) -coverage -o $@ infcover.o libz.a

cover: infcover
ifdef $(GCOV)
rm -f *.gcda
${QEMU_RUN} ./infcover
${GCOV} ${LLVM_GCOV_FLAG} inf*.c -o ./infcover.gcda
else
@echo 'cover disabled as no suitable gcov was found'
endif

libz.a: $(OBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)
Expand Down
14 changes: 8 additions & 6 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -200,25 +200,27 @@ esac

if test "$clang" -eq 1; then
if test "$cc" = "clang"; then
if `llvm-cov --version > /dev/null`; then
GCOV="llvm-cov-${clangV}"
if which -s llvm-cov; then
GCOV="llvm-cov"
LLVM_GCOV_FLAG="gcov"
GCOV="llvm-cov"
LLVM_GCOV_FLAG="gcov"
echo "Using ${GCOV} for coverage"
else
cover=0
GCOV=""
LLVM_GCOV_FLAG=""
echo "Deactivating cover as no suitable gcov can be found"
fi
GCOV="llvm-cov"
LLVM_GCOV_FLAG="gcov"
echo "Using ${GCOV} for coverage"
else
clangV=`echo "$cc" | sed -e 's/^.*-//'`
if `llvm-cov-${clangV} --version > /dev/null`; then
if which -s llvm-cov-${clangV}; then
GCOV="llvm-cov-${clangV}"
LLVM_GCOV_FLAG="gcov"
echo "Using ${GCOV} for coverage"
else
cover=0
GCOV=""
LLVM_GCOV_FLAG=""
echo "Deactivating cover as no suitable gcov can be found"
fi
Expand Down

0 comments on commit dc34211

Please sign in to comment.