[Unit-tests] Report test failure details as they happen. Fix issue where fst_xcheck definition did not allow its use inside conditional statements.

This commit is contained in:
Chris Rienzo
2021-01-17 14:41:10 -05:00
committed by Andrey Volk
parent e6cd6391ff
commit 451900b353
3 changed files with 11 additions and 7 deletions
+4
View File
@@ -2858,6 +2858,10 @@ fct_standard_logger__on_chk(
/* Only record failures. */
if ( !fctchk__is_pass(e->chk) )
{
printf("\nTEST FAIL: %s(%d): %s\n",
fctchk__file(e->chk),
fctchk__lineno(e->chk),
fctchk__msg(e->chk));
fct_logger_record_failure(e->chk, &(logger->failed_cndtns_list));
}
}
+4 -4
View File
@@ -203,13 +203,13 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char
* Check a test /w error message
*/
#define fst_xcheck(expr, error_msg) \
fct_xchk(expr, "%s", error_msg);
(fct_xchk(expr, "%s", error_msg))
/**
* Fail a test
*/
#define fst_fail(error_msg) \
fct_xchk(0, "%s", error_msg);
(fct_xchk(0, "%s", error_msg))
/**
* Check duration relative to test start, last marked time, or last check.
@@ -236,7 +236,7 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char
(actual), \
(expected), \
(precision) \
);
)
/**
* Check if double-precision number is in range
@@ -248,7 +248,7 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char
(actual), \
(expected), \
(precision) \
);
)
/**
* Run test without loading FS core