The test script is written as C++ code incorporating various Cantata++ directives. The test cases for stack are member functions of class TEST_CLASS(stack). Each individual test case has the same overall structure: first the test is named and an optional description added (using the START_TEST() directive).

START_EXCEPTION is used to initiate the catching of any exceptions thrown by the software under test. The data to test is then set up and the software under test is run using this data. The various outputs are checked and directives check for any exceptions thrown which may or may not have been expected. Finally the END_TEST() directive terminates each test case.

Function main runs the tests and logs the results to an output file (in this example test_stack.ctr).

Next: Compilation