diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-28 06:02:56 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-28 06:02:56 +0000 |
commit | 5290aaa39b51aa27d3f64fba3bc5fff6a08e3a26 (patch) | |
tree | 3d8b2b8c80612b8c4f5666ab9bb4fb0f4440cb02 /testing/README.chromium | |
parent | 6718396a176de7efdab274a06df93dcd03d84088 (diff) | |
download | chromium_src-5290aaa39b51aa27d3f64fba3bc5fff6a08e3a26.zip chromium_src-5290aaa39b51aa27d3f64fba3bc5fff6a08e3a26.tar.gz chromium_src-5290aaa39b51aa27d3f64fba3bc5fff6a08e3a26.tar.bz2 |
Retry to checkin a version of gmock, modified to use our boost_tuple in VS2005.
This checkin adds gmock, and a small example of how to write a gmock-based unittest.
Original Review URL: http://codereview.chromium.org/113807
Review URL: http://codereview.chromium.org/115846
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17066 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing/README.chromium')
-rw-r--r-- | testing/README.chromium | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/testing/README.chromium b/testing/README.chromium new file mode 100644 index 0000000..67e6451 --- /dev/null +++ b/testing/README.chromium @@ -0,0 +1,58 @@ +We include a snapshot of gmock from http://googlemock.googlecode.com/svn/trunk +with chromium.patch applied. + +Current revision: 157 + + +-- HOW TO USE -- + +If you are unfamiliar with gmock, there is an example of how to write a test +based on gmock in base/gmock_unittest.cc. To use gmock, just add a dependency +onto testing/gmock.gyp:gmock in your gyp target. + +For more general informaiton, there is a lot of good documentation availble on +the googlemock website: + + http://code.google.com/p/googlemock/ + +In particular, the "For Dummies" guide is a good place to start. The +"CheatSheet" and "CookBook" are better as references. + + +-- RECREATING PACKAGE -- + +Gmock requires tr1 tuple. However, Visual Studio 2005 does not include +tr1 tuple, so a version of boost tuple was added into the third_party +tree for chromium. Our version of gmock has been patched to search for +this version of tuple inside our source tree. + +chromium.patch modifies gmock/include/gmock/internal/gmock-port.h so that +for _MSC_VER < 1500 (anything newer than Visual Studio 2008), boost tuple +is loaded from boost/tr1/tr1/tuple. + +To recreate this install, do the following: + + *1) Checkout a copy from svn trunk using --ignore-externals to avoid + getting an extra copy of gtest. Use the following command: + svn export --ignore-externals \ + http://googlemock.googlecode.com/svn/trunk/ gmock + 2) Patch it with chromium.patch. + +* Pass -r [revision number] to svn export if you want a specific revision. +The current revision of the source is listed at the top of the README. + + +-- ALTERNATIVES TO PATCHING -- + +The patching of gmock to use boost in VS2005 was settled upon as the lowest +impact solution for getting gmock working in VS2005. Patching gmock trades +making some assumptions regarding the internal implementations of gmock +and boost for a simple, easy to underatnd, implementation that provides +relatively good insulation for the rest of the build from the boost dependency. + +Alternate soltuions are: + 1) Drop support for VS2005 -- too heavy-handed. + 2) Add a "tuple" file parallel to gmock-port.h -- still makes assumptions + about boost's structure. + 3) Add boost/tr1/tr1 into the include path -- dirties the include path for + all dependencies. |