| OLD | NEW |
| 1 We include a snapshot of gmock from http://googlemock.googlecode.com/svn/trunk | 1 We include a snapshot of gmock from http://googlemock.googlecode.com/svn/trunk |
| 2 with chromium.patch applied. | 2 with chromium.patch applied. |
| 3 | 3 |
| 4 Current revision: 157 | 4 Current revision: 173 |
| 5 | 5 |
| 6 | 6 |
| 7 -- HOW TO USE -- | 7 -- HOW TO USE -- |
| 8 | 8 |
| 9 If you are unfamiliar with gmock, there is an example of how to write a test | 9 If you are unfamiliar with gmock, there is an example of how to write a test |
| 10 based on gmock in base/gmock_unittest.cc. To use gmock, just add a dependency | 10 based on gmock in base/gmock_unittest.cc. To use gmock, just add a dependency |
| 11 onto testing/gmock.gyp:gmock in your gyp target. | 11 onto testing/gmock.gyp:gmock in your gyp target. |
| 12 | 12 |
| 13 For more general informaiton, there is a lot of good documentation availble on | 13 For more general informaiton, there is a lot of good documentation availble on |
| 14 the googlemock website: | 14 the googlemock website: |
| 15 | 15 |
| 16 http://code.google.com/p/googlemock/ | 16 http://code.google.com/p/googlemock/ |
| 17 | 17 |
| 18 In particular, the "For Dummies" guide is a good place to start. The | 18 In particular, the "For Dummies" guide is a good place to start. The |
| 19 "CheatSheet" and "CookBook" are better as references. | 19 "CheatSheet" and "CookBook" are better as references. |
| 20 | 20 |
| 21 | 21 |
| 22 -- RECREATING PACKAGE -- | 22 -- RECREATING PACKAGE -- |
| 23 | 23 |
| 24 Gmock requires tr1 tuple. However, Visual Studio 2005 does not include | 24 Starting with r173, gmock began distributing a pared down version of tr1 tuple |
| 25 tr1 tuple, so a version of boost tuple was added into the third_party | 25 that can be used on compilers without TR1. This means that we will no longer |
| 26 tree for chromium. Our version of gmock has been patched to search for | 26 need TR1 or boost on windows. |
| 27 this version of tuple inside our source tree. | |
| 28 | 27 |
| 29 chromium.patch modifies gmock/include/gmock/internal/gmock-port.h so that | 28 Recreating this package is now just exporting the wanted revision. |
| 30 for _MSC_VER < 1500 (anything newer than Visual Studio 2008), boost tuple | 29 Example: |
| 31 is loaded from boost/tr1/tr1/tuple. | |
| 32 | 30 |
| 33 To recreate this install, do the following: | 31 svn export --ignore-externals \ |
| 32 http://googlemock.googlecode.com/svn/trunk/ gmock |
| 34 | 33 |
| 35 *1) Checkout a copy from svn trunk using --ignore-externals to avoid | 34 When checking out a copy from svn, --ignore-externals should be used to avoid |
| 36 getting an extra copy of gtest. Use the following command: | 35 getting an extra copy of gtest. |
| 37 svn export --ignore-externals \ | |
| 38 http://googlemock.googlecode.com/svn/trunk/ gmock | |
| 39 2) Patch it with chromium.patch. | |
| 40 | 36 |
| 41 * Pass -r [revision number] to svn export if you want a specific revision. | 37 This command will grab the head of trunk. Optionally, -r [revision number] to |
| 42 The current revision of the source is listed at the top of the README. | 38 can be passed to svn export if you want a specific revision. The current |
| 43 | 39 revision of the source is listed at the top of the README. |
| 44 | |
| 45 -- ALTERNATIVES TO PATCHING -- | |
| 46 | |
| 47 The patching of gmock to use boost in VS2005 was settled upon as the lowest | |
| 48 impact solution for getting gmock working in VS2005. Patching gmock trades | |
| 49 making some assumptions regarding the internal implementations of gmock | |
| 50 and boost for a simple, easy to underatnd, implementation that provides | |
| 51 relatively good insulation for the rest of the build from the boost dependency. | |
| 52 | |
| 53 Alternate soltuions are: | |
| 54 1) Drop support for VS2005 -- too heavy-handed. | |
| 55 2) Add a "tuple" file parallel to gmock-port.h -- still makes assumptions | |
| 56 about boost's structure. | |
| 57 3) Add boost/tr1/tr1 into the include path -- dirties the include path for | |
| 58 all dependencies. | |
| OLD | NEW |