Helo, I'm new in embedded systems so unit testing too, let me apologyze if I say something wrong, first of all.
I'm trying to generate a coverage report with some test group that has passed the test and this console message has the only output I have. I would like to have the html view explained at cpputest oficial page. Concretely at "how to create a coverage report" page step. Since I have cpputest installed with apt-get install I can not follow the step:
$ cd cpputest_build
$ autoreconf .. -i
$ ../configure
$ make
$ make check_coverage
(Even this I have not much clear what kind of coverage can do this instruction if no test project directory has refered here). Here, They also say:
"This will generate a file called gcov_report.txt with the coverage report in plain text format." But I don't know of what test you will get your test coverage doing this by this way.
Anyways, a part of this, I try to enable test coverage in my make file but the only thing I get is a hmtl report with 0,0% coverage.
I would like to know some suggestions of the ways that other experienced people gets its test coverage runing correctly.
I will show you the main lines of my make file refered to coverage (I'm testing C code for embedded sw):
# gcc complier parameters (code coverage enabled)
CFLAGS= -g -Wall -fprofile-arcs -ftest-coverage
...
# g++ compiler parameters (code coverage enabled)
CPPFLAGS= -g -Wall -Wno-c++14-compat -fprofile-arcs -ftest-coverage
...
LDFLAGS= -L$(CPPUTEST_HOME)/cpputest_build/lib -lCppUTest -lgcov --coverage -lCppUTestExt
... (Here more lines about creating the o. and .c objects for my test.c and the last lines before output report):
##############################################################################
# Execute test and code coverage module
##############################################################################
test_exe:
@echo -e "\e[1;34m"
@echo -e "\r"
@echo -e "********************************************************\r"
@echo -e "* Executing tests... \r"
@echo -e "********************************************************\r"
./test_RFID_Drv.exe -c
@echo -e "\e[1;36m"
@echo -e "\r"
@echo -e "********************************************************\r"
@echo -e "* Code coverage results... \r"
@echo -e "********************************************************\r"
gcov -n ./test_RFID_Drv.c
@echo -e "\r"
gcov -n ./RFID_Drv.c
@echo -e "\r"
Any suggestion will be usefull.
Thanks in advance.