How can we get UT coverage in windows environment

600 views
Skip to first unread message

yongchao hong

unread,
Sep 21, 2011, 2:05:57 AM9/21/11
to cpputest
we use CPPUTest to test our source code in windows environment, we can
get the UT result and let test cases passed,but we can not get the UT
coverage report. we use Microsoft Visual Studio 2005 as compile and
build environment.
Hope Bas Vodde can help us, you and James are the expert of CPPUTest.
Thanks in advance.

Bas Vodde

unread,
Sep 21, 2011, 5:37:17 AM9/21/11
to cppu...@googlegroups.com

Hiya!

Uhm, well usually a test coverage tool is a separate tool than a unit test framework.

I don't use VC++ very much, but for gcc getting the test coverage requires to add a couple of additional compiler flags and then you use the gcov tool to get the result. I guess there are also ways for getting test coverage in VC++...

Anyone used this VC++ version for test coverage?

Thanks!

Bas

洪永潮

unread,
Sep 21, 2011, 7:41:33 AM9/21/11
to cppu...@googlegroups.com
Hi,

Thank you for your quick reply.
In the Unix we can get the UT code coverage by make gcov, and generate
the XML report
Can we use cygwin in windows to get the UT code coverage use make gcov?

Thank you very much.
BR
Hong Yongchao

2011/9/21 Bas Vodde <ba...@odd-e.com>:

Terry Yin

unread,
Sep 21, 2011, 9:03:06 AM9/21/11
to cppu...@googlegroups.com
Hi,

Sure you can use cygwin in windows to get the code coverage.

But,
you can only get code coverage after running the UT, which means you need to be able to compile, link and run UT in cygwin with gcc. And when you can do everything with cygwin, there's no point to use VC any more:-)

But,
compiling using gcc in cygwin is so slow, is about 10 times slower then VC, I guess. A Linux virtual machine running on windows can also be 10 times faster than cygwin.

I'm not familiar with VC2005 either, I think it will be much easier if you find a test coverage tool in it's own tool family.

br, Terry
--
-terry
-------------------------
Blog: http://terryyin.blogbus.com/
twitter: http://twitter.com/terryyin

James Grenning

unread,
Sep 21, 2011, 10:33:57 AM9/21/11
to cppu...@googlegroups.com
I don't use VC++ much either. There are msdn articles about it.

http://msdn.microsoft.com/en-us/library/ms182496(v=vs.80).aspx

thanks, James

--------------------------------------------------------------------------------------------
James Grenning Author of TDD for Embedded C
www.renaissancesoftware.net http://pragprog.com/titles/jgade/
www.renaissancesoftware.net/blog
www.twitter.com/jwgrenning

yongchao hong

unread,
Sep 21, 2011, 10:47:41 PM9/21/11
to cpputest
Thank you very much.
I am reading it now, hope it can be helpful.\Br
BR
Hong Yongchao

On 9月21日, 下午10时33分, James Grenning <ja...@grenning.net> wrote:
> I don't use VC++ much either. There are msdn articles about it.
>
> http://msdn.microsoft.com/en-us/library/ms182496(v=vs.80).aspx
>
> thanks, James
>
> ---------------------------------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages