?????????? CUnit ??饗1??
???????????? ???????[ 2013/8/28 17:06:52 ] ????????
????4.5 ??????????????????????
????CU_ErrorCode CU_set_suite_active(CU_pSuite pSuite?? CU_BOOL fNewActive)
????CU_ErrorCode CU_set_test_active(CU_pTest pTest?? CU_BOOL fNewActive)
??????Щ??????????????????????????????????????????????????????????????????????в??????????У?????????????????????????????е?????????????????????????????????????????????????pSuite->fActive??pTest->fActive????????????????????????????????????????в???????????????????????????????????CUE_NOSUIT??CUI_NOTEST??
????4.6 ??????????????????????
CU_ErrorCode CU_set_suite_name(CU_pSuite pSuite?? const char *strNewName)
CU_ErrorCode CU_set_test_name(CU_pTest pTest?? const char *strNewName)
CU_ErrorCode CU_set_suite_initfunc(CU_pSuite pSuite?? CU_InitializeFunc pNewInit)
CU_ErrorCode CU_set_suite_cleanupfunc(CU_pSuite pSuite?? CU_CleanupFunc pNewClean)
CU_ErrorCode CU_set_test_func(CU_pTest pTest?? CU_TestFunc pNewFunc)
????4.7 ??????????????????
?????????????£???????????????????????????????????????????á?????????????????????????????????????????????????á?CUnit???????????????????????????????????????
CU_pSuite CU_get_suite(const char* strName)
CU_pSuite CU_get_suite_at_pos(unsigned int pos)
unsigned int CU_get_suite_pos(CU_pSuite pSuite)
unsigned int CU_get_suite_pos_by_name(const char* strName)
??????Щ???????????????????????е???????????????????????λ?ò???????????????????ò???????????????NULL??λ?ò?????1?????????е???????????????????????????????????е????????????????????г????????????CUE_NOREGISTRY????????????????????????????????????CUE_NO_SUITENAME?????NULL??
CU_pTest CU_get_test(CU_pSuite pSuite?? const char *strName)
CU_pTest CU_get_test_at_pos(CU_pSuite pSuite?? unsigned int pos)
unsigned int CU_get_test_pos(CU_pSuite pSuite?? CU_pTest pTest)
unsigned int CU_get_test_pos_by_name(CU_pSuite pSuite?? const char *strName)
?????????????????????????
????5. ???в???
????5.1 ??????????
#include <CUnit/Automated.h>
void CU_automated_run_tests(void)
CU_ErrorCode CU_list_tests_to_file(void)
void CU_set_output_filename(const char* szFilenameRoot)
#include <CUnit/Basic.h>
typedef enum CU_BasicRunMode
CU_ErrorCode CU_basic_run_tests(void)
CU_ErrorCode CU_basic_run_suite(CU_pSuite pSuite)
CU_ErrorCode CU_basic_run_test(CU_pSuite pSuite?? CU_pTest pTest)
void CU_basic_set_mode(CU_BasicRunMode mode)
CU_BasicRunMode CU_basic_get_mode(void)
void CU_basic_show_failures(CU_pFailureRecord pFailure)
#include <CUnit/Console.h>
void CU_console_run_tests(void)
#include <CUnit/CUCurses.h>
void CU_curses_run_tests(void)
#include <CUnit/TestRun.h>
unsigned int CU_get_number_of_suites_run(void)
unsigned int CU_get_number_of_suites_failed(void)
unsigned int CU_get_number_of_tests_run(void)
unsigned int CU_get_number_of_tests_failed(void)
unsigned int CU_get_number_of_asserts(void)
unsigned int CU_get_number_of_successes(void)
unsigned int CU_get_number_of_failures(void)
typedef struct CU_RunSummary
typedef CU_Runsummary* CU_pRunSummary
const CU_pRunSummary CU_get_run_summary(void)
typedef struct CU_FailureRecord
typedef CU_FailureRecord* CU_pFailureRecord
const CU_pFailureRecord CU_get_failure_list(void)
unsigned int CU_get_number_of_failure_records(void)
void CU_set_fail_on_inactive(CU_BOOL new_inactive)
CU_BOOL CU_get_fail_on_inactive(void)
????5.2 ?????
????CUnit???????????????е??????????????????????????????????????????? CUnit?????????????????????????????????????????????????????????????????????????β?????????????????????????ε??????????????????????????????Щ????????????????????????????????????????????????????
??????????????????????????????????????????У???????????????XML????????е??????????????????????????XML???????????????????o?????
????void CU_automated_run_tests(void) ?ú???????????????л???????????????????????????????ROOT-Results??XML?????ROOT??????? CU_set_output_filename()???????????????????? CUnitAutomated-Results.xml????????????????????????????????????????????????
????CU_ErrorCode CU_list_tests_to_file(void) ?ú???????????г????????????????????????????????б???????ROOT-Listing.XML??????ROOT??????? CU_set_output_filename()?????????????????CUnitAutomated??????????????????????????????б?????????????????????????????????????б??????????????????????y???????
????void CU_set_output_filename(const char* szFilenameRoot) ????????????????????????б??????????????ò????????????????-Results.xml??-Listing.xml??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11