Generate a code to creating test suite code from the test func source codes.
- Parameters:
-
| 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
--help
-h
FILES: the special name '-' means input from stdin.
To generate a code, the test case source codes must be formatted by following pseudo-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' |
'setUpBeforeClass' | 'tearDownAfterClass'
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 ::= '*' '/'
- Returns:
- 0 if succeeded, else error occured.
References _ccunit_debug_message, _ccunit_verbose_message, ccunit_deleteTestSuiteDef(), ccunit_err(), ccunit_newTestSuiteDef(), ccunit_printSuite(), ccunit_readSuite(), DIRSEP, SETVBUF, and usage().
Referenced by ccunit_va_makeSuite(), and main().