tag:blogger.com,1999:blog-5549969176545377403.post923247096748034817..comments2010-06-06T23:01:15.373-07:00Comments on Musings on C++ Testing Tools: Readable Test Code and Readable Test Output - Get Both Using MatchersZhanyong Wanhttp://www.blogger.com/profile/15394645596185604184noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-5549969176545377403.post-19335813294973383582009-04-16T12:04:00.000-07:002009-04-16T12:04:00.000-07:00Thanks Wan for give me useful information.
I'll t...Thanks Wan for give me useful information.<br /><br />I'll try to extract and tweak.abuhttps://www.blogger.com/profile/09165899880791114743noreply@blogger.comtag:blogger.com,1999:blog-5549969176545377403.post-9000531569614498542009-04-16T11:50:00.000-07:002009-04-16T11:50:00.000-07:00Abu, thanks for clarifying. I agree it's desirabl...Abu, thanks for clarifying. I agree it's desirable to move EXPECT_THAT to gtest, but it will take time. Meanwhile, perhaps you can extract EXPECT_THAT and the matcher library from gmock and use it in your project. This part doesn't depend on boost and may be compilable with minor tweaks in your environment. Just a thought.<br /><br />BTW, gmock requires VC 8.0 SP1, not VC 8.1. It only needs boost where tr1/tuple is not available. Recent versions of gcc have tr1/tuple, so gmock doesn't require boost if used with gcc 4.0+.Zhanyong Wanhttps://www.blogger.com/profile/15394645596185604184noreply@blogger.comtag:blogger.com,1999:blog-5549969176545377403.post-59422447745427005772009-04-16T11:42:00.000-07:002009-04-16T11:42:00.000-07:00Hi,
gmock requires VC8.1+boost, and that is too ...Hi, <br /><br />gmock requires VC8.1+boost, and that is too higher requirement just for me as I maintain some old windows projects which written in VC6/7.<br /><br />(Maybe I should migrate to new compilers , but migration of test-less project is risky..)abuhttps://www.blogger.com/profile/09165899880791114743noreply@blogger.comtag:blogger.com,1999:blog-5549969176545377403.post-4760691595304035732009-04-16T11:23:00.000-07:002009-04-16T11:23:00.000-07:00Abu, you are welcome.
I agree it would be nice to...Abu, you are welcome.<br /><br />I agree it would be nice to move EXPECT_THAT and matchers to gtest. It's just a lot of refactoring work, and we don't have time for that soon.<br /><br />I wonder what's preventing you from using gmock. It gives you EXPECT_THAT and more. Even if you only want to use EXPECT_THAT and nothing else, there's nothing wrong with using gmock. And it's easy to set up. Does gmock not compile in your environment?Zhanyong Wanhttps://www.blogger.com/profile/15394645596185604184noreply@blogger.comtag:blogger.com,1999:blog-5549969176545377403.post-76288229583865251332009-04-16T11:18:00.000-07:002009-04-16T11:18:00.000-07:00Hi Wan,
Sorry, I meant to say about EXPECT_THAT as...Hi Wan,<br />Sorry, I meant to say about EXPECT_THAT as you guess.<br /><br />I think it will nice to gtest have EXPECT_THAT because it seems allow <br />me to write tests more BDD like style.<br /><br />Maybe EXPECT_PRED in gtest provide same functionality, but <br />I prefer to actual to come first and then expected result like EXPECT_THAT.<br /><br />Thanks,abuhttps://www.blogger.com/profile/09165899880791114743noreply@blogger.comtag:blogger.com,1999:blog-5549969176545377403.post-88201408626396019342009-04-15T15:16:00.000-07:002009-04-15T15:16:00.000-07:00Abu, EXPECT_TRUE *is* in gtest.
Perhaps you mean ...Abu, EXPECT_TRUE *is* in gtest.<br /><br />Perhaps you mean why EXPECT_THAT is in gmock instead of gtest. The reason is historical. The matcher library was initially developed as part of gmock, as a reasonable mocking framework cannot do without matchers. EXPECT_THAT depends on matchers and thus ended up in gmock.Zhanyong Wanhttps://www.blogger.com/profile/15394645596185604184noreply@blogger.comtag:blogger.com,1999:blog-5549969176545377403.post-49049256721682196312009-04-15T10:20:00.000-07:002009-04-15T10:20:00.000-07:00I wonder why EXPECT_TRUE is in gmock but not gtest...I wonder why EXPECT_TRUE is in gmock but not gtest?abuhttps://www.blogger.com/profile/09165899880791114743noreply@blogger.comtag:blogger.com,1999:blog-5549969176545377403.post-54856438170841863322009-04-10T21:04:00.000-07:002009-04-10T21:04:00.000-07:00Nice! I strongly agree that "readability is even m...Nice! I strongly agree that "readability is even more important for test code, as you have to be able to trust it "<BR/>I have heard about Google Mock only a few days ago, but it attracts me.CoderZhhttps://www.blogger.com/profile/13384123038823194512noreply@blogger.com