Boost multi file test module




















The default initialization function provided by the framework is defined with the following signature in the global namespace:.

Return value true indicates a successful initialization. Value false indicates initialization failure. The test case This is an independently monitored function within a test module that consists of one or more test assertions. The term "independently monitored" in the definition above is used to emphasize the fact, that all test cases are monitored independently. An uncaught exception or other normal test case execution termination doesn't cause the testing to cease.

Instead the error is caught by the test case execution monitor, reported by the UTF and testing proceeds to the next test case. Later on you are going to see that this is on of the primary reasons to prefer multiple small test cases to a single big test function. The test suite This is a container for one or more test cases. There are various reasons why you may opt to do so, including: To group test cases per subsystems of the unit being tested.

To run selected group of test cases only. To see test report split by groups of test cases To skip groups of test cases based on the result of another test unit in a test tree.

Entry point to a test module. This is usually either the function main itself or single function that can be invoked from it to start testing. Initialize the UTF based on runtime parameters Select an output media for the test log and the test results report Select test cases to execute based on runtime parameters Execute all or selected test cases Produce the test results report Generate a test module result code.

This is a single binary that performs the test. The test body. This is the part of a test module that actually performs the test. The test tree. As you can see test tree construction in this example is more straightforward and automated. Their definition is remote and is separated by another test case. In fact these parts may even reside in different test files.

The resulting test tree remains the same. For complete class interface reference check advanced section of this documentation.

Here you should only be interested in a single test unit registration interface:. The first parameter is a pointer to a newly created test unit. By default no errors are expected. Be careful when supplying a number of expected failures for test suites. By default the Unit Test Framework calculates the number of expected failures in test suite as the sum of appropriate values in all test units that constitute it. There is practically no need to ever alter the default behavior of the test module's initialization function.

The Unit Test Framework provides superior tools for performing customization tasks:. The default initialization function provided by the framework is defined with the following signature in the global namespace:.



0コメント

  • 1000 / 1000