Update tester wrapper (mainly define HAVE_CU_GET_SUITE if provided)

parent 722e1e80
...@@ -22,3 +22,5 @@ ...@@ -22,3 +22,5 @@
#cmakedefine HAVE_DTLS_SRTP #cmakedefine HAVE_DTLS_SRTP
#cmakedefine HAVE_CTR_DRGB_FREE #cmakedefine HAVE_CTR_DRGB_FREE
#cmakedefine HAVE_CU_GET_SUITE
#cmakedefine HAVE_CU_CURSES
...@@ -109,6 +109,8 @@ char* bc_sprintfva(const char* format, va_list args); ...@@ -109,6 +109,8 @@ char* bc_sprintfva(const char* format, va_list args);
char* bc_sprintf(const char* format, ...); char* bc_sprintf(const char* format, ...);
void bc_free(void *ptr); void bc_free(void *ptr);
unsigned int bc_get_number_of_failures(void);
void bc_set_trace_handler(void(*handler)(int, const char*, va_list));
/** /**
* Get full path to the given resource * Get full path to the given resource
* *
......
...@@ -16,6 +16,10 @@ You should have received a copy of the GNU General Public License ...@@ -16,6 +16,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <bctoolbox/tester.h> #include <bctoolbox/tester.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -27,9 +31,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -27,9 +31,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif #endif
#pragma GCC diagnostic ignored "-Wstrict-prototypes" #pragma GCC diagnostic ignored "-Wstrict-prototypes"
#include "CUnit/Basic.h" #include <CUnit/Basic.h>
#include "CUnit/Automated.h" #include <CUnit/Automated.h>
#include "CUnit/MyMem.h" #include <CUnit/MyMem.h>
#include <CUnit/Util.h>
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) #if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
...@@ -727,3 +732,11 @@ const char ** bc_tester_current_test_tags(void) { ...@@ -727,3 +732,11 @@ const char ** bc_tester_current_test_tags(void) {
} }
return NULL; return NULL;
} }
unsigned int bc_get_number_of_failures(void) {
return CU_get_number_of_failures();
}
void bc_set_trace_handler(void(*handler)(int, const char*, va_list)) {
CU_set_trace_handler(handler);
}
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