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

Modules | Functions

# _ReadSuite
[MakeSuite]

Read test case definitions from test source code. More...

Collaboration diagram for _ReadSuite:

## Modules
| _Line

| Read one line module.
## Functions
void | ccunit_readSuite (const char *fname, _CCUnitTestSuiteDef *parent)
| read test unit suite from specified stream.
static void | destroyTestDef (_CCUnitTestDef *test)
| destroy test def.
static _CCUnitTestDef * | initTestDef (_CCUnitTestDef *test, CCUnitTestType_t type, const char *name)
| init test def.
static void | deleteTestDef (_CCUnitTestDef *test)
| delete test def.
static void | destroyTestSuiteDef (_CCUnitTestSuiteDef *suite)
| destroy test suite def.
_CCUnitTestSuiteDef * | ccunit_newTestSuiteDef (const char *name)
| create new test suite def.
void | ccunit_deleteTestSuiteDef (_CCUnitTestSuiteDef *suite)
| delete test suite def.
static _CCUnitTestDef * | addTestDef (_CCUnitTestSuiteDef *suite, _CCUnitTestDef *test)
| add test to test suite.
static _CCUnitTestDef * | addTestSuiteDef (_CCUnitTestSuiteDef *suite, _CCUnitTestSuiteDef *test)
| add test suite to test suite.
static _CCUnitTestDef * | addTestFixtureDef (_CCUnitTestSuiteDef *suite, _CCUnitTestFixtureDef *test)
| add test fixture to test suite.
static _CCUnitFuncDef * | newFuncDef (const char *scope, const char *type, const char *name, const char *desc)
| create new test case.
static void | deleteFuncDef (_CCUnitFuncDef *func)
| delete test func def.
static void | destroyTestFixtureDef (_CCUnitTestFixtureDef *fixture)
| destroy test fixture def.
static _CCUnitTestFixtureDef * | newTestFixtureDef (const char *name)
| create new test fixture def.

## Detailed Description

Read test case definitions from test source code.

## Function Documentation

static _CCUnitTestDef* addTestDef | ( | _CCUnitTestSuiteDef * | suite,
|  | _CCUnitTestDef * | test |
| ) |  |  | `[static]`

add test to test suite.

Parameters:

  | suite | test suite to add.
  | test | test group.

Returns:
  added test.

References ccunit_addList(), and _CCUnitTestSuiteDef::testdefs.

Referenced by addTestFixtureDef(), and addTestSuiteDef().

Here is the call graph for this function:

Here is the caller graph for this function:

static _CCUnitTestDef* addTestFixtureDef | ( | _CCUnitTestSuiteDef * | suite,
|  | _CCUnitTestFixtureDef * | test |
| ) |  |  | `[inline, static]`

add test fixture to test suite.

Parameters:

  | suite | test suite to add.
  | test | test fixture.

Returns:
  added test.

References addTestDef(), ccunit_log(), _CCUnitTestDef::name, and _CCUnitTestFixtureDef::testdef.

Referenced by readTestFixture().

Here is the call graph for this function:

Here is the caller graph for this function:

static _CCUnitTestDef* addTestSuiteDef | ( | _CCUnitTestSuiteDef * | suite,
|  | _CCUnitTestSuiteDef * | test |
| ) |  |  | `[inline, static]`

add test suite to test suite.

Parameters:

  | suite | test suite to add.
  | test | test suite.

Returns:
  added test.

References addTestDef(), ccunit_log(), _CCUnitTestDef::name, and _CCUnitTestSuiteDef::testdef.

Referenced by readSuite().

Here is the call graph for this function:

Here is the caller graph for this function:

void ccunit_deleteTestSuiteDef | ( | _CCUnitTestSuiteDef * | suite | ) | `[inline]`

delete test suite def.

Parameters:

  | suite | test suite def.

References deleteTestDef(), and _CCUnitTestSuiteDef::testdef.

Here is the call graph for this function:

_CCUnitTestSuiteDef* ccunit_newTestSuiteDef | ( | const char * | name | ) |

create new test suite def.

Parameters:

  | name | suite name.

Returns:
  created testdef.

References ccunit_initList(), ccunitTypeSuite, _CCUnitTestDef::dtor, initTestDef(), _CCUnitTestSuiteDef::testdef, and _CCUnitTestSuiteDef::testdefs.

