Add HAVE_CU_SET_TRACE_HANDLER

parent 5651404c
......@@ -82,6 +82,7 @@ if(ENABLE_TESTS)
list(APPEND CMAKE_REQUIRED_LIBRARIES ${CUNIT_LIBRARIES})
check_symbol_exists("CU_get_suite" "CUnit/CUnit.h" HAVE_CU_GET_SUITE)
check_symbol_exists("CU_curses_run_tests" "CUnit/CUnit.h" HAVE_CU_CURSES)
check_symbol_exists("CU_set_trace_handler" "CUnit/Util.h" HAVE_CU_SET_TRACE_HANDLER)
cmake_pop_check_state()
get_filename_component(cunit_library_path "${CUNIT_LIBRARIES}" PATH)
......
......@@ -24,3 +24,4 @@
#cmakedefine HAVE_CTR_DRGB_FREE
#cmakedefine HAVE_CU_GET_SUITE
#cmakedefine HAVE_CU_CURSES
#cmakedefine HAVE_CU_SET_TRACE_HANDLER
......@@ -738,7 +738,11 @@ unsigned int bc_get_number_of_failures(void) {
}
void bc_set_trace_handler(void(*handler)(int, const char*, va_list)) {
#ifdef HAVE_CU_SET_TRACE_HANDLER
CU_set_trace_handler(handler);
#else
bc_tester_printf(bc_printf_verbosity_error, "CU_set_trace_handler not implemented");
#endif
}
int _BC_ASSERT(const char* file, int line, int predicate, const char* format, int fatal) {
......
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