[ CCUnit project page ] |  | [ CCUnit home page ]

Functions | Variables

# CCUnitTestFixture.c File Reference

TestFixture module implementation. More...

`#include <ccunit/CCUnitTestFixture.h>`
`#include <ccunit/CCUnitTestResult.h>`
`#include <assert.h>`
`#include <setjmp.h>`
Include dependency graph for CCUnitTestFixture.c:

## Functions
void | _ccunit_startTest (CCUnitTestResult *result, struct CCUnitTestCase *test)
| Informs the result that a test will be started.
void | _ccunit_endTest (CCUnitTestResult *result, struct CCUnitTestCase *test)
| Informs the result that a test was completed.
void | ccunit_addTestCase (CCUnitTestFixture *fixture, CCUnitTestCase *testCase)
| add test case to test fixture.
CCUnitTestCase * | ccunit_addNewTestCase (CCUnitTestFixture *fixture, const char *name, const char *desc, void(*runTest)())
| add new test case to test fixture.
static CCUnitTestFailure * | runTest (CCUnitTestCase *testCase, CCUnitTestFunc *setUp, CCUnitTestFunc *tearDown, CCUnitTestResult *result)
| Runs the bare test sequence.
static void | run (CCUnitTest *test, CCUnitTestResult *result)
| Runs the test fixture and collects the results in CCUnitTestResult.
static void | destroy (CCUnitTest *test)
| Destruct test fixture.
CCUnitTestFixture * | ccunit_newTestFixture (const char *name, CCUnitTestFunc *setUp, CCUnitTestFunc *tearDown)
| create new test fixture.
void | ccunit_setTestFixtureSetup (CCUnitTestFixture *fixture, CCUnitTestFunc *setup_setUp, CCUnitTestFunc *setup_tearDown)
| set test fixture setup functions.
struct CCUnitTestResult * | ccunit_runTestFixture (CCUnitTestFixture *f)
| run test cases and collect its results.
## Variables
jmp_buf | _ccunit_runTest_env
| run tests exception environment.
CCUnitTestFailure * | _ccunit_testFailure
| run tests exception.

## Detailed Description

TestFixture module implementation.

## Function Documentation

static void destroy | ( | CCUnitTest * | test | ) | `[static]`

Destruct test fixture.

Parameters:

  | test | destruct test.

References ccunit_deleteList(), ccunit_deleteTestCase(), ccunit_deleteTestFunc(), ccunitTypeFixture, CCUnitTestFixture::name, safe_free, CCUnitTestFixture::setUp, CCUnitTestFixture::tearDown, CCUnitTestFixture::testCases, and CCUnitTest::type.

Referenced by ccunit_newTestFixture().

Here is the call graph for this function:

Here is the caller graph for this function:

static void run | ( | CCUnitTest * | test,
|  | CCUnitTestResult * | result |
| ) |  |  | `[static]`

Runs the test fixture and collects the results in CCUnitTestResult.

Parameters:

  | test | A test to run.
  | result | A result container.

References _ccunit_endTest(), _ccunit_runTest_env, _ccunit_startTest(), ccunit_addFailure(), ccunit_initListIterator(), ccunit_nextListIterator(), ccunitTypeFixture, runTest(), CCUnitTestCase::runTest, CCUnitTestFixture::setUp, CCUnitTestFixture::setup_setUp, CCUnitTestFixture::setup_tearDown, CCUnitTestFixture::tearDown, CCUnitTestFailure::testCase, CCUnitTestFixture::testCases, and CCUnitTest::type.

Referenced by ccunit_newTestFixture().

Here is the call graph for this function:

Here is the caller graph for this function:

static CCUnitTestFailure* runTest | ( | CCUnitTestCase * | testCase,
|  | CCUnitTestFunc * | setUp,
|  | CCUnitTestFunc * | tearDown,
|  | CCUnitTestResult * | result |
| ) |  |  | `[static]`

Runs the bare test sequence.

Returns:
  failure

References _ccunit_runTest_env, ccunit_addFailure(), CCUnitTestResult::runCount, CCUnitTestCase::runTest, and CCUnitTestFailure::testCase.

Referenced by ccunit_addNewTestCase(), and run().

Here is the call graph for this function:

Here is the caller graph for this function:

| hosts this site. |  | Send comments to: CCUnit Developer |