Next: , Previous: , Up: Top   [Contents][Index]


4 Test groups

A test group is a set of tests that we consider related, or example: all the tests of a single C function applied to a single category of operands. We create and run test group as follows:

cctests_begin_group("spiffy tests");
{
  cctests_run(test_this);
  cctests_run(test_that);
}
cctests_end_group();

CCTests’s API allows us to select which groups to run in a test program using the environment variable cctests_group.

Function: void cctests_begin_group (char const * test_group_name)

Begin a group of tests; initialise the internal state. The argument is an ASCIIZ string representing the name of this group. Print a message on the log stream to report the operation.

The test group name is used as follows:

Function: void cctests_end_group (void)

End the latest group of tests begun with cctests_begin_group(); finalise the internal state. Print a message on the log stream to report the operation.

Function: bool cctests_latest_group_completed_successfully (void)

Return true if the latest test group has completed successfully; otherwise return false.


Next: , Previous: , Up: Top   [Contents][Index]

This document describes version 0.4.1-devel.1 of CCTests.