0

I am trying to understand/use a pre-defined Makefile (from CppUTest, MakefileWorker.mk). Around line 515 there is a gcov command available. However, when I use make gcov gcov is (once) invoked with apparantly invalid parameters as it (once) prints its usage:

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>

But I am all but skilled in unravelling Makefiles/bash scripts and have no clue where things might go wrong. As for the settings used:

CPPUTEST_USE_VPATH = N
SRC_DIRS = \
    src/util\
    src/HomeAutomation\
    src/HAL/UART
SRC_FILES is empty

It is going "wrong" at the gcov --object-directory etc invocation, but that is all I know.

Daan Timmer
  • 14,771
  • 6
  • 34
  • 66
  • 2
    There are three calls to `gcov` in that target and a call to a script which seems like it might call `gcov` itself. Which call is failing? From the output (assuming buffering issues didn't cause an ordering problem) it would appear a call in the script is the problem. – Etan Reisner May 08 '15 at 14:29
  • oops, my bad. "It goes wrong" at line 521 (form the github link). – Daan Timmer May 08 '15 at 14:43
  • If you run `make gcov SILENCE=` do you see the commands that get run? – Etan Reisner May 08 '15 at 14:45
  • @EtanReisner I tried that, but sadly doesn't help – Daan Timmer May 08 '15 at 15:26
  • That doesn't show you the commands being run during the output? It should (unless something it expressly overriding the value of `SILENCE` which would be odd). You could try `SILENCE= make -e gcov` that might work. To be clear though all I'm expecting that to do is show you the `gcov`/etc. commands that make is running so we can better find out where exactly things are going wrong. – Etan Reisner May 08 '15 at 16:22
  • If that doesn't work you can also try `make gcov SHELL+=-x` (for make 3.81) or `make gcov SHELLFLAGS+=-x` (for make 4.X). – Etan Reisner May 08 '15 at 16:22

0 Answers0