gcov: mount criu sources into a test mount tree

CRIU processes save *.gcda and *.gcno files near source files,
so when we restore tests into another mount namespace,
we need to have access to sources from this namespace.

Cc: Sergey Bronnikov <sergeyb@openvz.org>
Reported-by: Sergey Bronnikov <sergeyb@openvz.org>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Andrei Vagin 2016-03-05 00:37:00 +03:00 committed by Pavel Emelyanov
parent aa40501d95
commit 615465498f
3 changed files with 27 additions and 7 deletions

View file

@ -202,13 +202,8 @@ PHONY += cscope
gcov:
$(E) " GCOV"
$(Q) test -d gcov || mkdir gcov && \
cp criu/*.{gcno,c,h} test/`pwd`/criu/ && \
geninfo --output-filename gcov/crtools.h.info --no-recursion criu/ && \
geninfo --output-filename gcov/crtools.ns.info --no-recursion test/`pwd`/criu/ && \
sed -i "s#/test`pwd`##" gcov/crtools.ns.info && \
geninfo --output-filename gcov/criu.info --no-recursion criu/ && \
cd gcov && \
lcov --rc lcov_branch_coverage=1 --add-tracefile crtools.h.info \
--add-tracefile crtools.ns.info --output-file criu.info && \
genhtml --rc lcov_branch_coverage=1 --output-directory html criu.info
@echo "Code coverage report is in `pwd`/gcov/html/ directory."
PHONY += gcov