Referenced by readSuite().

Here is the call graph for this function:

Here is the caller graph for this function:

void ccunit_readSuite | ( | const char * | fname,
|  | _CCUnitTestSuiteDef * | parent |
| ) |  |  |

read test unit suite from specified stream.

Parameters:

  | fname | test unit source code file.
  | parent | [out] test suite to adding read test.

References ccunit_err(), _CCUnitLine::fname, _CCUnitLine::ifp, line, readSuite(), safe_free, and _CCUnitLine::str.

Here is the call graph for this function:

static void deleteFuncDef | ( | _CCUnitFuncDef * | func | ) | `[static]`

delete test func def.

Parameters:

  | func | test func def to delete.

References _CCUnitFuncDef::desc, _CCUnitFuncDef::name, safe_free, _CCUnitFuncDef::scope, and _CCUnitFuncDef::type.

Referenced by destroyTestFixtureDef(), readSuite(), and setFixtureFunc().

Here is the caller graph for this function:

static void deleteTestDef | ( | _CCUnitTestDef * | test | ) | `[static]`

delete test def.

Parameters:

  | test | testdef to delete.

References _CCUnitTestDef::dtor, and safe_free.

Referenced by ccunit_deleteTestSuiteDef(), and destroyTestSuiteDef().

Here is the caller graph for this function:

static void destroyTestDef | ( | _CCUnitTestDef * | test | ) | `[static]`

destroy test def.

Parameters:

  | test | testdef to destroy.

References _CCUnitTestDef::idname, _CCUnitTestDef::name, and safe_free.

Referenced by destroyTestFixtureDef(), and destroyTestSuiteDef().

Here is the caller graph for this function:

static void destroyTestFixtureDef | ( | _CCUnitTestFixtureDef * | fixture | ) | `[static]`

destroy test fixture def.

Parameters:

  | fixture | test fixture def to destroy.

References ccunit_deleteList(), deleteFuncDef(), destroyTestDef(), _CCUnitTestFixtureDef::setUp, _CCUnitTestFixtureDef::tearDown, _CCUnitTestFixtureDef::testCases, and _CCUnitTestFixtureDef::testdef.

Here is the call graph for this function:

static void destroyTestSuiteDef | ( | _CCUnitTestSuiteDef * | suite | ) | `[static]`

destroy test suite def.

Parameters:

  | suite | test suite def.

References ccunit_deleteList(), deleteTestDef(), destroyTestDef(), _CCUnitTestSuiteDef::testdef, and _CCUnitTestSuiteDef::testdefs.

Here is the call graph for this function:

static _CCUnitTestDef* initTestDef | ( | _CCUnitTestDef * | test,
|  | CCUnitTestType_t | type,
|  | const char * | name |
| ) |  |  | `[static]`

init test def.

Parameters:

  | test | testdef.
  | type | test type.
  | name | test name.

References _CCUnitTestDef::idname, _CCUnitTestDef::name, safe_strdup, and _CCUnitTestDef::type.

Referenced by ccunit_newTestSuiteDef(), and newTestFixtureDef().

Here is the caller graph for this function:

static _CCUnitFuncDef* newFuncDef | ( | const char * | scope,
|  | const char * | type,
|  | const char * | name,
|  | const char * | desc |
| ) |  |  | `[static]`

create new test case.

Parameters:

  | scope | scope.
  | type | return type of case.
  | name | case name.
  | desc | description.

Returns:
  new test case def.

References ccunit_log(), _CCUnitFuncDef::desc, _CCUnitFuncDef::name, safe_strdup, _CCUnitFuncDef::scope, and _CCUnitFuncDef::type.

Referenced by readTestCase().

Here is the call graph for this function:

Here is the caller graph for this function:

static _CCUnitTestFixtureDef* newTestFixtureDef | ( | const char * | name | ) | `[static]`

create new test fixture def.

Parameters:

  | name | test fixture name.

References ccunit_initList(), ccunit_log(), ccunitTypeFixture, _CCUnitTestDef::dtor, initTestDef(), _CCUnitTestFixtureDef::testCases, and _CCUnitTestFixtureDef::testdef.

Referenced by readTestFixture().

Here is the call graph for this function:

Here is the caller graph for this function:

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