maxon::UnitTestInterface provides an unified interface for any kind of unit test. Such an unit test should verify the correct functionality of every component of a program. Unit tests implemented this way are automatically executed when Cinema 4D starts and unit tests are enabled.
Custom unit test are created by implementing a custom class based on maxon::UnitTestComponent. This custom class must implement maxon::UnitTestInterface::Run() which contains the unit test code.
The result of a test can be printed to the console using a standard format:
A (long running) unit test may be cancelled from the outside:
The result of this unit test will be printed to the console:
Different kinds of unit tests can be registered at these registries:
maxon::UnitTestClasses:
Basic unit tests. This kind of test should pass within seconds. Started with the command line argument "g_runUnitTests".maxon::SpeedTestClasses:
Speed tests. This kind of test should pass within seconds. Started with the command line argument "g_runSpeedTests".maxon::LongRunTestClasses:
Long run tests. Started with the command line argument "g_runLongRunTests".To run all unit tests set the command line argument to "*" like g_runUnitTests=*
. To run a specific test one can define a filter like g_runUnitTests=*simplemaths*
.