Skip to content
Matthew Taylor edited this page Jan 7, 2014 · 1 revision

The C++ unit tests are in the same location as the class that is being tested, in a subdirectory called unittests. To write unit tests for a class, create a subclass of Tester in the appropriate unittests directory. The name should end with Test. (For example, tests for the class Foo should be in FooTest.cpp and FooTest.hpp). Then implement the virtual method RunTests. When you do a build, these tests will be automatically included in the testeverything executable.

Please see nta/os/unittests/TimerTest as an example. There are various macros available for checking the result values. They are located in Tester.hpp.

Clone this wiki locally