code coverage - how to change the path of source file which was referred gcda? -
when build project coverage testing "--coverage -fprofile-arcs -ftest-coverage", , move build , source other user directory execute testing. many problems such "xxx/cc/cc/getopt_log.c:cannot open source file"
the details below: processing cs/cmakefiles/cfa/__/src/base/fault_injection.c.gcda /home/cov/build/xfcq/src/base/fault_injection.c:cannot open source file
the path of "/home/cov/build/xfcq/src/base/fault_injection.c" path of build environment, how change relative path or path specified.
i tried use gcov_prefix , gcov_prefix_strip, these can't work me.
i tried add -b option lcov, not work me. e.g., lcov --gcov-tool=/bin/gcov -d . -b xx/src -t "xfcq" -o test_cov.info
do have idea resolve it?
well using gcov coverage process should never move files after building project, instead should modify automated build scripts build desired location.
when compile project specified options generates *.gcno
files each source file flow chart details of relevant source file.
so, object files instrumented in such way should trigger function(added compiler generate coverage info ) whenever line of statement executed generate *.gcda
files execution information.
note: can see have specified 3 options in question (--coverage -fprofile-arcs -ftest-coverage) again wrong, --coverage
works replacement other two.
if specify --coverage
compilation , linking too.(remember use @ both places positively though)
Comments
Post a Comment