shiqian | e35fdd9 | 2008-12-10 05:08:54 +0000 | [diff] [blame] | 1 | |
| 2 | The Google Mock class generator is an application that is part of cppclean. |
Gennadiy Civil | 8977af0 | 2018-05-23 11:49:11 -0400 | [diff] [blame] | 3 | For more information about cppclean, visit http://code.google.com/p/cppclean/ |
shiqian | e35fdd9 | 2008-12-10 05:08:54 +0000 | [diff] [blame] | 4 | |
Gennadiy Civil | 8977af0 | 2018-05-23 11:49:11 -0400 | [diff] [blame] | 5 | The mock generator requires Python 2.3.5 or later. If you don't have Python |
| 6 | installed on your system, you will also need to install it. You can download |
| 7 | Python from: http://www.python.org/download/releases/ |
shiqian | e35fdd9 | 2008-12-10 05:08:54 +0000 | [diff] [blame] | 8 | |
| 9 | To use the Google Mock class generator, you need to call it |
| 10 | on the command line passing the header file and class for which you want |
| 11 | to generate a Google Mock class. |
| 12 | |
| 13 | Make sure to install the scripts somewhere in your path. Then you can |
| 14 | run the program. |
| 15 | |
zhanyong.wan | 84b8e4c | 2009-05-07 20:38:25 +0000 | [diff] [blame] | 16 | gmock_gen.py header-file.h [ClassName]... |
nnorwitz | ce60784 | 2009-05-06 05:57:09 +0000 | [diff] [blame] | 17 | |
| 18 | If no ClassNames are specified, all classes in the file are emitted. |
shiqian | e35fdd9 | 2008-12-10 05:08:54 +0000 | [diff] [blame] | 19 | |
| 20 | To change the indentation from the default of 2, set INDENT in |
| 21 | the environment. For example to use an indent of 4 spaces: |
| 22 | |
| 23 | INDENT=4 gmock_gen.py header-file.h ClassName |
| 24 | |
zhanyong.wan | b824316 | 2009-06-04 05:48:20 +0000 | [diff] [blame] | 25 | This version was made from SVN revision 281 in the cppclean repository. |
shiqian | e35fdd9 | 2008-12-10 05:08:54 +0000 | [diff] [blame] | 26 | |
| 27 | Known Limitations |
| 28 | ----------------- |
| 29 | Not all code will be generated properly. For example, when mocking templated |
| 30 | classes, the template information is lost. You will need to add the template |
| 31 | information manually. |
| 32 | |
| 33 | Not all permutations of using multiple pointers/references will be rendered |
| 34 | properly. These will also have to be fixed manually. |