lindelof
unread,Nov 11, 2011, 2:45:37 PM11/11/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cpputest
I have a project with only C files in it. When I run
make gcov
This is what I get in gcov_output.txt:
File 'optimize.c'
No executable lines
optimize.c:creating 'optimize.c.gcov'
and so on for each source file.
Eventually I found out that it's due to the following line in
Makefileworker.mk:
gcov --object-directory $(CPPUTEST_OBJS_DIR)/$$d $$d/*.c $$d/*.cpp
>> $(GCOV_OUTPUT) 2>>$(GCOV_ERROR) ; \
This line is passed to the shell, and if there are no CPP files then
gcov is given the literal './*.cpp' as the last sourcefile. And that
prevents it from working properly.
My workaround is to split this line in two:
gcov --object-directory $(CPPUTEST_OBJS_DIR)/$$d $$d/*.c >> $
(GCOV_OUTPUT) 2>>$(GCOV_ERROR) ; \
gcov --object-directory $(CPPUTEST_OBJS_DIR)/$$d $$d/*.cpp >> $
(GCOV_OUTPUT) 2>>$(GCOV_ERROR) ; \
It still yields errors on the second line but at least the C files are
processed right. I cannot use constructs such as $$d/*.{c,cpp} because
that line is passed to the default shell, which is /bin/sh and which
does not recognize that kind of expansion. (It's a bash construct.)
Hope someone finds this useful,
David