Fix the gcov/lcov related issues

Summary:

Jenkin reports errors that:

* Linking error on some machines. The error message shows it cannot find some gcov related symbols.
* lcov error due to the version issues.

Test Plan:

run make in different platforms

Reviewers:

CC:

Task ID: #

Blame Rev:
This commit is contained in:
Kai Liu 2013-08-22 16:59:02 -07:00
parent c2bd8f4824
commit 4c6dc7a9ae
2 changed files with 10 additions and 3 deletions

View File

@ -122,7 +122,7 @@ release:
coverage: coverage:
$(MAKE) clean $(MAKE) clean
COVERAGEFLAGS="-fprofile-arcs -ftest-coverage" $(MAKE) all check COVERAGEFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS+="-lgcov" $(MAKE) all check
(cd coverage; ./coverage_test.sh) (cd coverage; ./coverage_test.sh)
# Delete intermediate files # Delete intermediate files
find . -type f -regex ".*\.\(\(gcda\)\|\(gcno\)\)" | xargs --no-run-if-empty rm find . -type f -regex ".*\.\(\(gcda\)\|\(gcno\)\)" | xargs --no-run-if-empty rm

View File

@ -55,12 +55,19 @@ then
exit 0 exit 0
fi fi
LCOV_VERSION=$(lcov -v | grep 1.1 || true)
if [ $LCOV_VERSION ]
then
echo "Not supported lcov version. Expect lcov 1.1."
exit 0
fi
(cd $ROOT; lcov --no-external \ (cd $ROOT; lcov --no-external \
--capture \ --capture \
--directory $PWD \ --directory $PWD \
--gcov-tool $GCOV \ --gcov-tool $GCOV \
--output-file $COVERAGE_DIR/coverage.info &>/dev/null) --output-file $COVERAGE_DIR/coverage.info)
genhtml $COVERAGE_DIR/coverage.info -o $COVERAGE_DIR &>/dev/null genhtml $COVERAGE_DIR/coverage.info -o $COVERAGE_DIR
echo "HTML Coverage report is generated in $COVERAGE_DIR" echo "HTML Coverage report is generated in $COVERAGE_DIR"