ANN: TestGen 0.05 C/C++ Test Generator Released
dan.gass at gmail.com
Mon Nov 29 09:06:02 CET 2004
TestGen 0.05 is now available and contains significant enhancements.
1) added manipc.py, a generic C/C++ source manipulator that can be used for
function/method isolation and stubbing for the purposes of unit testing
with any test framework, including CppUnit.
2) although not new (but neglected in first anouncement) this package also
includes doxit.py which is used to automatically insert Doxygen comment
templates into source code.
1) C/C++ stubber has index checks to prevent storage array overflows
2) added a lot of comments to the example test scripts.
3) moved all example source files into examples/source subdirectory and moved
defaultConfig.py to the examples subdirectory.
1) corrected undefined name problem in C/C++ source manipulator
2) unit test stubber didn't recognize #include of .hpp files (or any include
where extension is greater than one character.
3) python unit test target - fixed so syntax error doesn't occur when no test
TestGen is a Python package for software testing. The package currently
contains targets for unit testing C/C++. Future releases will support
integration testing of C/C++ systems as well as functional testing using
- requires Python2.2 or later (it was developed on Python2.3 with some
testing/verification performed with 2.2)
- Python API for specification of test case setup, inputs and outputs
(Python's power and flexibility can be used to generate test cases)
- generates "C/C++" test code per test specifications, compiles, links,
runs, and evaluates the results
- provides access to C++ protected and private variables and methods
- function/method stubbing (for satisfying external linkages or testing
interfaces to them)
- function/method remove/copy (for isolating code under test
to reduce external linkage requirements)
- "on the fly" code under test manipulation capability (useful for
making temporary code modifications to make it testable)
- convenient "C" random number function library (useful when iterating
the test to get better coverage)
- easy file output comparison and base lining
- test expectations independently verified for successful completion.
- batch facility available for running multiple test scripts (batch
tests may be nested in that they may execute other batch tests)
- GNU and Microsoft compilers supported (customizable for others)
TestGen also includes "by products" that fall outside the main purpose
of TestGen but are related or depend on TestGen (IOW, great tools
that I don't want to create independent projects for yet):
- manipc.py -- source code manipulator for isolating/stubbing
functions and methods for test purposes. This can be used with any
test framework including CppUnit.
- doxit.py -- inserts Doxygen comment templates into source code for
the file header as well as structures, enums, classes, functions,
methods, and defines. Does not insert templates where templates
already exist. Prepopulates certain fields such as function name,
parameters, and return type in the template automatically.
- config.py -- flexible configuration file reader (a less up to date
version is also available at http://sourceforge.net/projects/config-py/.
- HtmlDiff -- class that creates an HTML table showing a side by side
comparison of two versions of a text (is being included in Python2.4).
The vast majority of TestGen is released under the GNU General Public
License with the small remainder released under the MIT License. All
modules should be clearly marked, if not please let me know.
Downloads are available at the following address under the "Files" link:
Feedback and comments (both positive and negative) are very welcome.
Besides allowing me to improve this package, it also lets me know how
worth while my time is spent making updates to this package publically
available. Email addresses will be respected of course.
Documentation is always a challenge to keep accurate and complete. If
you struggle with any part of it, let me know. Better yet if you can
contribute, even something as small as a clarification, that would be
You may contact the author at dan.gass at gmail.com.
More information about the Python-announce-list