1 #include <UnitTest++/UnitTest++.h>
3 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5 // To add a test, simply put the following code in the a .cpp file of your
8 // =================================
10 // =================================
16 // The TEST macro contains enough machinery to turn this slightly odd-looking
17 // syntax into legal C++, and automatically register the test in a global list.
18 // This test list forms the basis of what is executed by RunAllTests().
20 // If you want to re-use a set of test data for more than one test, or provide
21 // setup/teardown for tests,
22 // you can use the TEST_FIXTURE macro instead. The macro requires that you pass
23 // it a class name that it will instantiate, so any setup and teardown code
24 // should be in its constructor and destructor.
28 // SomeFixture() { /* some setup */ }
29 // ~SomeFixture() { /* some teardown */ }
34 // TEST_FIXTURE(SomeFixture, YourTestName)
36 // int temp = testData;
39 // =================================
41 // =================================
43 // Tests can be grouped into suites, using the SUITE macro. A suite serves as a
44 // namespace for test names, so that the same test name can be used in two
45 // difference contexts.
47 // SUITE(YourSuiteName)
53 // TEST(YourOtherTestName)
58 // This will place the tests into a C++ namespace called YourSuiteName, and make
59 // the suite name available to UnitTest++.
60 // RunAllTests() can be called for a specific suite name, so you can use this to
61 // build named groups of tests to be run together.
62 // Note how members of the fixture are used as if they are a part of the test,
63 // since the macro-generated test class derives from the provided fixture class.
66 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
69 int main(int argc
, char** argv
)
71 return UnitTest::RunAllTests();