我试图理解/使用预定义的Makefile(来自CppUTest,MakefileWorker.mk)。
在第515行附近有一个gcov
命令可用。但是,当我使用make gcov
gcov(一次)使用可能无效的参数调用时,因为它(一次)打印它的用法:
D:\devel\ctest>make gcov
Running ctest_tests
..............................................
OK (46 tests, 46 ran, 407 checks, 0 ignored, 0 filtered out, 0 ms)
./../cpputest/scripts/filterGcov.sh gcov_output.txt gcov_error.txt gcov_report.txt ctest_tests.txt
0.00%
0.00% -a, --all-blocks Show information for every basic block
0.00% -b, --branch-probabilities Include branch probabilities in output
0.00% -c, --branch-counts Output counts of branches taken
0.00% -d, --display-progress Display progress information
0.00% -f, --function-summaries Output summaries for each function
0.00% -h, --help Print this help, then exit
0.00% -i, --intermediate-format Output .gcov file in intermediate text format
0.00% -l, --long-file-names Use long output file names for included
0.00% -m, --demangled-names Output demangled function names
0.00% -n, --no-output Do not create an output file
0.00% -o, --object-directory DIR|FILE Search for object files in DIR or called FILE
0.00% -p, --preserve-paths Preserve all pathname components
0.00% -r, --relative-only Only show data for relative sources
0.00% -s, --source-prefix DIR Source prefix to elide
0.00% -u, --unconditional-branches Show unconditional branch counts too
0.00% -v, --version Print version number, then exit
0.00% <http://sourceforge.net/projects/mingw-w64>.
0.00% For bug reporting instructions, please see:
0.00% Print code coverage information.
0.00% rather than percentages
0.00% source files
0.00% Usage: gcov [OPTION]... SOURCE|OBJ...
96.97% src/HomeAutomation/LightScheduler.c
100.00% src/HomeAutomation/RandomMinute.c
File src/HAL/UART/hal_uart_baudrate.c Lines executed:97.22% of 72
See gcov directory for details
D:\devel\ctest>
但我几乎不熟练解开Makefiles / bash脚本,并且不知道哪里可能出错。 至于使用的设置:
CPPUTEST_USE_VPATH = N
SRC_DIRS = \
src/util\
src/HomeAutomation\
src/HAL/UART
SRC_FILES is empty
在gcov --object-directory etc
调用时出现“错误”,但这就是我所知道的。