Blame googlemock/scripts/generator/README
|
Packit |
bd1cd8 |
|
|
Packit |
bd1cd8 |
The Google Mock class generator is an application that is part of cppclean.
|
|
Packit |
bd1cd8 |
For more information about cppclean, see the README.cppclean file or
|
|
Packit |
bd1cd8 |
visit http://code.google.com/p/cppclean/
|
|
Packit |
bd1cd8 |
|
|
Packit |
bd1cd8 |
cppclean requires Python 2.3.5 or later. If you don't have Python installed
|
|
Packit |
bd1cd8 |
on your system, you will also need to install it. You can download Python
|
|
Packit |
bd1cd8 |
from: http://www.python.org/download/releases/
|
|
Packit |
bd1cd8 |
|
|
Packit |
bd1cd8 |
To use the Google Mock class generator, you need to call it
|
|
Packit |
bd1cd8 |
on the command line passing the header file and class for which you want
|
|
Packit |
bd1cd8 |
to generate a Google Mock class.
|
|
Packit |
bd1cd8 |
|
|
Packit |
bd1cd8 |
Make sure to install the scripts somewhere in your path. Then you can
|
|
Packit |
bd1cd8 |
run the program.
|
|
Packit |
bd1cd8 |
|
|
Packit |
bd1cd8 |
gmock_gen.py header-file.h [ClassName]...
|
|
Packit |
bd1cd8 |
|
|
Packit |
bd1cd8 |
If no ClassNames are specified, all classes in the file are emitted.
|
|
Packit |
bd1cd8 |
|
|
Packit |
bd1cd8 |
To change the indentation from the default of 2, set INDENT in
|
|
Packit |
bd1cd8 |
the environment. For example to use an indent of 4 spaces:
|
|
Packit |
bd1cd8 |
|
|
Packit |
bd1cd8 |
INDENT=4 gmock_gen.py header-file.h ClassName
|
|
Packit |
bd1cd8 |
|
|
Packit |
bd1cd8 |
This version was made from SVN revision 281 in the cppclean repository.
|
|
Packit |
bd1cd8 |
|
|
Packit |
bd1cd8 |
Known Limitations
|
|
Packit |
bd1cd8 |
-----------------
|
|
Packit |
bd1cd8 |
Not all code will be generated properly. For example, when mocking templated
|
|
Packit |
bd1cd8 |
classes, the template information is lost. You will need to add the template
|
|
Packit |
bd1cd8 |
information manually.
|
|
Packit |
bd1cd8 |
|
|
Packit |
bd1cd8 |
Not all permutations of using multiple pointers/references will be rendered
|
|
Packit |
bd1cd8 |
properly. These will also have to be fixed manually.
|