Hi
I am using CppUnit framework in my C++ project for unit testing. I want to use code covarage tool to chek the code covarage of my project.
Is CppUnit provide any code coverage tool ? If not then please suggest any other tool whch can provide 100% code covarage.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Any hints on how to get gcov to work. I have it compiling and linking, but not creating any output files. CppUTest is running fine. Running in OSX. Added following lines to my make file:
I know you said it was compiling and linking, but the only suggestion I
have is that the concatenation of the flags, using +=, is not valid in
a makefile on any *nix type of system.
I suspect you've already tried changing those to the more traditional:
After some help and a lot of Googling
Either set of compile flags and the one linker flag do the trick. If I can determine a difference I'll post something.
CPPUTEST_CPPFLAGS += -g -O0 --coverage
CPPUTEST_CPPFLAGS += -fprofile-arcs
CPPUTEST_CPPFLAGS += -ftest-coverage
CPPUTEST_LDFLAGS += -lprofile_rt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wanna use it for my new project here but the main issue for me is how to run this software on my project please help me by sharing its complete process you can see my blog here for further details.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I am using CppUnit framework in my C++ project for unit testing. I want to use code covarage tool to chek the code covarage of my project.
Is CppUnit provide any code coverage tool ? If not then please suggest any other tool whch can provide 100% code covarage.
CppUnit does not provide any code coverage analysis, but you can run it in combination with gcov.
Any hints on how to get gcov to work. I have it compiling and linking, but not creating any output files. CppUTest is running fine. Running in OSX. Added following lines to my make file:
CPP_PLATFORM = Gcc
CPPUTEST_CPPFLAGS += -DSUPPRESS_PRINTING
CPPUTEST_CPPFLAGS += -fprofile-arcs
CPPUTEST_CPPFLAGS += -ftest-coverage
CPPUTEST_LDFLAGS += -lssl
CPPUTEST_LDFLAGS += -lcrypto
CPPUTEST_LDFLAGS += -fprofile-arcs
I found this in one of the sample files, but still no luck.
GCOVFLAGS = -fprofile-arcs -ftest-coverage
Thanks, Mike
Hi Mike,
I know you said it was compiling and linking, but the only suggestion I
have is that the concatenation of the flags, using +=, is not valid in
a makefile on any *nix type of system.
I suspect you've already tried changing those to the more traditional:
CPPUTEST_CPPFLAGS = -DSUPPRESS_PRINTING
CPPUTEST_CPPFLAGS = -fprofile-arcs:$(CPPUTEST_CPPFLAGS)
CPPUTEST_CPPFLAGS = -ftest-coverage:$(CPPUTEST_CPPFLAGS)
CPPUTEST_LDFLAGS = -lssl
CPPUTEST_LDFLAGS = -lcrypto:$(CPPUTEST_LDFLAGS)
CPPUTEST_LDFLAGS = -fprofile-arcs:$(CPPUTEST_LDFLAGS)
That's the one thing that stands out to me.
Hope that helps,
John
On Fri 12 Jul 2013 04:39:55 AM PDT, Mike Finch wrote:
Thanks John. That also compiled and ran my test, but did not generate any .gcda, .gcno or *.gcov files.
After some help and a lot of Googling
Either set of compile flags and the one linker flag do the trick. If I can determine a difference I'll post something.
CPPUTEST_CPPFLAGS += -g -O0 --coverage
CPPUTEST_CPPFLAGS += -fprofile-arcs
CPPUTEST_CPPFLAGS += -ftest-coverage
CPPUTEST_LDFLAGS += -lprofile_rt
can anyone explain me the proper steps to run gcov with CppUTest in unix project
I wanna use it for my new project here but the main issue for me is how to run this software on my project please help me by sharing its complete process you can see my blog here for further details.