[ CCUnit project page ] [ CCUnit home page ]
データ構造 | 型定義 | 関数

テストスイートの生成

いくつかのテストケースやテストスイートをまとめて、 ひとつのテストスイートにします。 [詳細]

テストスイートの生成のコラボレーション図

データ構造

struct  CCUnitTestSuite
 A Composite class of Tests. [詳細]

型定義

typedef struct CCUnitTestSuite CCUnitTestSuite
 A Composite class of Tests.

関数

CCUnitTestSuiteccunit_suite (const char *name)
 Create a test suite from test source file.
int main (int ac, char **av)
 To generate a test suite making source code.
int ccunit_makeSuite (int ac, char **av)
 テストケースのソースコードから、テストスイートを作成するコードを生成する。
int ccunit_va_makeSuite (const char *prg,...)
 Generate a code to creating test suite code from the test func source codes.
CCUnitTestSuiteccunit_newTestSuite (const char *name)
 Constructs an empty TestSuite.
void ccunit_deleteTestSuite (CCUnitTestSuite *suite)
 Destructs test suite.
void ccunit_addTest (CCUnitTestSuite *suite, CCUnitTest *test)
 Adds a test to the suite.
void ccunit_addTestSuite (CCUnitTestSuite *suite, CCUnitTestSuite *testSuite)
 Adds a test suite to the suite.
void ccunit_addTestCase (CCUnitTestSuite *suite, CCUnitTestCase *testCase)
 Adds a test case to the suite.

説明

いくつかのテストケースやテストスイートをまとめて、 ひとつのテストスイートにします。

参照:
MakeSuite

型定義

A Composite class of Tests.

It runs a collection of test case or suite. Here is an example.

 CCUnitTestSuite* suite = ccunit_newTestSuite ("a test suite");
 ccunit_addTestCase (suite, TESTCASE);
 ccunit_addTestSuite (suite, TESTSUITE);
参照:
CCUnitTest, CCUnitTestCase.

関数

void ccunit_addTest ( CCUnitTestSuite suite,
CCUnitTest test 
) [inline]

Adds a test to the suite.

引数:
suite test suite.
test test to add.
void ccunit_addTestCase ( CCUnitTestSuite suite,
CCUnitTestCase testCase 
) [inline]

Adds a test case to the suite.

引数:
suite test suite.
testCase test case to add.
void ccunit_addTestSuite ( CCUnitTestSuite suite,
CCUnitTestSuite testSuite 
) [inline]

Adds a test suite to the suite.

引数:
suite test suite.
testSuite test to add.
void ccunit_deleteTestSuite ( CCUnitTestSuite suite  )  [inline]

Destructs test suite.

引数:
suite deleting suite.
int ccunit_makeSuite ( int  ac,
char **  av 
)

テストケースのソースコードから、テストスイートを作成するコードを生成する。

引数:
ac arg count.
av array of arg string.
 av[] = { PRORGNAME, [OPTIONS]..., FILES... }
 OPTIONS:
      --output OUTFILE
      -o OUTFILE
          output file name (default stdout)
      --function FUNCTION
      -f FUNCTION
          creating function name
      --verbose
      -v
          output verbose message
      --debug
      -d
          output debug message
      --version
      -V
          print version
      --help
      -h
          print this message
 FILES: the special name '-' means input from stdin.

テストケースソースコードは次の疑似 BNF によってフォーマットされなくてはなりません。

 SOURCEFILE ::= [SUITE]... | TESTCASE...

 SUITE ::= SUITE_HEADER
           [ any-C-code ]...
           TESTCASE...
           SUITE_END

 SUITE_HEADER ::= JAVADOC_COMMENT_BEGIN 'test suite:' SUITE_NAME COMMENT_END
 SUITE_END ::= JAVADOC_COMMENT_BEGIN 'end test suite' wsp string COMMENT_END

 TESTCASE ::= TESTCASE_HEADER
             [TESTCASE_CODE]...
             [TESTFUNC]...
             TESTCASE_END

 TESTCASE_HEADER ::= JAVADOC_COMMENT_BEGIN
                    'test case:' TESTCASE_NAME
                    COMMENT_END
 TESTCASE_CODE ::= any C language codes.

 TESTFUNC ::= [ FUNC_DESC ] 'void ' FUNC_PREFIX[A-Za-z0-9_]* '()' FUNC_BODY

 FUNC_PREFIX ::= 'test' | 'setUp' | 'tearDown' | 'setup_setUp' | 'setup_tearDown'

 TESTCASE_END ::= JAVADOC_COMMENT_BEGIN 'end test case ' [string] COMMENT_END

 FUNC_DESC ::= JAVADOC_COMMENT_BEGIN string COMMENT_END

 FUNC_BODY ::= '{' C language codes... '}'

 JAVADOC_COMMENT_BEGIN ::= '/' '*' '*'
 COMMENT_END ::= '*' '/'
戻り値:
0 if succeeded, else error occured.

参照元 main().

呼出しグラフ:

CCUnitTestSuite * ccunit_newTestSuite ( const char *  name  )  [inline]

Constructs an empty TestSuite.

引数:
name test suite name.
戻り値:
new test suite.
CCUnitTestSuite* ccunit_suite ( const char *  name  ) 

Create a test suite from test source file.

引数:
name test suite name.
戻り値:
new test suite.
int ccunit_va_makeSuite ( const char *  prg,
  ... 
)

Generate a code to creating test suite code from the test func source codes.

引数:
prg program name
... arguments. The last arg must be NULL.
戻り値:
0 if succeeded, else error occured.
参照:
ccunit_makeSuite
int main ( int  ac,
char **  av 
)

To generate a test suite making source code.

参照:
ccunit_makeSuite

参照先 ccunit_makeSuite().

関数の呼び出しグラフ:

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