-
Notifications
You must be signed in to change notification settings - Fork 1
HowToUse
EbenZhang edited this page May 28, 2013
·
2 revisions
How To Use
You should including cppunitlite.h in every test cpp file.
And add "your cppunitlite dir" to your project's include dir
Tests must be attached to a TEST_GROUP(some test framework call it test fixture), Group's name is usually the same as the class that you want to test.
TEST_GROUP is actually implemented as a class, so do not forget the ';'
The formatter is TEST(!YourTestGroupName,!DescribeWhatYouWantToTest)
CHECK(someBOOLCondition)
if someBOOLCondition is 0, then CHECK will cause a failure.
Constructor of TestGroup in order to initialize reference (and other must be initialized types) in a class.
When using TEST_ONLY instead of TEST, the runner will ignore all other test cases.