CCUnit  2.1
A C Unit Testing Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Modules | Functions
_ReadSuite
MakeSuite

Read test func 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 _CCUnitTestDefinitTestDef (_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.
_CCUnitTestSuiteDefccunit_newTestSuiteDef (const char *name)
 create new test suite def.
void ccunit_deleteTestSuiteDef (_CCUnitTestSuiteDef *suite)
 delete test suite def.
static _CCUnitTestDefaddTestDef (_CCUnitTestSuiteDef *suite, _CCUnitTestDef *test)
 add test to test suite.
static _CCUnitTestDefaddTestSuiteDef (_CCUnitTestSuiteDef *suite, _CCUnitTestSuiteDef *test)
 add test suite to test suite.
static _CCUnitTestDefaddTestCaseDef (_CCUnitTestSuiteDef *suite, _CCUnitTestCaseDef *test)
 add test case to test suite.
static _CCUnitFuncDefnewFuncDef (const char *scope, const char *type, const char *name, const char *desc)
 create new test func.
static void deleteFuncDef (_CCUnitFuncDef *func)
 delete test func def.
static void destroyTestCaseDef (_CCUnitTestCaseDef *testCase)
 destroy test case def.
static _CCUnitTestCaseDefnewTestCaseDef (const char *name)
 create new test case def.

Detailed Description

Read test func definitions from test source code.


Function Documentation

static _CCUnitTestDef* addTestCaseDef ( _CCUnitTestSuiteDef suite,
_CCUnitTestCaseDef test 
)
inlinestatic

add test case to test suite.

Parameters:
suitetest suite to add.
testtest case.
Returns:
added test.

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

Referenced by readTestCase().

Here is the call graph for this function:

Here is the caller graph for this function:

static _CCUnitTestDef* addTestDef ( _CCUnitTestSuiteDef suite,
_CCUnitTestDef test 
)
static

add test to test suite.

Parameters:
suitetest suite to add.
testtest group.
Returns:
added test.

References ccunit_addList(), and _CCUnitTestSuiteDef::testdefs.

Referenced by addTestCaseDef(), and addTestSuiteDef().

Here is the call graph for this function:

Here is the caller graph for this function:

static _CCUnitTestDef* addTestSuiteDef ( _CCUnitTestSuiteDef suite,
_CCUnitTestSuiteDef test 
)
inlinestatic

add test suite to test suite.

Parameters:
suitetest suite to add.
testtest suite.
Returns:
added test.

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

Referenced by readSuite(), and readTestCase().

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:
suitetest suite def.

References deleteTestDef(), and _CCUnitTestSuiteDef::testdef.

Referenced by ccunit_makeSuite().

Here is the call graph for this function:

Here is the caller graph for this function:

_CCUnitTestSuiteDef* ccunit_newTestSuiteDef ( const char *  name)

create new test suite def.

Parameters:
namesuite name.
Returns:
created testdef.

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

Referenced by ccunit_makeSuite(), readSuite(), and readTestCase().

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:
fnametest 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.

Referenced by ccunit_makeSuite().

Here is the call graph for this function:

Here is the caller graph for this function:

static void deleteFuncDef ( _CCUnitFuncDef func)
static

delete test func def.

Parameters:
functest func def to delete.

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

Referenced by destroyTestCaseDef(), and readSuite().

Here is the caller graph for this function:

static void deleteTestDef ( _CCUnitTestDef test)
static

delete test def.

Parameters:
testtestdef to delete.

References _CCUnitTestDef::dtor, and safe_free.

Referenced by ccunit_deleteTestSuiteDef(), and destroyTestSuiteDef().

Here is the caller graph for this function:

static void destroyTestCaseDef ( _CCUnitTestCaseDef testCase)
static

destroy test case def.

Parameters:
testCasetest case def to destroy.

References ccunit_deleteList(), deleteFuncDef(), destroyTestDef(), _CCUnitTestCaseDef::testdef, and _CCUnitTestCaseDef::testFuncs.

Referenced by newTestCaseDef().

Here is the call graph for this function:

Here is the caller graph for this function:

static void destroyTestDef ( _CCUnitTestDef test)
static

destroy test def.

Parameters:
testtestdef to destroy.

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

Referenced by destroyTestCaseDef(), and destroyTestSuiteDef().

Here is the caller graph for this function:

static void destroyTestSuiteDef ( _CCUnitTestSuiteDef suite)
static

destroy test suite def.

Parameters:
suitetest suite def.

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

Referenced by ccunit_newTestSuiteDef().

Here is the call graph for this function:

Here is the caller graph for this function:

static _CCUnitTestDef* initTestDef ( _CCUnitTestDef test,
CCUnitTestType_t  type,
const char *  name 
)
static

init test def.

Parameters:
testtestdef.
typetest type.
nametest name.

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

Referenced by ccunit_newTestSuiteDef(), and newTestCaseDef().

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 func.

Parameters:
scopescope.
typereturn type of func.
namefunc name.
descdescription.
Returns:
new test func def.

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

Referenced by readTestFunc().

Here is the call graph for this function:

Here is the caller graph for this function:

static _CCUnitTestCaseDef* newTestCaseDef ( const char *  name)
static

create new test case def.

Parameters:
nametest case name.

References ccunit_initList(), ccunit_log(), ccunitTypeTestCase, destroyTestCaseDef(), _CCUnitTestDef::dtor, initTestDef(), _CCUnitTestCaseDef::testdef, and _CCUnitTestCaseDef::testFuncs.

Referenced by readTestCase().

Here is the call graph for this function:

Here is the caller graph for this function:

SourceForge.jp hosts this site. Send comments to: CCUnit Developer