int main(int argc, char** argv) { CU_SuiteInfo suites[] = { pro_expr_test_suite, pro_identifier_expr_test_suite, pro_string_expr_test_suite, pro_number_expr_test_suite, pro_let_expr_test_suite, pro_send_expr_test_suite, pro_become_expr_test_suite, CU_SUITE_INFO_NULL }; // initialize the CUnit test registry if (CUE_SUCCESS != CU_initialize_registry()) return CU_get_error(); // add suites to the registry if (CUE_SUCCESS != CU_register_suites(suites)) { CU_cleanup_registry(); return CU_get_error(); } // run all tests CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); CU_cleanup_registry(); return CU_get_error(); }
/* The main() function for setting up and running the tests. * Returns a CUE_SUCCESS on successful running, another * CUnit error code on failure. */ int main(void) { /* * Special for RTP: Initialize the memory management for * all the different types of RTP sessions. This only * needs to be done once at the beginning of time (here). */ rtp_asm_init_module(); rtp_ptp_init_module(); rtp_ssm_rsi_source_init_module(); rtp_ssm_rsi_rcvr_init_module(); /* initialize the CUnit test registry */ if (CUE_SUCCESS != CU_initialize_registry()) { return CU_get_error(); } if (CUE_SUCCESS != CU_register_suites(suites_rtp)) { return CU_get_error(); } /* Run all tests using the CUnit Basic interface */ CU_basic_set_mode(CU_BRM_VERBOSE); (void)CU_basic_run_tests(); CU_cleanup_registry(); return CU_get_error(); }
int main() { CU_ErrorCode error; if (CUE_SUCCESS != CU_initialize_registry()) return CU_get_error(); error=CU_register_suites(suites); if (error != CUE_SUCCESS) { perror(CU_get_error_msg()); CU_cleanup_registry(); return CU_get_error(); } printf("Seting OK\n"); fflush(stdout); /* Run all tests using the CUnit Basic interface */ CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); CU_cleanup_registry(); return CU_get_error(); }
void gradle_cunit_register() { CU_TestInfo unique_check_test_array[] = { {"unique check", test_initializer}, CU_TEST_INFO_NULL, }; CU_TestInfo row_column_validator_test_array[] = { {"valid row column test", test_valid_row_column_validate}, {"invalid row column test", test_invalid_row_column_validate}, CU_TEST_INFO_NULL, }; CU_TestInfo box_validator_test_array[] = { {"valid box valid puzzle test", test_valid_box_validate_valid_puzzle}, {"valid box invalid puzzle test", test_valid_box_validate_invalid_puzzle}, {"invalid box invalid puzzle test", test_invalid_box_validate_invalid_puzzle}, CU_TEST_INFO_NULL, }; CU_SuiteInfo suites[] = { { "unique check tests", unique_check_initializer_setup, unique_check_initializer_teardown, unique_check_test_array }, { "row column validator tests", row_column_validate_setup, row_column_validate_teardown, row_column_validator_test_array }, { "box validator tests", box_validate_setup, box_validate_teardown, box_validator_test_array }, CU_SUITE_INFO_NULL, }; CU_register_suites(suites); CU_basic_run_tests(); CU_basic_set_mode(CU_BRM_VERBOSE); CU_list_tests_to_file(); }
int main() { CU_ErrorCode err; err = CU_initialize_registry(); if (err != CUE_SUCCESS) { printf("ERROR: cannot initialize CUNIT registry, giving up.\n"); return 1; } err = CU_register_suites(suites); if (err == CUE_SUCCESS) { //CU_basic_set_mode(CU_BRM_NORMAL); //CU_basic_set_mode(CU_BRM_SILENT); CU_basic_set_mode(CU_BRM_VERBOSE); err = CU_basic_run_tests(); if (err != CUE_SUCCESS) { printf("CU_basic_run_tests returned %i\n", err); } } else { printf("ERROR: cannot add test suites\n"); } CU_cleanup_registry(); tst_exit(); }
CU_ErrorCode register_suites_set() { CU_TestInfo suite_set[] = { { "rf_set_new", test_rf_set_new }, { "rf_set_clone", test_rf_set_clone }, { "rf_set_new_intersection", test_rf_set_new_intersection }, { "rf_set_new_powerset", test_rf_set_new_powerset }, { "rf_set_equal", test_rf_set_equal }, { "rf_set_contains_element", test_rf_set_contains_element }, { "rf_get_element_index", test_rf_set_get_element_index }, { "rf_set_is_subset", test_rf_set_is_subset }, CU_TEST_INFO_NULL }; CU_TestInfo suite_set_element[] = { { "rf_set_element_new_string", test_rf_set_element_new_string }, { "rf_set_element_new_set", test_rf_set_element_new_set }, { "rf_set_element_clone", test_rf_set_element_clone }, { "rf_set_element_equal", test_rf_set_element_equal }, CU_TEST_INFO_NULL }; CU_SuiteInfo suites[] = { { "rf_Set", NULL, NULL, suite_set }, { "rf_SetElement", NULL, NULL, suite_set_element }, CU_SUITE_INFO_NULL }; return CU_register_suites(suites); }
void registerJacobiTests() { if (CU_register_suites(jacobi_suites) != CUE_SUCCESS) { fprintf(stderr, "Suite registration failed - %s\n", CU_get_error_msg()); exit(CU_get_error()); } }
int main (int argc, char* argv[]) { /* Set proper working directory */ if (argc == 1) { printf("Usage: test_vqec_utest <directory containing unit_test dir>\n\r"); } else if (argc > 1 && argv[1]) { if (chdir(argv[1]) != 0) { printf("Could not set working directory"); } } /* Initialize CUnit test registry */ if (CUE_SUCCESS != CU_initialize_registry()) { return CU_get_error(); } if (CUE_SUCCESS != CU_register_suites(suites_vqec)) { return CU_get_error(); } /* Run all tests using CUnit Basic interface */ CU_basic_set_mode(CU_BRM_VERBOSE); /* sa_ignore {} IGNORE_RETURN(1) */ CU_basic_run_tests(); CU_cleanup_registry(); return CU_get_error(); }
int main() { printf("Testing DAGDB\n"); CU_initialize_registry(); //CU_basic_set_mode(CU_BRM_SILENT); CU_basic_set_mode(CU_BRM_NORMAL); //CU_basic_set_mode(CU_BRM_VERBOSE); CU_register_suites(error_suites); CU_register_suites(bitarray_suites); CU_register_suites(mem_suites); CU_register_suites(base_suites); CU_register_suites(api_suites); CU_basic_run_tests(); int result = CU_get_number_of_tests_failed(); CU_cleanup_registry(); return result; }
int main(int argc, char *argv[]) { bool runTests = false; if (runTests == true) { CU_initialize_registry(); CU_register_suites(suites); CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); CU_cleanup_registry(); return CU_get_error(); } puts("Inicializando"); conf_nodo* configuracion = cargarConfiguracion(argc, argv); estadoGlobal= inicializarEstado(configuracion); int resultado = ejecutarProgramaPrincipal(estadoGlobal); return resultado; }
int main(int argc, char** argv) { CU_SuiteInfo suites[] = { pro_state_test_suite, pro_env_test_suite, pro_constructor_test_suite, pro_message_test_suite, pro_user_data_test_suite, CU_SUITE_INFO_NULL }; // initialize the CUnit test registry if (CUE_SUCCESS != CU_initialize_registry()) return CU_get_error(); // add suites to the registry if (CUE_SUCCESS != CU_register_suites(suites)) { CU_cleanup_registry(); return CU_get_error(); } // run all tests CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); CU_cleanup_registry(); return CU_get_error(); }
void list_cmdparse() { CU_TestInfo test[] = { { "strpart_1", test_strpart_1 }, { "strpart_2", test_strpart_2 }, { "strpart_3", test_strpart_3 }, { "strpart_4", test_strpart_4 }, { "strpart_5", test_strpart_5 }, { "shortargparse_1", test_shortargparse_1 }, { "argparse_1", test_argparse_1 }, { "argparse_2", test_argparse_2 }, { "argparse_3", test_argparse_3 }, { "argparse_4", test_argparse_4 }, { "argparse_5", test_argparse_5 }, { "argparse_6", test_argparse_6 }, { "argparse_7", test_argparse_7 }, { "argparse_8", test_argparse_8 }, { "option_parse_1", test_option_parse_1 }, CU_TEST_INFO_NULL }; CU_SuiteInfo suite[] = { { "cmdparse", NULL, NULL, test }, CU_SUITE_INFO_NULL }; CU_register_suites(suite); }
int main() { int i = 0; CU_ErrorCode error; test_initialize(); CU_SuiteInfo all_test_suites[TEST_CUITES_COUNT + 1]; all_test_suites[i++] = fs_test_suite; all_test_suites[i++] = mm_test_suite; all_test_suites[i++] = glibc_test_suite; all_test_suites[i++] = shell_test_suite; all_test_suites[i++] = ring_buffer_test_suite; all_test_suites[i++] = (CU_SuiteInfo)CU_SUITE_INFO_NULL; if (CUE_SUCCESS != CU_initialize_registry()) return CU_get_error(); error = CU_register_suites(all_test_suites); CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); CU_cleanup_registry(); error = CU_get_error(); test_finalize(); return error; }
int main(void) { if (CU_initialize_registry() != CUE_SUCCESS) { return CU_get_error(); } CU_SuiteInfo suites[] = { {"Policy Version 21", policy_21_init, policy_21_cleanup, policy_21_tests}, {"AV Rule Query", avrule_init, avrule_cleanup, avrule_tests}, {"Domain Transition Analysis", dta_init, dta_cleanup, dta_tests}, {"Infoflow Analysis", infoflow_init, infoflow_cleanup, infoflow_tests}, {"Role Query", role_init, role_cleanup, role_tests}, {"TE Rule Query", terule_init, terule_cleanup, terule_tests}, {"User Query", user_init, user_cleanup, user_tests}, {"Constrain query", constrain_init, constrain_cleanup, constrain_tests}, CU_SUITE_INFO_NULL }; CU_register_suites(suites); CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); unsigned int num_failures = CU_get_number_of_failure_records(); CU_cleanup_registry(); return (int)num_failures; }
void add_seq_list_suite(void) { CU_ErrorCode error = CU_register_suites(suites); if (error != CUE_SUCCESS) report_suite_reg_error(error, __func__); return ; }
void AddTests(void) { assert(NULL != CU_get_registry()); assert(!CU_is_test_running()); if(CUE_SUCCESS != CU_register_suites(suites)) { fprintf(stderr, "Register suites failed - %s ", CU_get_error_msg()); exit(EXIT_FAILURE); } }
int main(int argc, char** argv) { CU_pFailureRecord FailureList; CU_RunSummary *pRunSummary; int FailRec; if(CU_initialize_registry()) { fprintf(stderr, "Initialization of Test Registry failed.'n"); return -1; } assert(CU_get_registry()); assert(!CU_is_test_running()); if(CU_register_suites(suites) != CUE_SUCCESS) { fprintf(stderr, "Register suites failed - %s\n", CU_get_error_msg()); return -1; } CU_set_output_filename("lib-c"); CU_list_tests_to_file(); CU_automated_run_tests(); pRunSummary = CU_get_run_summary(); printf("Results:\n"); printf(" Number of suites run: %d\n", pRunSummary->nSuitesRun); printf(" Number of suites failed: %d\n", pRunSummary->nSuitesFailed); printf(" Number of tests run: %d\n", pRunSummary->nTestsRun); printf(" Number of tests failed: %d\n", pRunSummary->nTestsFailed); printf(" Number of asserts: %d\n", pRunSummary->nAsserts); printf(" Number of asserts failed: %d\n", pRunSummary->nAssertsFailed); printf(" Number of failures: %d\n", pRunSummary->nFailureRecords); /* Print any failures */ if (pRunSummary->nFailureRecords) { printf("\nFailures:\n"); FailRec = 1; for (FailureList = CU_get_failure_list(); FailureList; FailureList = FailureList->pNext) { printf("%d. File: %s Line: %u Test: %s\n", FailRec, FailureList->strFileName, FailureList->uiLineNumber, (FailureList->pTest)->pName); printf(" %s\n", FailureList->strCondition); FailRec++; } printf("\n"); } CU_cleanup_registry(); return 0; }
void add_tests() { assert(NULL != CU_get_registry()); assert(!CU_is_test_running()); if(CUE_SUCCESS != CU_register_suites(suites)) { exit(EXIT_FAILURE); } }
void gradle_cunit_register() { CU_TestInfo mobile_element_test_array[] = { { "mobile element case 1", test_mobile_element_state_1 }, { "mobile element case 2", test_mobile_element_state_2 }, { "mobile element case 3", test_mobile_element_state_3 }, { "mobile element case 4", test_mobile_element_state_4 }, { "mobile element case 5", test_mobile_element_state_5 }, { "mobile element case 6", test_mobile_element_state_6 }, CU_TEST_INFO_NULL, }; CU_TestInfo generate_permutation_and_update_index_test_array[] = { { "generate permutation and update index case 1", test_generate_permutation_and_update_index_state_1 }, { "generate permutation and update index case 2", test_generate_permutation_and_update_index_state_2 }, { "generate permutation and update index case 3", test_generate_permutation_and_update_index_state_3 }, { "generate permutation and update index case 4", test_generate_permutation_and_update_index_state_4 }, { "generate permutation and update index case 5", test_generate_permutation_and_update_index_state_5 }, CU_TEST_INFO_NULL, }; CU_TestInfo initialize_record_test_array[] = { { "initialize_record", test_initialize_record }, CU_TEST_INFO_NULL, }; CU_TestInfo update_direction_test_array[] = { { "update direction case 1", test_update_direction_case_1 }, { "update direction case 2", test_update_direction_case_2 }, CU_TEST_INFO_NULL, }; CU_TestInfo save_permutation_test_array[] = { { "save permutation in storage", test_save_permutation }, { "verify saving permutation in storage does not override older one", test_adding_another_permutation_will_retain_older_one }, CU_TEST_INFO_NULL, }; CU_SuiteInfo suites[] = { { "mobile element tests", mobile_element_setup_suite, mobile_element_teardown_suite, mobile_element_test_array }, { "generate permutation and update index tests", test_generate_permutation_and_update_index_setup, test_generate_permutation_and_update_index_teardown, generate_permutation_and_update_index_test_array }, { "mobile element tests", initialize_record_setup, initialize_record_teardown, initialize_record_test_array }, { "update direction tests", update_direction_setup, update_direction_teardown, update_direction_test_array }, { "save permutation tests", save_permutation_setup, save_permutation_teardown, save_permutation_test_array }, CU_SUITE_INFO_NULL, }; CU_register_suites(suites); CU_basic_set_mode (CU_BRM_VERBOSE); CU_basic_run_tests(); CU_list_tests_to_file(); }
int main(int argc, char *argv[]) { CU_ErrorCode cuStatus = CU_initialize_registry(); if (CUE_SUCCESS != cuStatus) { fprintf(stderr, "could not create CUnit test registry\n"); return -1; } gcstl_test_testStartPrint(); CU_TestInfo test_gcstl_destroy[] = { { "test_gcstl_destroy_default", test_gcstl_destroy_default }, CU_TEST_INFO_NULL }; CU_TestInfo test_gcstl_rbtree[] = { { "test_gcstl_rbtree_insert", test_gcstl_rbtree_insert }, { "test_gcstl_rbtree_remove", test_gcstl_rbtree_remove }, CU_TEST_INFO_NULL }; CU_SuiteInfo gcstl_test_suites[] = { { "test_gcstl_destroy", NULL, NULL, test_gcstl_destroy}, { "test_gcstl_rbtree", NULL, NULL, test_gcstl_rbtree }, CU_SUITE_INFO_NULL }; cuStatus = CU_register_suites(gcstl_test_suites); if (CUE_SUCCESS != cuStatus) { fprintf(stderr, "could register CUnit test suites\n"); return -1; } CU_basic_run_tests(); if (CUE_SUCCESS != cuStatus) { gcstl_test_testFailedToCompletePrint(); return -1; } else if (0 != CU_get_number_of_tests_failed()) { gcstl_test_testCompleteWithFailuresPrint(); return -1; } gcstl_test_testCompleteSuccessfullyPrint(); CU_cleanup_registry(); return 0; }
CU_ErrorCode testsuite_syncqueue(void) { /* Register test suite */ CU_SuiteInfo suites[] = { {"Sync Request Queue", init_sq, clean_sq, sq_test_array}, CU_SUITE_INFO_NULL, }; return CU_register_suites(suites); }
CU_ErrorCode testsuite_commqueue(void) { /* Register test suite */ CU_SuiteInfo suites[] = { {"Communication Queue", init_cq, clean_cq, cq_test_array}, CU_SUITE_INFO_NULL, }; return CU_register_suites(suites); }
//-------------------------------------------------------------------------------------------------- static void test(void* context) { // Init the test case / test suite data structures CU_TestInfo smstest[] = { { "Test le_sms_SetGetSmsCenterAddress()", Testle_sms_SetGetSmsCenterAddress }, { "Test le_sms_SetGetText()", Testle_sms_SetGetText }, { "Test le_sms_SetGetBinary()", Testle_sms_SetGetBinary }, { "Test le_sms_SetGetPDU()", Testle_sms_SetGetPDU }, { "Test le_sms_ReceivedList()", Testle_sms_ReceivedList }, { "Test le_sms_SendBinary()", Testle_sms_SendBinary }, { "Test le_sms_SendText()", Testle_sms_SendText }, #if 0 { "Test le_sms_SendPdu()", Testle_sms_SendPdu }, #endif CU_TEST_INFO_NULL, }; CU_SuiteInfo suites[] = { { "SMS tests", NULL, NULL, smstest }, CU_SUITE_INFO_NULL, }; fprintf(stderr, "Please ensure that there is enough space on SIM to receive new SMS messages!\n"); #ifndef AUTOMATIC GetTel(); #endif // Initialize the CUnit test registry and register the test suite if (CUE_SUCCESS != CU_initialize_registry()) exit(CU_get_error()); if ( CUE_SUCCESS != CU_register_suites(suites)) { CU_cleanup_registry(); exit(CU_get_error()); } CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); // Output summary of failures, if there were any if ( CU_get_number_of_failures() > 0 ) { fprintf(stdout,"\n [START]List of Failure :\n"); CU_basic_show_failures(CU_get_failure_list()); fprintf(stdout,"\n [STOP]List of Failure\n"); } }
int main() { CU_initialize_registry(); CU_register_suites(test_suites); CU_basic_set_mode(CU_BRM_NORMAL); CU_basic_run_tests(); CU_cleanup_registry(); return 0; }
CU_ErrorCode testsuite_commutils(void) { /* Register test suite */ CU_SuiteInfo suites[] = { {"Communication Utilities", init_cu, clean_cu, cu_test_array}, CU_SUITE_INFO_NULL, }; return CU_register_suites(suites); }
GOS_ERROR_CODE TMR_Unit_Test_Handler(VOS_APPL_UNIT_TEST_T *ut) { int i = 0; CU_pSuite pSuite = NULL; // show all the test suites if (0 == ut->id) { printf("\r\n"); while(i < sizeof(tmr_suites)/sizeof(CU_SuiteInfo)) { if (CU_INVALID_SUITE != tmr_suites[i].id) printf("%d:\t%s\r\n", tmr_suites[i].id, tmr_suites[i].pName); i++; } return GOS_OK; } if(CU_initialize_registry()){ fprintf(stderr, " Initialization of Test Registry failed. "); return GOS_ERR_NOT_INIT; }else{ /**//* shortcut regitry */ if(CU_ALL_TEST == ut->id) { if(CUE_SUCCESS != CU_register_suites(&tmr_suites[0])){ fprintf(stderr, "Register suites failed - %s ", CU_get_error_msg()); return GOS_ERR_NOT_INIT; } } else { int j = ut->id - 1; if ((ut->id < 1) || (ut->id >= sizeof(tmr_suites)/sizeof(CU_SuiteInfo))) { return GOS_ERR_NOTSUPPORT; } pSuite = CU_add_suite(tmr_suites[j].pName, tmr_suites[j].pInitFunc, tmr_suites[j].pCleanupFunc); for (i = 0; NULL != tmr_suites[ut->id-1].pTests[i].pName; i++) { CU_add_test(pSuite, tmr_suites[j].pTests[i].pName, tmr_suites[j].pTests[i].pTestFunc) ; } } CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); CU_cleanup_registry(); } return GOS_OK; }
int main(int argc, char *argv[]) { CU_ErrorCode error; /** * Definizione dei test array * NOTA ? L?ORDINE DI INSERIMENTO E? IMPORTANTE */ CU_TestInfo test_array_conta_parole_bis[] = { { "test di conta_parole_bis()", test_conta_parole_bis }, CU_TEST_INFO_NULL, }; /** * crea le suite e vi aggiunge i test array * NOTA ? L?ORDINE DI INSERIMENTO E? IMPORTANTE */ CU_SuiteInfo suites[] = { { "test suite per conta_parole_bis ", suite_void_init, suite_void_cleanup, test_array_conta_parole_bis }, CU_SUITE_INFO_NULL, }; /* inizializza registro ? e? la prima istruzione */ if (CUE_SUCCESS != CU_initialize_registry()) { error = CU_get_error(); system("PAUSE"); return -1; } // add the suites to the registry error = CU_register_suites(suites); if (CUE_SUCCESS != error) { CU_cleanup_registry(); error = CU_get_error(); system("PAUSE"); return -1; } /** * Esegue tutti i casi di test con output sulla console */ CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); /** * Pulisce il registro e termina lo unit test **/ CU_cleanup_registry(); //system("PAUSE"); return error; }
CU_SUITE_INFO_NULL }; static void contact_provider_add_tests(void) { CU_get_registry(); if (CU_is_test_running()) return; if (CUE_SUCCESS != CU_register_suites(contact_provider_suites))
void tests_load(void) { assert(NULL != CU_get_registry()); assert(!CU_is_test_running()); if (CU_register_suites(suites) != CUE_SUCCESS) { fprintf(stderr, "suite registration failed - %s\n", CU_get_error_msg()); exit(EXIT_FAILURE); } }
int ejecutarTests() { printf("Ejecutando tests\n"); CU_initialize_registry(); CU_register_suites(suites); CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); CU_cleanup_registry(); return CU_get_error(); }