Unit Test Framework

Last Update: 11/21/2002

Currently the Helix codebase has a relatively simple unit test framework. All unit tests derive from the HLXUnitTest class. This allows a common interface for all unit tests and allows one to easily generate unit test drivers for different platforms.

One common type of unit test used in the Helix codebase is one that reads a set of commands from a test case file. The use of a test case script allows test cases to be easily added without having to change the unit test code. To ease implementing this type of unit test the HLXCommandDispatchTest class was created. It takes care of all the details of reading the file and sending the commands to the unit test. All the unit test writer has to do is implement the handler functions for the various commands. This is done creating a class that implements the HLXCmdBasedTest interface.

The code for the unit test framework can be found in common/unittest. To see examples of how the unit test framework is used, look in common/container/test and common/system/test. Unit tests for code located in a particular directory, should be located in a subdirectory called "test".