46 #if !defined(FCT_INCLUDED__IMB) 47 #define FCT_INCLUDED__IMB 58 #if !defined(FCT_DEFAULT_LOGGER) 59 # define FCT_DEFAULT_LOGGER "standard" 62 #define FCT_VERSION_MAJOR 1 63 #define FCT_VERSION_MINOR 6 64 #define FCT_VERSION_MICRO 1 66 #define _FCT_QUOTEME(x) #x 67 #define FCT_QUOTEME(x) _FCT_QUOTEME(x) 69 #define FCT_VERSION_STR (FCT_QUOTEME(FCT_VERSION_MAJOR) "."\ 70 FCT_QUOTEME(FCT_VERSION_MINOR) "."\ 71 FCT_QUOTEME(FCT_VERSION_MICRO)) 82 #define FCT_MAX_NAME 256 83 #define FCT_MAX_LOG_LINE 2048 89 #define FCTMIN(x, y) ( x < y) ? (x) : (y) 91 #define FCT_ASSERT(expr) switch_assert(expr) 93 #if defined(__cplusplus) 94 #define FCT_EXTERN_C extern "C" 144 char const *condition,
151 char const *condition,
164 #define fct_unused(x) (void)(x) 169 #if defined(FCT_CONF_UNWIND) 170 # define _fct_cmt(string) {char*_=string;} 172 # define _fct_cmt(string) 183 #define FCT_PIPE_RESERVE_BYTES_DEFAULT 512 194 # define _fct_pipe(_PFDS_) \ 195 _pipe((_PFDS_), FCT_PIPE_RESERVE_BYTES_DEFAULT, _O_TEXT) 196 # define _fct_dup _dup 197 # define _fct_dup2 _dup2 198 # define _fct_close _close 199 # define _fct_read _read 201 # define STDOUT_FILENO 1 202 # define STDERR_FILENO 2 205 # define _fct_pipe pipe 206 # define _fct_dup dup 207 # define _fct_dup2 dup2 208 # define _fct_close close 209 # define _fct_read read 237 #define FCT_SWITCH_STDOUT_TO_BUFFER() \ 238 fct_switch_std_to_buffer(fct_stdout_pipe, stdout, STDOUT_FILENO, &fct_saved_stdout) 239 #define FCT_SWITCH_STDOUT_TO_STDOUT() \ 240 fct_switch_std_to_std(stdout, STDOUT_FILENO, fct_saved_stdout) 241 #define FCT_SWITCH_STDERR_TO_BUFFER() \ 242 fct_switch_std_to_buffer(fct_stderr_pipe, stderr, STDERR_FILENO, &fct_saved_stderr) 243 #define FCT_SWITCH_STDERR_TO_STDERR() \ 244 fct_switch_std_to_std(stderr, STDERR_FILENO, fct_saved_stderr) 255 #if defined(WIN32) && _MSC_VER >= 1400 256 strncpy_s(dst, num, src, _TRUNCATE);
258 strncpy(dst, src, num - 1);
274 #if defined(_MSC_VER) && (_MSC_VER < 1400) 275 count = _vsnprintf(buffer, buffer_len, format, args);
276 #elif defined(_MSC_VER) && (_MSC_VER >= 1400) 277 count = vsnprintf_s(buffer, buffer_len, _TRUNCATE, format, args);
279 count = vsnprintf(buffer, buffer_len, format, args);
291 va_start(args, format);
307 k = (
char*)malloc(
sizeof(
char)*klen+1);
326 k = (
char*)malloc(
sizeof(
char)*klen+1);
328 for ( i=0; i != klen; ++i )
330 k[i] = (char)tolower(s[i]);
344 char const *prefix_p;
345 char const *test_str_p;
351 if ( prefix == NULL || prefix[0] ==
'\0' )
358 for ( prefix_p = prefix, test_str_p = test_str;
359 *prefix_p !=
'\0' && *test_str_p !=
'\0';
360 ++prefix_p, ++test_str_p )
362 is_match = *prefix_p == *test_str_p;
373 if ( *test_str_p ==
'\0' && *prefix_p !=
'\0' )
395 if ( (s1 == NULL && s2 != NULL)
396 || (s1 != NULL && s2 == NULL) )
419 if ( (s1 == NULL && s2 != NULL)
420 || (s1 != NULL && s2 == NULL) )
424 while (tolower(*s1) == tolower(*s2))
443 static char const *blank_s =
"";
444 char const *found = NULL;
449 if ( check_incl == NULL )
451 check_incl = blank_s;
453 if ( str == check_incl )
457 found = strstr(str, check_incl);
458 return found != NULL;
484 if ( str == NULL && check == NULL )
488 else if ( ((str == NULL) && (check != NULL))
489 || ((str != NULL) && (check == NULL)) )
493 sp = strstr(str, check);
521 if ( str == NULL && check == NULL )
525 else if ( ((str == NULL) && (check != NULL))
526 || ((str != NULL) && (check == NULL)) )
530 check_i = strlen(check);
532 if ( str_i < check_i )
536 for ( ; check_i != 0; --check_i, --str_i)
538 if ( str[str_i] != check[check_i] )
553 if ( str == NULL && check == NULL )
557 else if ( ((str == NULL) && (check != NULL))
558 || ((str != NULL) && (check == NULL)) )
562 check_i = strlen(check);
564 if ( str_i < check_i )
568 for ( ; check_i != 0; --check_i, --str_i)
570 if ( tolower(str[str_i]) != tolower(check[check_i]) )
586 #define FCT_DOTTED_MAX_LEN 256 594 memset(line,
'.',
sizeof(
char)*maxwidth);
595 len = strlen(startwith);
596 line_len =
FCTMIN(maxwidth-1, len);
597 memcpy(line, startwith,
sizeof(
char)*line_len);
598 if ( len < maxwidth-1)
602 line[maxwidth-1] =
'\0';
610 printf(
" %s\n", endswith);
645 timer->
start = clock();
653 timer->
stop = clock();
674 #define FCT_LIST_GROWTH_FACTOR 2 678 #define FCT_LIST_DEFAULT_START_SZ 8 690 #define FCT_NLIST_FOREACH_BGN(Type, Var, List)\ 692 if ( List != NULL ) {\ 694 size_t num_items##Var = fct_nlist__size(List);\ 695 for( item_i##Var =0; item_i##Var != num_items##Var; ++item_i##Var )\ 697 Type Var = (Type) fct_nlist__at((List), item_i##Var); 699 #define FCT_NLIST_FOREACH_END() }}} 727 if ( on_del != NULL )
729 for ( itm_i__=0; itm_i__ != list->
used_itm_num; ++itm_i__ )
760 list->
itm_list = (
void**)malloc(
sizeof(
void*)*start_sz);
779 #define fct_nlist__init(_LIST_PTR_) \ 780 (fct_nlist__init2((_LIST_PTR_), FCT_LIST_DEFAULT_START_SZ)) 814 FCT_LIST_GROWTH_FACTOR;
857 #define fctchk__is_pass(_CHK_) ((_CHK_)->is_pass) 858 #define fctchk__file(_CHK_) ((_CHK_)->file) 859 #define fctchk__lineno(_CHK_) ((_CHK_)->lineno) 860 #define fctchk__cndtn(_CHK_) ((_CHK_)->cndtn) 861 #define fctchk__msg(_CHK_) ((_CHK_)->msg) 862 #define fctchk__name(_CHK_) ((_CHK_)->name) 892 if ( format != NULL )
943 #define fct_test__name(_TEST_) ((_TEST_)->name) 946 #define fct_test__clear_failed(test) \ 947 fct_nlist__clear(test->failed_chks, (fct_nlist_on_del_t)fctchk__del);\ 969 #ifndef __clang_analyzer__ 1126 #define fct_ts__is_setup_mode(ts) ((ts)->mode == ts_mode_setup) 1127 #define fct_ts__is_teardown_mode(ts) ((ts)->mode == ts_mode_teardown) 1128 #define fct_ts__is_test_mode(ts) ((ts)->mode == ts_mode_test) 1129 #define fct_ts__is_ending_mode(ts) ((ts)->mode == ts_mode_ending) 1130 #define fct_ts__is_end(ts) ((ts)->mode == ts_mode_end) 1131 #define fct_ts__is_cnt_mode(ts) ((ts)->mode == ts_mode_cnt) 1132 #define fct_ts__is_abort_mode(ts) ((ts)->mode == ts_mode_abort) 1136 #define fct_ts__ending(ts) ((ts)->mode = ts_mode_ending) 1139 #define fct_ts__end(ts) ((ts)->mode = ts_mode_end) 1141 #define fct_ts__name(ts) ((ts)->name) 1315 &&
"can't count number of tests executed until the test suite ends" 1406 #define FCTCL_INIT_NULL \ 1407 {NULL, NULL, FCTCL_STORE_UNDEFINED, NULL} 1423 #define FCTCL_TRUE_STR "1" 1443 #define fctcl_new() ((fctcl_t*)calloc(1, sizeof(fctcl_t))) 1467 if ( clone == NULL )
1472 if ( clo_init->
help == NULL )
1479 if ( clone->
help == NULL )
1526 if ( option == NULL )
1539 #define fctcl__set_value(_CLO_, _VAL_) \ 1540 (_CLO_)->value = fctstr_clone((_VAL_)); 1548 #define FCT_CLP_MAX_ERR_MSG_LEN 256 1605 if ( options != NULL )
1637 char *next_token =NULL;
1642 while ( argi < argc )
1649 #if defined(_MSC_VER) && _MSC_VER > 1300 1650 token = strtok_s(arg,
"=", &next_token);
1652 token = strtok(arg,
"=");
1653 next_token = strtok(NULL,
"=");
1666 if ( next_token != NULL && strlen(next_token) > 0 )
1679 "missing argument for %s",
1747 #define fct_clp__optval(_CLP_, _OPTION_) \ 1748 fct_clp__optval2((_CLP_), (_OPTION_), NULL) 1760 if ( clo == NULL || clo->
value == NULL)
1773 if ( clp == NULL || param == NULL )
1789 #define fct_clp__is_error(_CLP_) ((_CLP_)->is_error) 1790 #define fct_clp__get_error(_CLP_) ((_CLP_)->error_msg); 1792 #define fct_clp__num_clo(_CLP_) \ 1793 (fct_nlist__size(&((_CLP_)->clo_list))) 1795 #define fct_clp__param_cnt(_CLP_) \ 1796 (fct_nlist__size(&((_CLP_)->param_list))) 1800 #define fct_clp__param_at(_CLP_, _IDX_) \ 1801 ((char const*)fct_nlist__at(&((_CLP_)->param_list), (_IDX_))) 1806 #define fct_clp__is(_CLP_, _OPTION_) \ 1807 (fct_clp__optval((_CLP_), (_OPTION_)) != NULL) 1844 FCT_ASSERT( ns != NULL &&
"invalid argument!");
1897 #define FCT_OPT_VERSION "--version" 1898 #define FCT_OPT_VERSION_SHORT "-v" 1899 #define FCT_OPT_HELP "--help" 1900 #define FCT_OPT_HELP_SHORT "-h" 1901 #define FCT_OPT_LOGGER "--logger" 1902 #define FCT_OPT_LOGGER_SHORT "-l" 1912 "Displays the FCTX version number and exits." 1942 "the basic fctx logger" 1947 "the least amount of logging information." 1952 "junit compatible xml" 1959 #define fctkern__filter_cnt(_NK_) (fct_nlist__size(&((_NK_)->prefix_list))) 1966 FCT_ASSERT(logger_owns != NULL &&
"invalid arg");
1975 fprintf(out,
"test.exe [options] prefix_filter ...\n\n");
1978 if ( clo->short_opt != NULL )
1980 fprintf(out,
"%s, %s\n", clo->short_opt, clo->long_opt);
1984 fprintf(out,
"%s\n", clo->long_opt);
1989 fprintf(out,
" %s\n", clo->help);
1998 fputs(
" Sets the logger. The types of loggers currently " 1999 "available are,\n", out);
2000 for (type_i =0; type_i != 2; ++type_i )
2002 for ( itr=types[type_i]; itr && itr->
name != NULL; ++itr )
2004 fprintf(out,
" =%s : %s\n", itr->
name, itr->
desc);
2023 size_t filter_len =0;
2025 FCT_ASSERT( prefix_filter != NULL &&
"invalid arg" );
2026 FCT_ASSERT( strlen(prefix_filter) > 0 &&
"invalid arg" );
2029 filter_len = strlen(prefix_filter);
2030 filter = (
char*)malloc(
sizeof(
char)*(filter_len+1));
2053 #define fctkern__cl_is_parsed(_NK_) ((_NK_)->cl_is_parsed) 2060 return opt_str[0] !=
'\0' 2090 for ( iter = search; iter->
name != NULL; ++iter)
2104 char const *sel_logger =NULL;
2107 FCT_ASSERT(sel_logger != NULL &&
"should never be NULL");
2110 if ( nk->
lt_usr != NULL )
2114 if ( nk->
lt_sys != NULL && logger == NULL )
2118 if ( logger == NULL )
2121 fprintf(stderr,
"error: unknown logger selected - '%s'", sel_logger);
2138 size_t num_params =0;
2164 fprintf(stderr,
"error: %s", err);
2169 for ( param_i =0; param_i != num_params; ++param_i )
2205 if ( argc == 0 && argv == NULL )
2246 size_t prefix_list_size =0;
2252 if ( prefix_list_size == 0 )
2259 for ( prefix_i = 0; prefix_i != prefix_list_size; ++prefix_i )
2310 #define fctkern__tst_cnt_failed(nk) \ 2311 (fctkern__tst_cnt(nk) - fctkern__tst_cnt_passed(nk)) 2315 #if defined(FCT_USE_TEST_COUNT) 2333 #define fctkern__end(nk) 2444 #define fctkern__log_start(_NK_) \ 2446 FCT_NLIST_FOREACH_BGN(fct_logger_i*, logger, &((_NK_)->logger_list))\ 2448 fct_logger__on_fctx_start(logger, (_NK_));\ 2450 FCT_NLIST_FOREACH_END();\ 2454 #define fctkern__log_end(_NK_) \ 2456 FCT_NLIST_FOREACH_BGN(fct_logger_i*, logger, &((_NK_)->logger_list))\ 2458 fct_logger__on_fctx_end(logger, (_NK_));\ 2460 FCT_NLIST_FOREACH_END();\ 2504 void (*on_test_start)(
2509 void (*on_test_end)(
2514 void (*on_test_suite_start)(
2519 void (*on_test_suite_end)(
2524 void (*on_fctx_start)(
2529 void (*on_fctx_end)(
2546 void (*on_test_suite_skip)(
2551 void (*on_test_skip)(
2557 #define _fct_logger_head \ 2558 fct_logger_i_vtable_t vtable; \ 2559 fct_logger_evt_t evt 2599 &fct_logger_default_vtable,
2610 logger->vtable.on_delete(logger, &(logger->evt));
2618 logger->evt.test = test;
2619 logger->vtable.on_test_start(logger, &(logger->evt));
2626 logger->evt.test = test;
2627 logger->vtable.on_test_end(logger, &(logger->evt));
2634 logger->evt.ts = ts;
2635 logger->vtable.on_test_suite_start(logger, &(logger->evt));
2642 logger->evt.ts = ts;
2643 logger->vtable.on_test_suite_end(logger, &(logger->evt));
2650 char const *condition,
2654 logger->evt.cndtn = condition;
2655 logger->evt.name =
name;
2656 logger->vtable.on_test_suite_skip(logger, &(logger->evt));
2663 char const *condition,
2667 logger->evt.cndtn = condition;
2668 logger->evt.name =
name;
2669 logger->vtable.on_test_skip(logger, &(logger->evt));
2676 logger->evt.chk = chk;
2677 logger->vtable.on_chk(logger, &(logger->evt));
2681 #define fct_logger__on_fctx_start(LOGGER, KERN) \ 2682 (LOGGER)->evt.kern = (KERN);\ 2683 (LOGGER)->vtable.on_fctx_start((LOGGER), &((LOGGER)->evt)); 2687 #define fct_logger__on_fctx_end(LOGGER, KERN) \ 2688 (LOGGER)->evt.kern = (KERN);\ 2689 (LOGGER)->vtable.on_fctx_end((LOGGER), &((LOGGER)->evt)); 2695 logger->evt.msg = msg;
2696 logger->vtable.on_warn(logger, &(logger->evt));
2708 memcpy(dup_chk, chk,
sizeof(*dup_chk));
2717 const char *last_test = NULL;
2719 "\n----------------------------------------------------------------------------\n" 2721 puts(
"FAILED TESTS\n");
2724 if (!last_test || strcmp(last_test,
fctchk__name(chk))) {
2728 printf(
" %s(%d):\n %s\n",
2847 #define FCT_STANDARD_LOGGER_MAX_LINE 68 2862 printf(
"\nTEST FAIL: %s(%d): %s\n",
2877 char const *condition = e->
cndtn;
2879 char msg[256] = {
'\0'};
2882 fct_snprintf(msg,
sizeof(msg),
"%s (%s)", name, condition);
2883 msg[
sizeof(msg)-1] =
'\0';
2936 double elasped_time =0;
2937 size_t num_tests =0;
2938 size_t num_passed =0;
2949 "\n----------------------------------------------------------------------------\n" 2954 "%s (%lu/%lu tests",
2955 (is_success) ?
"PASSED" :
"FAILED",
2956 (
unsigned long) num_passed,
2957 (
unsigned long) num_tests
2960 if ( elasped_time > 0.0000001 )
2962 printf(
" in %.6fs)\n", elasped_time);
2993 (void)printf(
"WARNING: %s", e->
msg);
3003 if ( logger == NULL )
3057 double elasped_time = 0;
3058 char std_buffer[1024];
3070 printf(
"\t<testsuite errors=\"%lu\" failures=\"0\" tests=\"%lu\" " 3071 "name=\"%s\" time=\"%.4f\">\n",
3085 printf(
"\t\t<testcase name=\"%s\" time=\"%.3f\"",
3092 printf(
"\t\t<testcase name=\"%s\" time=\"%.3f\">\n",
3101 printf(
"\t\t\t<error message=\"%s\" " 3102 "type=\"fctx\">", chk->msg);
3103 printf(
"file:%s, line:%d", chk->file, chk->lineno);
3104 printf(
"</error>\n");
3115 printf(
"\t\t</testcase>\n");
3122 printf(
"\t\t<system-out>\n\t\t\t<![CDATA[");
3130 printf(
"%.*s", read_length, std_buffer);
3132 printf(
"]]>\n\t\t</system-out>\n");
3135 printf(
"\t\t<system-err>\n\t\t\t<![CDATA[");
3143 printf(
"%.*s", read_length, std_buffer);
3145 printf(
"]]>\n\t\t</system-err>\n");
3148 printf(
"\t</testsuite>\n");
3159 printf(
"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
3160 printf(
"<testsuites>\n");
3171 printf(
"</testsuites>\n");
3192 if ( logger == NULL )
3217 #define FCT_REFERENCE_FUNCS() \ 3219 int check = 0 && fctstr_ieq(NULL, NULL);\ 3221 _fct_cmt("not to be executed");\ 3222 (void)_fct_chk_empty_str(NULL);\ 3223 (void)_fct_chk_full_str(NULL);\ 3224 (void)fct_test__start_timer(NULL);\ 3225 (void)fct_test__stop_timer(NULL);\ 3226 (void)fct_ts_new(NULL);\ 3227 (void)fct_ts__test_begin(NULL);\ 3228 (void)fct_ts__add_test(NULL, NULL);\ 3229 (void)fct_ts__test_end(NULL);\ 3230 (void)fct_ts__inc_total_test_num(NULL);\ 3231 (void)fct_ts__make_abort_test(NULL);\ 3232 (void)fct_ts__setup_abort(NULL);\ 3233 (void)fct_ts__setup_end(NULL);\ 3234 (void)fct_ts__teardown_end(NULL);\ 3235 (void)fct_ts__cnt_end(NULL);\ 3236 (void)fct_ts__is_test_cnt(NULL, 0);\ 3237 (void)fct_xchk_fn(0, "");\ 3238 (void)fct_xchk2_fn(NULL, 0, "");\ 3239 (void)fctkern__cl_parse(NULL);\ 3240 (void)fctkern__add_ts(NULL, NULL);\ 3241 (void)fctkern__pass_filter(NULL, NULL);\ 3242 (void)fctkern__log_suite_start(NULL, NULL);\ 3243 (void)fctkern__log_suite_end(NULL, NULL);\ 3244 (void)fctkern__log_test_skip(NULL, NULL, NULL);\ 3245 (void)fctkern__log_test_start(NULL, NULL);\ 3246 (void)fctkern__log_test_end(NULL, NULL);\ 3247 (void)fctstr_endswith(NULL,NULL);\ 3248 (void)fctstr_iendswith(NULL,NULL);\ 3249 (void)fctstr_ieq(NULL,NULL);\ 3250 (void)fctstr_incl(NULL, NULL);\ 3251 (void)fctstr_iincl(NULL, NULL);\ 3252 (void)fctstr_iendswith(NULL,NULL);\ 3253 (void)fctstr_istartswith(NULL,NULL);\ 3254 (void)fctstr_clone_lower(NULL);\ 3255 (void)fctstr_startswith(NULL,NULL);\ 3256 (void)fctkern__init(NULL, 0, NULL);\ 3257 (void)fctkern__cl_is(NULL, "");\ 3258 (void)fctkern__cl_val2(NULL, NULL, NULL);\ 3259 fctkern__log_suite_skip(NULL, NULL, NULL);\ 3260 (void)fct_clp__is_param(NULL,NULL);\ 3261 _fct_cmt("should never construct an object");\ 3262 (void)fct_test_new(NULL);\ 3263 (void)fct_ts__chk_cnt(NULL);\ 3268 #define FCT_INIT(_ARGC_, _ARGV_) \ 3269 fctkern_t fctkern__; \ 3270 fctkern_t* fctkern_ptr__ = &fctkern__; \ 3271 FCT_REFERENCE_FUNCS(); \ 3272 if ( !fctkern__init(fctkern_ptr__, (_ARGC_), (const char **)(_ARGV_)) ) {\ 3274 stderr, "FATAL ERROR: Unable to initialize FCTX Kernel." \ 3276 exit(EXIT_FAILURE); \ 3280 #define FCT_FINAL() \ 3281 fctkern_ptr__->ns.num_total_failed = fctkern__tst_cnt_failed( \ 3284 fctkern__log_end(fctkern_ptr__); \ 3285 fctkern__end(fctkern_ptr__); \ 3286 fctkern__final(fctkern_ptr__); \ 3287 FCT_ASSERT( !((int)fctkern_ptr__->ns.num_total_failed < 0) \ 3288 && "or we got truncated!"); \ 3289 if ( fctkern_ptr__->ns.num_total_failed == \ 3290 fctkern_ptr__->num_expected_failures) { \ 3291 fctkern_ptr__->ns.num_total_failed = 0; \ 3296 #define FCT_NUM_FAILED() \ 3297 fctkern_ptr__->ns.num_total_failed \ 3304 #define FCT_EXPECTED_FAILURES(_NUM_FAILS_) \ 3305 ((fctkern_ptr__->num_expected_failures = (_NUM_FAILS_))) 3308 #define FCT_BGN_FN(_FNNAME_) \ 3309 int _FNNAME_(int argc, char* argv[])\ 3311 FCT_INIT(argc, argv) 3313 #define FCT_END_FN() FCT_END() 3318 #define FCT_BGN() FCT_BGN_FN(main) 3322 #ifndef __INTEL_COMPILER 3323 # define FCT_END_WARNINGFIX_BGN 3324 # define FCT_END_WARNINGFIX_END 3326 # define FCT_END_WARNINGFIX_BGN _Pragma("warning(push,disable:981)"); 3327 # define FCT_END_WARNINGFIX_END _Pragma("warning(pop)"); 3335 FCT_END_WARNINGFIX_BGN \ 3337 return (int) FCT_NUM_FAILED();\ 3338 FCT_END_WARNINGFIX_END \ 3342 #define fctlog_install(_CUST_LOGGER_LIST_) \ 3343 fctkern_ptr__->lt_usr = (_CUST_LOGGER_LIST_) 3347 #define fctcl_install(_CLO_INIT_) \ 3349 fctkern_ptr__->cl_user_opts = (_CLO_INIT_);\ 3350 _fct_cmt("Delay parse in order to allow for user customization.");\ 3351 if ( !fctkern__cl_is_parsed((fctkern_ptr__)) ) {\ 3352 int status = fctkern__cl_parse((fctkern_ptr__));\ 3353 _fct_cmt("Need to parse command line before we start logger.");\ 3354 fctkern__log_start((fctkern_ptr__));\ 3358 fctkern__final(fctkern_ptr__);\ 3359 exit( (status == 0) ? (EXIT_FAILURE) : (EXIT_SUCCESS) );\ 3368 #define fctcl_is(_OPT_STR_) (fctkern__cl_is(fctkern_ptr__, (_OPT_STR_))) 3370 #define fctcl_val(_OPT_STR_) (fctcl_val2((_OPT_STR_), NULL)) 3372 #define fctcl_val2(_OPT_STR_, _DEF_STR_) \ 3373 (fctkern__cl_val2(fctkern_ptr__, (_OPT_STR_), (_DEF_STR_))) 3379 #define FCT_FIXTURE_SUITE_BGN(_NAME_) \ 3381 fctkern_ptr__->ns.ts_curr = fct_ts_new( #_NAME_ );\ 3382 _fct_cmt("Delay parse in order to allow for user customization.");\ 3383 if ( !fctkern__cl_is_parsed((fctkern_ptr__)) ) {\ 3384 int status = fctkern__cl_parse((fctkern_ptr__));\ 3385 _fct_cmt("Need to parse command line before we start logger.");\ 3386 fctkern__log_start((fctkern_ptr__));\ 3390 fct_ts__del((fctkern_ptr__->ns.ts_curr));\ 3391 fctkern__final(fctkern_ptr__);\ 3392 exit( (status == 0) ? (EXIT_FAILURE) : (EXIT_SUCCESS) );\ 3398 if ( fctkern_ptr__->ns.ts_curr == NULL ) {\ 3399 fctkern__log_warn((fctkern_ptr__), "out of memory");\ 3403 fctkern__log_suite_start((fctkern_ptr__), fctkern_ptr__->ns.ts_curr);\ 3406 fctkern_ptr__->ns.test_num = -1;\ 3407 if ( fct_ts__is_ending_mode(fctkern_ptr__->ns.ts_curr) \ 3408 || fct_ts__is_abort_mode(fctkern_ptr__->ns.ts_curr) )\ 3410 _fct_cmt("flag the test suite as complete.");\ 3411 fct_ts__end(fctkern_ptr__->ns.ts_curr);\ 3418 #define FCT_FIXTURE_SUITE_END() \ 3419 if ( fct_ts__is_cnt_mode(fctkern_ptr__->ns.ts_curr) )\ 3421 fct_ts__cnt_end(fctkern_ptr__->ns.ts_curr);\ 3424 fctkern__add_ts((fctkern_ptr__), fctkern_ptr__->ns.ts_curr);\ 3425 fctkern__log_suite_end((fctkern_ptr__), fctkern_ptr__->ns.ts_curr);\ 3426 fct_ts__end(fctkern_ptr__->ns.ts_curr);\ 3427 fctkern_ptr__->ns.ts_curr = NULL;\ 3431 #define FCT_FIXTURE_SUITE_BGN_IF(_CONDITION_, _NAME_) \ 3432 fctkern_ptr__->ns.ts_is_skip_suite = !(_CONDITION_);\ 3433 fctkern_ptr__->ns.ts_skip_cndtn = #_CONDITION_;\ 3434 if ( fctkern_ptr__->ns.ts_is_skip_suite ) {\ 3435 fctkern__log_suite_skip((fctkern_ptr__), #_CONDITION_, #_NAME_);\ 3437 FCT_FIXTURE_SUITE_BGN(_NAME_); 3439 #define FCT_FIXTURE_SUITE_END_IF() \ 3440 FCT_FIXTURE_SUITE_END();\ 3441 fctkern_ptr__->ns.ts_is_skip_suite =0;\ 3442 fctkern_ptr__->ns.ts_skip_cndtn =NULL;\ 3444 #define FCT_SETUP_BGN()\ 3445 if ( fct_ts__is_setup_mode(fctkern_ptr__->ns.ts_curr) ) { 3447 #define FCT_SETUP_END() \ 3448 fct_ts__setup_end(fctkern_ptr__->ns.ts_curr); } 3450 #define FCT_TEARDOWN_BGN() \ 3451 if ( fct_ts__is_teardown_mode(fctkern_ptr__->ns.ts_curr) ) {\ 3453 #define FCT_TEARDOWN_END() \ 3454 fct_ts__teardown_end(fctkern_ptr__->ns.ts_curr); \ 3460 #define FCT_SUITE_BGN(Name) \ 3461 FCT_FIXTURE_SUITE_BGN(Name) {\ 3462 FCT_SETUP_BGN() {_fct_cmt("stubbed"); } FCT_SETUP_END()\ 3463 FCT_TEARDOWN_BGN() {_fct_cmt("stubbed");} FCT_TEARDOWN_END()\ 3465 #define FCT_SUITE_END() } FCT_FIXTURE_SUITE_END() 3467 #define FCT_SUITE_BGN_IF(_CONDITION_, _NAME_) \ 3468 FCT_FIXTURE_SUITE_BGN_IF(_CONDITION_, (_NAME_)) {\ 3469 FCT_SETUP_BGN() {_fct_cmt("stubbed"); } FCT_SETUP_END()\ 3470 FCT_TEARDOWN_BGN() {_fct_cmt("stubbed");} FCT_TEARDOWN_END()\ 3472 #define FCT_SUITE_END_IF() } FCT_FIXTURE_SUITE_END_IF() 3481 #define FCT_TEST_BGN_IF(_CONDITION_, _NAME_) { \ 3482 fctkern_ptr__->ns.test_is_skip = !(_CONDITION_);\ 3483 fctkern_ptr__->ns.test_skip_cndtn = #_CONDITION_;\ 3484 FCT_TEST_BGN(_NAME_) {\ 3486 #define FCT_TEST_END_IF() \ 3488 fctkern_ptr__->ns.test_is_skip = 0;\ 3489 fctkern_ptr__->ns.test_skip_cndtn = NULL;\ 3499 #define FCT_TEST_BGN(_NAME_) \ 3501 fctkern_ptr__->ns.curr_test_name = #_NAME_;\ 3502 ++(fctkern_ptr__->ns.test_num);\ 3503 if ( fct_ts__is_cnt_mode(fctkern_ptr__->ns.ts_curr) )\ 3505 fct_ts__inc_total_test_num(fctkern_ptr__->ns.ts_curr);\ 3507 else if ( fct_ts__is_test_mode(fctkern_ptr__->ns.ts_curr) \ 3508 && fct_ts__is_test_cnt(fctkern_ptr__->ns.ts_curr, fctkern_ptr__->ns.test_num) )\ 3510 fct_ts__test_begin(fctkern_ptr__->ns.ts_curr);\ 3511 if ( fctkern__pass_filter(fctkern_ptr__, fctkern_ptr__->ns.curr_test_name ) )\ 3513 fctkern_ptr__->ns.curr_test = fct_test_new( fctkern_ptr__->ns.curr_test_name );\ 3514 if ( fctkern_ptr__->ns.curr_test == NULL ) {\ 3515 fctkern__log_warn(fctkern_ptr__, "out of memory");\ 3516 } else if ( fctkern_ptr__->ns.ts_is_skip_suite \ 3517 || fctkern_ptr__->ns.test_is_skip ) {\ 3518 fct_ts__test_begin(fctkern_ptr__->ns.ts_curr);\ 3519 fctkern__log_test_skip(\ 3521 fctkern_ptr__->ns.curr_test_name,\ 3522 (fctkern_ptr__->ns.test_is_skip) ?\ 3523 (fctkern_ptr__->ns.test_skip_cndtn) :\ 3524 (fctkern_ptr__->ns.ts_skip_cndtn)\ 3526 fct_ts__test_end(fctkern_ptr__->ns.ts_curr);\ 3529 fctkern__log_test_start(fctkern_ptr__, fctkern_ptr__->ns.curr_test);\ 3530 fct_test__start_timer(fctkern_ptr__->ns.curr_test);\ 3537 #define FCT_TEST_END() \ 3540 fct_test__stop_timer(fctkern_ptr__->ns.curr_test);\ 3542 fct_ts__add_test(fctkern_ptr__->ns.ts_curr, fctkern_ptr__->ns.curr_test);\ 3543 fctkern__log_test_end(fctkern_ptr__, fctkern_ptr__->ns.curr_test);\ 3545 fct_ts__test_end(fctkern_ptr__->ns.ts_curr);\ 3578 char const *condition,
3606 fct_xchk_test =NULL;
3607 fct_xchk_kern =NULL;
3617 va_start(args, format);
3629 va_start(args, format);
3643 #define fct_xchk fct_xchk_kern = fctkern_ptr__,\ 3644 fct_xchk_test = fctkern_ptr__->ns.curr_test,\ 3645 fct_xchk_lineno =__LINE__,\ 3646 fct_xchk_file=__FILE__,\ 3649 #define fct_xchk2 fct_xchk_kern = fctkern_ptr__,\ 3650 fct_xchk_test = fctkern_ptr__->ns.curr_test,\ 3651 fct_xchk_lineno =__LINE__,\ 3652 fct_xchk_file=__FILE__,\ 3658 #define fct_chk(_CNDTN_) (fct_xchk((_CNDTN_) ? 1 : 0, #_CNDTN_)) 3660 #define _fct_req(_CNDTN_) \ 3661 if ( !(fct_xchk((_CNDTN_) ? 1 : 0, #_CNDTN_)) ) { break; } 3666 #define fct_req(_CNDTN_) \ 3667 if ( fct_ts__is_test_mode(fctkern_ptr__->ns.ts_curr) ) { \ 3668 _fct_req((_CNDTN_)); \ 3670 else if ( fct_ts__is_setup_mode(fctkern_ptr__->ns.ts_curr) \ 3671 || fct_ts__is_teardown_mode(fctkern_ptr__->ns.ts_curr) ) { \ 3672 fctkern_ptr__->ns.curr_test = fct_ts__make_abort_test( \ 3673 fctkern_ptr__->ns.ts_curr \ 3675 if ( !(fct_xchk((_CNDTN_) ? 1 : 0, #_CNDTN_)) ) { \ 3676 fct_ts__setup_abort(fctkern_ptr__->ns.ts_curr); \ 3678 fctkern_ptr__->ns.ts_curr, fctkern_ptr__->ns.curr_test \ 3681 fct_test__del(fctkern_ptr__->ns.curr_test); \ 3682 fctkern_ptr__->ns.curr_test = NULL; \ 3685 switch_assert("invalid condition for fct_req!"); \ 3686 _fct_req((_CNDTN_)); \ 3690 #define fct_chk_eq_dbl(V1, V2) \ 3692 ((int)(fabs((V1)-(V2)) < DBL_EPSILON)),\ 3693 "chk_eq_dbl: %f != %f",\ 3699 #define fct_chk_neq_dbl(V1, V2) \ 3701 ((int)(fabs((V1)-(V2)) >= DBL_EPSILON)),\ 3702 "chk_neq_dbl: %f == %f",\ 3708 #define fct_chk_eq_str(V1, V2) \ 3709 fct_xchk(fctstr_eq((V1), (V2)),\ 3710 "chk_eq_str: '%s' != '%s'",\ 3716 #define fct_chk_neq_str(V1, V2) \ 3717 fct_xchk(!fctstr_eq((V1), (V2)),\ 3718 "chk_neq_str: '%s' == '%s'",\ 3733 return strlen(s) ==0;
3742 return strlen(s) >0;
3746 #define fct_chk_empty_str(V) \ 3747 fct_xchk(_fct_chk_empty_str((V)),\ 3748 "string not empty: '%s'",\ 3752 #define fct_chk_full_str(V) \ 3753 fct_xchk(_fct_chk_full_str((V)),\ 3754 "string is full: '%s'",\ 3759 #define fct_chk_eq_istr(V1, V2) \ 3760 fct_xchk(fctstr_ieq((V1), (V2)),\ 3761 "chk_eq_str: '%s' != '%s'",\ 3767 #define fct_chk_neq_istr(V1, V2) \ 3768 fct_xchk(!fctstr_ieq((V1), (V2)),\ 3769 "chk_neq_str: '%s' == '%s'",\ 3775 #define fct_chk_endswith_str(STR, CHECK)\ 3776 fct_xchk(fctstr_endswith((STR),(CHECK)),\ 3777 "fct_chk_endswith_str: '%s' doesn't end with '%s'",\ 3783 #define fct_chk_iendswith_str(STR, CHECK)\ 3784 fct_xchk(fctstr_iendswith((STR), (CHECK)),\ 3785 "fch_chk_iendswith_str: '%s' doesn't end with '%s'.",\ 3790 #define fct_chk_excl_str(STR, CHECK_EXCLUDE) \ 3791 fct_xchk(!fctstr_incl((STR), (CHECK_EXCLUDE)),\ 3792 "fct_chk_excl_str: '%s' is included in '%s'",\ 3797 #define fct_chk_excl_istr(ISTR, ICHECK_EXCLUDE) \ 3798 fct_xchk(!fctstr_iincl((ISTR), (ICHECK_EXCLUDE)),\ 3799 "fct_chk_excl_istr (case insensitive): '%s' is "\ 3805 #define fct_chk_incl_str(STR, CHECK_INCLUDE) \ 3806 fct_xchk(fctstr_incl((STR), (CHECK_INCLUDE)),\ 3807 "fct_chk_incl_str: '%s' does not include '%s'",\ 3813 #define fct_chk_incl_istr(ISTR, ICHECK_INCLUDE) \ 3814 fct_xchk(fctstr_iincl((ISTR), (ICHECK_INCLUDE)),\ 3815 "fct_chk_incl_istr (case insensitive): '%s' does "\ 3816 "not include '%s'",\ 3822 #define fct_chk_startswith_str(STR, CHECK)\ 3823 fct_xchk(fctstr_startswith((STR), (CHECK)),\ 3824 "'%s' does not start with '%s'",\ 3830 #define fct_chk_startswith_istr(STR, CHECK)\ 3831 fct_xchk(fctstr_istartswith((STR), (CHECK)),\ 3832 "case insensitive check: '%s' does not start with '%s'",\ 3837 #define fct_chk_eq_int(V1, V2) \ 3840 "chq_eq_int: %d != %d",\ 3846 #define fct_chk_neq_int(V1, V2) \ 3849 "chq_neq_int: %d == %d",\ 3854 #define fct_chk_ex(EXCEPTION, CODE) \ 3856 bool pass_chk_ex = false; \ 3859 pass_chk_ex = false; \ 3860 } catch ( EXCEPTION ) { \ 3861 pass_chk_ex = true; \ 3863 pass_chk_ex = false; \ 3867 "%s exception not generated", \ 3883 #define _FCT_GUTCHK(_CNDTN_) \ 3884 if ( !(_CNDTN_) ) {\ 3885 fprintf(stderr, "gutchk fail: '" #_CNDTN_ "' was not true.\n");\ 3889 fprintf(stdout, "gutchk pass: '" #_CNDTN_ "'\n");\ 3912 #define FCTMF_FIXTURE_SUITE_BGN(NAME) \ 3913 void NAME (fctkern_t *fctkern_ptr__) {\ 3914 FCT_REFERENCE_FUNCS();\ 3915 FCT_FIXTURE_SUITE_BGN( NAME ) { 3917 #define FCTMF_FIXTURE_SUITE_END() \ 3918 } FCT_FIXTURE_SUITE_END();\ 3921 #define FCTMF_SUITE_BGN(NAME) \ 3922 void NAME (fctkern_t *fctkern_ptr__) {\ 3923 FCT_REFERENCE_FUNCS();\ 3924 FCT_SUITE_BGN( NAME ) { 3925 #define FCTMF_SUITE_END() \ 3926 } FCT_SUITE_END(); \ 3931 #define FCTMF_SUITE_DEF(NAME) 3935 #define FCTMF_SUITE_CALL(NAME) {\ 3936 void NAME (fctkern_t *);\ 3937 NAME (fctkern_ptr__);\ 3951 #define FCT_QTEST_BGN(NAME) \ 3952 FCT_SUITE_BGN(NAME) {\ 3953 FCT_TEST_BGN(NAME) {\ 3955 #define FCT_QTEST_END() \ 3960 #define FCT_QTEST_BGN_IF(_CONDITION_, _NAME_) \ 3961 FCT_SUITE_BGN(_NAME_) {\ 3962 FCT_TEST_BGN_IF(_CONDITION_, _NAME_) {\ 3964 #define FCT_QTEST_END_IF() \ 3965 } FCT_TEST_END_IF();\
static fct_test_t * fct_xchk_test
static void fct_timer__stop(fct_timer_t *timer)
static int fct_clp__is_param(fct_clp_t *clp, char const *param)
static fct_test_t * fct_ts__make_abort_test(fct_ts_t *ts)
static void fct_ts__del(fct_ts_t *ts)
#define FCT_SWITCH_STDOUT_TO_STDOUT()
struct _fctcl_init_t fctcl_init_t
void(* fct_nlist_on_del_t)(void *)
#define fctchk__name(_CHK_)
static void fctkern__log_suite_start(fctkern_t *nk, fct_ts_t const *ts)
#define FCT_OPT_LOGGER_SHORT
static void fct_standard_logger__on_warn(fct_logger_i *logger_, fct_logger_evt_t const *e)
static int fct_clp__init(fct_clp_t *clp, fctcl_init_t const *options)
static size_t fct_nlist__size(fct_nlist_t const *list)
fctcl_init_t const * cl_user_opts
static fctcl_t const * fct_clp__get_clo(fct_clp_t const *clp, char const *option)
static void fctkern__add_ts(fctkern_t *nk, fct_ts_t *ts)
static void fctchk__del(fctchk_t *chk)
static void fct_logger__init(fct_logger_i *logger)
static void fct_ts__setup_abort(fct_ts_t *ts)
static void fct_namespace_init(fct_namespace_t *ns)
fct_nlist_t failed_cndtns_list
static void fct_standard_logger__on_fctx_start(fct_logger_i *logger_, fct_logger_evt_t const *e)
static void fct_timer__start(fct_timer_t *timer)
#define fct_ts__is_end(ts)
static int fct_xchk_fn(int is_pass, char const *format,...)
static void fct_test__add(fct_test_t *test, fctchk_t *chk)
static void fct_logger__on_chk(fct_logger_i *self, fctchk_t const *chk)
static void fct_ts__inc_total_test_num(fct_ts_t *ts)
static void fct_standard_logger__on_chk(fct_logger_i *logger_, fct_logger_evt_t const *e)
static int fctcl__is_option(fctcl_t const *clo, char const *option)
#define fctkern__filter_cnt(_NK_)
static void fct_test__stop_timer(fct_test_t *test)
static nbool_t fct_filter_pass(char const *prefix, char const *test_str)
static nbool_t fctkern__pass_filter(fctkern_t *nk, char const *test_name)
static double fct_timer__duration(fct_timer_t const *timer)
static size_t fct_ts__chk_cnt(fct_ts_t const *ts)
static void fct_minimal_logger__on_fctx_end(fct_logger_i *self_, fct_logger_evt_t const *e)
static void fctkern__add_logger(fctkern_t *nk, fct_logger_i *logger_owns)
#define fctcl__set_value(_CLO_, _VAL_)
static int fct_snprintf(char *buffer, size_t buffer_len, char const *format,...)
char error_msg[FCT_CLP_MAX_ERR_MSG_LEN]
#define fct_clp__param_at(_CLP_, _IDX_)
static void fct_test__del(fct_test_t *test)
static void fct_ts__cnt_end(fct_ts_t *ts)
fct_logger_new_fn logger_new_fn
static void fct_logger__on_test_start(fct_logger_i *logger, fct_test_t const *test)
char const int const cJSON_bool format
#define FCT_STANDARD_LOGGER_MAX_LINE
#define FCT_NLIST_FOREACH_END()
static void fctcl__del(fctcl_t *clo)
#define fct_clp__param_cnt(_CLP_)
char const * ts_skip_cndtn
static void fct_standard_logger__on_test_start(fct_logger_i *logger_, fct_logger_evt_t const *e)
char cndtn[FCT_MAX_LOG_LINE]
static void fct_logger__on_test_suite_end(fct_logger_i *logger, fct_ts_t const *ts)
static void fctkern__log_test_start(fctkern_t *nk, fct_test_t const *test)
#define FCT_SWITCH_STDERR_TO_STDERR()
static void fct_clp__final(fct_clp_t *clp)
static double fct_test__duration(fct_test_t const *test)
static void fct_junit_logger__on_test_suite_end(fct_logger_i *logger_, fct_logger_evt_t const *e)
static void fct_logger_print_failures(fct_nlist_t const *fail_list)
static void fct_minimal_logger__on_delete(fct_logger_i *self_, fct_logger_evt_t const *e)
static char * fctstr_clone(char const *s)
char const * curr_test_name
static void fct_nlist__final(fct_nlist_t *list, fct_nlist_on_del_t on_del)
static int fct_nlist__init2(fct_nlist_t *list, size_t start_sz)
#define FCT_OPT_HELP_SHORT
static void fct_standard_logger__on_test_end(fct_logger_i *logger_, fct_logger_evt_t const *e)
static int fctstr_iincl(char const *str, char const *check_incl)
static void fctkern__final(fctkern_t *nk)
static void fct_test__start_timer(fct_test_t *test)
static int fct_xchk_lineno
static switch_bool_t is_option(const char *p)
static nbool_t fct_ts__is_more_tests(fct_ts_t const *ts)
static fct_logger_types_t FCT_LOGGER_TYPES[]
static size_t fctkern__tst_cnt_passed(fctkern_t const *nk)
static fctkern_t * fct_xchk_kern
fct_nlist_t failed_cndtns_list
static int fct_xchk2_fn(const char *condition, int is_pass, char const *format,...)
static int _fct_xchk_fn_varg(char const *condition, int is_pass, char const *format, va_list args)
static void fctkern__log_warn(fctkern_t *nk, char const *warn)
static void fct_ts__teardown_end(fct_ts_t *ts)
#define fct_clp__is_error(_CLP_)
static void fctkern__log_chk(fctkern_t *nk, fctchk_t const *chk)
static fctchk_t * fctchk_new(int is_pass, char const *cndtn, char const *name, char const *file, int lineno, char const *format, va_list args)
static void fct_logger__del(fct_logger_i *logger)
static void fct_ts__setup_end(fct_ts_t *ts)
struct _fct_clp_t fct_clp_t
static size_t fct_ts__tst_cnt(fct_ts_t const *ts)
static fct_junit_logger_t * fct_junit_logger_new(void)
static void fctkern__log_suite_end(fctkern_t *nk, fct_ts_t const *ts)
static void fct_logger__on_test_suite_start(fct_logger_i *logger, fct_ts_t const *ts)
#define fct_clp__get_error(_CLP_)
static int fct_stdout_pipe[2]
static int fctstr_istartswith(char const *str, char const *check)
static void fct_logger_record_failure(fctchk_t const *chk, fct_nlist_t *fail_list)
static nbool_t fct_test__is_pass(fct_test_t const *test)
switch_byte_t switch_byte_t uint32_t switch_bitpack_mode_t mode
fct_logger_i *(* fct_logger_new_fn)(void)
#define FCT_CLP_MAX_ERR_MSG_LEN
static size_t fctkern__tst_cnt(fctkern_t const *nk)
static void fct_logger__on_test_skip(fct_logger_i *logger, char const *condition, char const *name)
static void fctkern__log_test_end(fctkern_t *nk, fct_test_t *test)
static fct_logger_i * fct_minimal_logger_new(void)
static char * fctstr_clone_lower(char const *s)
static void fct_ts__add_test(fct_ts_t *ts, fct_test_t *test)
static void fct_junit_logger__on_fct_start(fct_logger_i *logger_, fct_logger_evt_t const *e)
static double fct_ts__duration(fct_ts_t const *ts)
static void fct_switch_std_to_buffer(int std_pipe[2], FILE *out, int fileno_, int *save_handle)
#define fct_nlist__init(_LIST_PTR_)
static void fct_logger__stub(fct_logger_i *l, fct_logger_evt_t const *e)
static int _fct_chk_empty_str(char const *s)
static void fct_junit_logger__on_delete(fct_logger_i *logger_, fct_logger_evt_t const *e)
static fct_logger_i_vtable_t fct_logger_default_vtable
static void fct_timer__init(fct_timer_t *timer)
static int fctstr_endswith(char const *str, char const *check)
char file[FCT_MAX_LOG_LINE]
static int fctstr_startswith(char const *str, char const *check)
static int fctstr_ieq(char const *s1, char const *s2)
static char const * fct_clp__optval2(fct_clp_t *clp, char const *option, char const *default_val)
static void fct_ts__test_begin(fct_ts_t *ts)
static void fct_nlist__clear(fct_nlist_t *list, fct_nlist_on_del_t on_del)
#define FCT_LIST_GROWTH_FACTOR
static void fct_logger__on_test_suite_skip(fct_logger_i *logger, char const *condition, char const *name)
static size_t fct_ts__tst_cnt_passed(fct_ts_t const *ts)
static void * fct_nlist__at(fct_nlist_t const *list, size_t idx)
static int fct_stderr_pipe[2]
static int fctkern__cl_parse_config_logger(fctkern_t *nk)
static nbool_t fct_ts__is_test_cnt(fct_ts_t const *ts, int test_num)
static fct_ts_t * fct_ts_new(char const *name)
static int fct_saved_stdout
static void fct_logger__on_warn(fct_logger_i *logger, char const *warn)
static void fctkern__write_help(fctkern_t *nk, FILE *out)
static int fctstr_eq(char const *s1, char const *s2)
static void fct_clp__parse(fct_clp_t *clp, int argc, char const *argv[])
static int fctstr_iendswith(char const *str, char const *check)
static fct_test_t * fct_test_new(char const *name)
static int fctkern__cl_is(fctkern_t *nk, char const *opt_str)
#define FCT_SWITCH_STDERR_TO_BUFFER()
#define FCT_DEFAULT_LOGGER
static void fct_ts__test_end(fct_ts_t *ts)
char msg[FCT_MAX_LOG_LINE]
#define fct_test__name(_TEST_)
static void fct_dotted_line_end(char const *endswith)
static int fct_clp__add_options(fct_clp_t *clp, fctcl_init_t const *options)
#define fct_ts__is_cnt_mode(ts)
struct _fct_namespace_t fct_namespace_t
#define FCT_DOTTED_MAX_LEN
static void fctkern__log_suite_skip(fctkern_t *nk, char const *condition, char const *name)
static void fct_junit_logger__on_fctx_end(fct_logger_i *logger_, fct_logger_evt_t const *e)
const char * test_skip_cndtn
fct_logger_types_t * lt_sys
static int fct_saved_stderr
size_t num_expected_failures
static fct_logger_i * fckern_sel_log(fct_logger_types_t *search, char const *sel_logger)
static void fct_standard_logger__on_delete(fct_logger_i *logger_, fct_logger_evt_t const *e)
char name[FCT_MAX_LOG_LINE]
static void fct_dotted_line_start(size_t maxwidth, char const *startwith)
struct _fct_logger_i_vtable_t fct_logger_i_vtable_t
#define FCT_OPT_VERSION_SHORT
static int fctkern__cl_parse(fctkern_t *nk)
#define FCT_SWITCH_STDOUT_TO_BUFFER()
static void fct_junit_logger__on_test_suite_start(fct_logger_i *l, fct_logger_evt_t const *e)
#define fctchk__is_pass(_CHK_)
static void fct_switch_std_to_std(FILE *out, int fileno_, int save_handle)
static fctcl_t * fctcl_new2(fctcl_init_t const *clo_init)
static int fctkern__init(fctkern_t *nk, int argc, const char *argv[])
static void fctkern__log_test_skip(fctkern_t *nk, char const *condition, char const *name)
static void fct_minimal_logger__on_chk(fct_logger_i *self_, fct_logger_evt_t const *e)
static void fct_standard_logger__on_fctx_end(fct_logger_i *logger_, fct_logger_evt_t const *e)
#define fct_clp__is(_CLP_, _OPTION_)
fct_logger_types_t * lt_usr
#define fctchk__msg(_CHK_)
#define FCT_NLIST_FOREACH_BGN(Type, Var, List)
static void fctkern__add_prefix_filter(fctkern_t *nk, char const *prefix_filter)
static char const * fct_xchk_file
static void fctstr_safe_cpy(char *dst, char const *src, size_t num)
static int _fct_chk_full_str(char const *s)
static fct_logger_i * fct_standard_logger_new(void)
static int fctstr_incl(char const *str, char const *check_incl)
static void fct_standard_logger__on_test_skip(fct_logger_i *logger_, fct_logger_evt_t const *e)
static int fct_vsnprintf(char *buffer, size_t buffer_len, char const *format, va_list args)
#define fctchk__file(_CHK_)
static void fct_nlist__append(fct_nlist_t *list, void *itm)
#define fctchk__lineno(_CHK_)
static fctcl_init_t FCT_CLP_OPTIONS[]
static char const * fctkern__cl_val2(fctkern_t *nk, char const *opt_str, char const *def_str)
static void fct_logger__on_test_end(fct_logger_i *logger, fct_test_t *test)
static size_t fct_test__chk_cnt(fct_test_t const *test)