Commit c291d6ab authored by tlh2000's avatar tlh2000

* applied patch #2941518 (junit output support)


git-svn-id: http://svn.code.sf.net/p/cunit/code/trunk@130 f00e6729-6848-4c17-8bfb-678c97c00071
parent 961feb67
......@@ -83,6 +83,12 @@ CU_EXPORT void CU_set_output_filename(const char* szFilenameRoot);
#define set_output_filename(x) CU_set_output_filename((x))
#endif /* USE_DEPRECATED_CUNIT_NAMES */
void CU_automated_enable_junit_xml(CU_BOOL bFlag);
void CU_automated_package_name_set(const char *pName);
const char *CU_automated_package_name_get();
#ifdef __cplusplus
}
#endif
......
......@@ -31,10 +31,10 @@
* return, provided _FATAL versions of assertions to return
* from test function on failure. (JDS)
*
* 01-Sep-2004 Modified assertions for setjmp/longjmp mechanism of
* 01-Sep-2004 Modified assertions for setjmp/longjmp mechanism of
* aborting test runs, added CU_FAIL and CU_PASS macros. (JDS)
*
* 07-May-2005 Added CU_ prefix to remaining CUnit defines (BOOL, TRUE,
* 07-May-2005 Added CU_ prefix to remaining CUnit defines (BOOL, TRUE,
* FALSE, MAX_...). Added CU_UNREFERENCED_PARAMETER() define. (JDS)
*/
......
......@@ -152,6 +152,8 @@ typedef struct CU_Suite
struct CU_Suite* pNext; /**< Pointer to the next suite in linked list. */
struct CU_Suite* pPrev; /**< Pointer to the previous suite in linked list. */
unsigned int uiNumberOfTestsFailed; /**< Number of failed tests in the suite. */
unsigned int uiNumberOfTestsSuccess; /**< Number of success tests in the suite. */
} CU_Suite;
typedef CU_Suite* CU_pSuite; /**< Pointer to a CUnit suite. */
......
......@@ -107,6 +107,7 @@ typedef CU_FailureRecord* CU_pFailureRecord; /**< Pointer to CU_FailureRecord.
/** Data type for holding statistics and assertion failures for a test run. */
typedef struct CU_RunSummary
{
char PackageName[50];
unsigned int nSuitesRun; /**< Number of suites completed during run. */
unsigned int nSuitesFailed; /**< Number of suites for which initialization failed. */
unsigned int nSuitesInactive; /**< Number of suites which were inactive. */
......
This diff is collapsed.
......@@ -445,6 +445,9 @@ CU_ErrorCode CU_run_test(CU_pSuite pSuite, CU_pTest pTest)
f_pCurTest = NULL;
f_pCurSuite = pSuite;
pSuite->uiNumberOfTestsFailed = 0;
pSuite->uiNumberOfTestsSuccess = 0;
/* run handler for suite start, if any */
if (NULL != f_pSuiteStartMessageHandler) {
(*f_pSuiteStartMessageHandler)(pSuite);
......@@ -879,6 +882,13 @@ static CU_ErrorCode run_single_suite(CU_pSuite pSuite, CU_pRunSummary pRunSummar
}
}
pTest = pTest->pNext;
if (CUE_SUCCESS == result) {
pSuite->uiNumberOfTestsFailed++;
}
else {
pSuite->uiNumberOfTestsSuccess++;
}
}
pRunSummary->nSuitesRun++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment