C++ Complementary Library
This class template represents a test module. A test module is an object containing functions that exercise, or test some piece of code, most commonly a class.
The general approach to testing adopted in CCL is to subclass test_module and implement one member function per unit test, construct this test_module subclass with an initializer list of function pointers referencing each member function containing a unit test, and then call the run_tests function to run all the tests. The return value of run_tests is then returned by the main function of the test program. The return value is the number of unit tests that failed, which is zero when all tests succeed.
The inner test module type, that is, the test_module subclass.
Gives a name to the signature of a test function so that corresponding function pointers can be written more clearly.
Constructs a test module aware of the provided test functions.
The pointers to the test functions that this test_module will run when run_tests is called.
Copy-constructs a test_module from an existing one.
The test_module to copy from.
Copy-assigns a test_module into this one.
The test_module to copy from.
Move-constructs a test_module from an existing one.
The test_module to move from.
Move-assigns a test_module into this one.
The test_module to move from.
Returns the number of messages in the message queue.
Runs all registered tests in this test module and returns the number of tests that failed.
Announces the test that is just starting
The name of the test that is just starting.
Ends the current stage and counts it as successful.
Pushes a message onto the message queue.
The message to push onto the message queue.
Pops a message from the message queue and returns it. If the message queue was empty, an empty message is returned.
Removes all messages in the message queue.
Returns an output stream that can be used to log informational messages.
Returns an output stream that can be used to log error messages.
Copyright © 2022-2025 Daniel T. McGinnis