Commit c94a52f3 authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

Merge branch 'dev_tester_factorization'

Conflicts:
	tester/message_tester.c
parents 2b2b138f cdec9f9e
......@@ -30,7 +30,7 @@ AC_SUBST(LINPHONE_VERSION)
AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION A full featured audio/video sip phone.])
AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)])
AM_INIT_AUTOMAKE([1.9 tar-pax])
AM_INIT_AUTOMAKE([1.9 tar-pax subdir-objects])
AC_SUBST([LIBTOOL_DEPS])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
AC_SUBST([docdir], [${datadir}/doc])
......
mediastreamer2 @ a9374f30
Subproject commit a56f04bfa4619186ba51ac8d3d2d73c942ee4fcf
Subproject commit a9374f30b2e5098e646608b0562e50a156fba820
......@@ -26,6 +26,8 @@ endif()
find_package(GTK2 2.18 COMPONENTS gtk)
set(SOURCE_FILES
common/bc_tester_utils.c
common/bc_tester_utils.h
accountmanager.c
call_tester.c
dtmf_tester.c
......@@ -50,6 +52,8 @@ set(SOURCE_FILES
video_tester.c
)
add_definitions(-DBC_CONFIG_FILE="config.h")
add_executable(liblinphone_tester ${SOURCE_FILES})
set_target_properties(liblinphone_tester PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(liblinphone_tester PUBLIC ${CUNIT_INCLUDE_DIRS})
......
......@@ -10,33 +10,35 @@ liblinphone_HEADERS = liblinphone_tester.h
lib_LTLIBRARIES = liblinphonetester.la
liblinphonetester_la_SOURCES = tester.c \
setup_tester.c \
register_tester.c \
message_tester.c \
liblinphonetester_la_SOURCES = \
accountmanager.c \
call_tester.c \
multicast_call_tester.c \
presence_tester.c \
upnp_tester.c \
dtmf_tester.c \
eventapi_tester.c \
flexisip_tester.c \
stun_tester.c \
remote_provisioning_tester.c \
quality_reporting_tester.c \
log_collection_tester.c \
transport_tester.c \
player_tester.c \
dtmf_tester.c \
accountmanager.c \
message_tester.c \
multi_call.c \
multicast_call_tester.c \
offeranswer_tester.c \
player_tester.c \
presence_tester.c \
quality_reporting_tester.c \
register_tester.c \
remote_provisioning_tester.c \
setup_tester.c \
stun_tester.c \
transport_tester.c \
tester.c \
upnp_tester.c \
video_tester.c \
multi_call.c
common/bc_tester_utils.c common/bc_tester_utils.h
liblinphonetester_la_LDFLAGS= -no-undefined
liblinphonetester_la_LIBADD= ../coreapi/liblinphone.la $(CUNIT_LIBS)
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/coreapi
AM_CFLAGS = $(STRICT_OPTIONS) $(STRICT_OPTIONS_CC) -DIN_LINPHONE $(ORTP_CFLAGS) $(MEDIASTREAMER_CFLAGS) $(CUNIT_CFLAGS) $(BELLESIP_CFLAGS) $(LIBXML2_CFLAGS) $(SQLITE3_CFLAGS)
AM_CFLAGS = -DBC_CONFIG_FILE=\"config.h\" $(STRICT_OPTIONS) $(STRICT_OPTIONS_CC) -DIN_LINPHONE $(ORTP_CFLAGS) $(MEDIASTREAMER_CFLAGS) $(CUNIT_CFLAGS) $(BELLESIP_CFLAGS) $(LIBXML2_CFLAGS) $(SQLITE3_CFLAGS)
if BUILD_GTK_UI
......
......@@ -33,7 +33,7 @@ typedef struct _Account Account;
Account *account_new(LinphoneAddress *identity, const char *unique_id){
char *modified_username;
Account *obj=ms_new0(Account,1);
/* we need to inhibit leak detector because the two LinphoneAddress will remain behond the scope of the test being run */
belle_sip_object_inhibit_leak_detector(TRUE);
obj->identity=linphone_address_clone(identity);
......@@ -82,7 +82,7 @@ void account_manager_destroy(void){
Account *account_manager_get_account(AccountManager *m, const LinphoneAddress *identity){
MSList *it;
for(it=m->accounts;it!=NULL;it=it->next){
Account *a=(Account*)it->data;
if (linphone_address_weak_equal(a->identity,identity)){
......@@ -120,15 +120,15 @@ void account_create_on_server(Account *account, const LinphoneProxyConfig *refcf
char *tmp;
LinphoneAddress *server_addr;
LCSipTransports tr;
vtable.registration_state_changed=account_created_on_server_cb;
vtable.auth_info_requested=account_created_auth_requested_cb;
lc=configure_lc_from(&vtable,liblinphone_tester_file_prefix,NULL,account);
lc=configure_lc_from(&vtable,bc_tester_read_dir_prefix,NULL,account);
tr.udp_port=LC_SIP_TRANSPORT_RANDOM;
tr.tcp_port=LC_SIP_TRANSPORT_RANDOM;
tr.tls_port=LC_SIP_TRANSPORT_RANDOM;
linphone_core_set_sip_transports(lc,&tr);
cfg=linphone_core_create_proxy_config(lc);
linphone_address_set_secure(tmp_identity, FALSE);
linphone_address_set_password(tmp_identity,account->password);
......@@ -137,7 +137,7 @@ void account_create_on_server(Account *account, const LinphoneProxyConfig *refcf
linphone_proxy_config_set_identity(cfg,tmp);
ms_free(tmp);
linphone_address_unref(tmp_identity);
server_addr=linphone_address_new(linphone_proxy_config_get_server_addr(refcfg));
linphone_address_set_secure(server_addr, FALSE);
linphone_address_set_transport(server_addr,LinphoneTransportTcp); /*use tcp for account creation, we may not have certificates configured at this stage*/
......@@ -147,9 +147,9 @@ void account_create_on_server(Account *account, const LinphoneProxyConfig *refcf
ms_free(tmp);
linphone_address_unref(server_addr);
linphone_proxy_config_set_expires(cfg,3600);
linphone_core_add_proxy_config(lc,cfg);
if (wait_for_until(lc,NULL,&account->auth_requested,1,10000)==FALSE){
ms_fatal("Account for %s could not be created on server.", linphone_proxy_config_get_identity(refcfg));
}
......@@ -161,13 +161,13 @@ void account_create_on_server(Account *account, const LinphoneProxyConfig *refcf
linphone_address_unref(tmp_identity);
ms_free(tmp);
linphone_proxy_config_done(cfg);
ai=linphone_auth_info_new(linphone_address_get_username(account->modified_identity),
NULL,
account->password,NULL,NULL,linphone_address_get_domain(account->modified_identity));
linphone_core_add_auth_info(lc,ai);
linphone_auth_info_destroy(ai);
if (wait_for_until(lc,NULL,&account->created,1,3000)==FALSE){
ms_fatal("Account for %s is not working on server.", linphone_proxy_config_get_identity(refcfg));
}
......@@ -187,7 +187,7 @@ LinphoneAddress *account_manager_check_account(AccountManager *m, LinphoneProxyC
LinphoneAuthInfo *ai;
char *tmp;
bool_t create_account=FALSE;
if (!account){
account=account_new(id_addr,m->unique_id);
ms_message("No account for %s exists, going to create one.",identity);
......@@ -199,7 +199,7 @@ LinphoneAddress *account_manager_check_account(AccountManager *m, LinphoneProxyC
tmp=linphone_address_as_string(id_addr);
linphone_proxy_config_set_identity(cfg,tmp);
ms_free(tmp);
if (create_account){
account_create_on_server(account,cfg);
}
......@@ -208,7 +208,7 @@ LinphoneAddress *account_manager_check_account(AccountManager *m, LinphoneProxyC
account->password,NULL,NULL,linphone_address_get_domain(account->modified_identity));
linphone_core_add_auth_info(lc,ai);
linphone_auth_info_destroy(ai);
linphone_address_unref(id_addr);
return account->modified_identity;
}
......
......@@ -1650,8 +1650,8 @@ static void video_call_base(LinphoneCoreManager* pauline,LinphoneCoreManager* ma
}
if (mode==LinphoneMediaEncryptionDTLS) { /* for DTLS we must access certificates or at least have a directory to store them */
marie->lc->user_certificates_path = ms_strdup_printf("%s/certificates/marie", liblinphone_tester_file_prefix);
pauline->lc->user_certificates_path = ms_strdup_printf("%s/certificates/pauline", liblinphone_tester_file_prefix);
marie->lc->user_certificates_path = ms_strdup_printf("%s/certificates/marie", bc_tester_read_dir_prefix);
pauline->lc->user_certificates_path = ms_strdup_printf("%s/certificates/pauline", bc_tester_read_dir_prefix);
}
linphone_core_set_media_encryption(marie->lc,mode);
......@@ -2089,12 +2089,12 @@ static void call_with_file_player(void) {
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphonePlayer *player;
char hellopath[256];
char *recordpath = create_filepath(liblinphone_tester_writable_dir_prefix, "record", "wav");
char *recordpath = create_filepath(bc_tester_writable_dir_prefix, "record", "wav");
/*make sure the record file doesn't already exists, otherwise this test will append new samples to it*/
unlink(recordpath);
snprintf(hellopath,sizeof(hellopath), "%s/sounds/hello8000.wav", liblinphone_tester_file_prefix);
snprintf(hellopath,sizeof(hellopath), "%s/sounds/hello8000.wav", bc_tester_read_dir_prefix);
/*caller uses files instead of soundcard in order to avoid mixing soundcard input with file played using call's player*/
linphone_core_use_files(marie->lc,TRUE);
......@@ -2167,12 +2167,12 @@ static void call_with_mkv_file_player(void) {
ms_warning("Test skipped, no mkv support.");
goto end;
}
recordpath = create_filepath(liblinphone_tester_writable_dir_prefix, "record", "wav");
recordpath = create_filepath(bc_tester_writable_dir_prefix, "record", "wav");
/*make sure the record file doesn't already exists, otherwise this test will append new samples to it*/
unlink(recordpath);
snprintf(hellowav,sizeof(hellowav), "%s/sounds/hello8000_mkv_ref.wav", liblinphone_tester_file_prefix);
snprintf(hellomkv,sizeof(hellomkv), "%s/sounds/hello8000.mkv", liblinphone_tester_file_prefix);
snprintf(hellowav,sizeof(hellowav), "%s/sounds/hello8000_mkv_ref.wav", bc_tester_read_dir_prefix);
snprintf(hellomkv,sizeof(hellomkv), "%s/sounds/hello8000.mkv", bc_tester_read_dir_prefix);
/*caller uses files instead of soundcard in order to avoid mixing soundcard input with file played using call's player*/
linphone_core_use_files(marie->lc,TRUE);
......@@ -2250,8 +2250,8 @@ void call_base(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_r
linphone_core_set_media_encryption(marie->lc,mode);
linphone_core_set_media_encryption(pauline->lc,mode);
if (mode==LinphoneMediaEncryptionDTLS) { /* for DTLS we must access certificates or at least have a directory to store them */
marie->lc->user_certificates_path = ms_strdup_printf("%s/certificates/marie", liblinphone_tester_file_prefix);
pauline->lc->user_certificates_path = ms_strdup_printf("%s/certificates/pauline", liblinphone_tester_file_prefix);
marie->lc->user_certificates_path = ms_strdup_printf("%s/certificates/marie", bc_tester_read_dir_prefix);
pauline->lc->user_certificates_path = ms_strdup_printf("%s/certificates/pauline", bc_tester_read_dir_prefix);
}
linphone_core_set_firewall_policy(marie->lc,policy);
......@@ -2883,7 +2883,7 @@ static void record_call(const char *filename, bool_t enableVideo) {
formats = linphone_core_get_supported_file_formats(marie->lc);
for(i=0, format = formats[0]; format != NULL; i++, format = formats[i]) {
filepath = create_filepath(liblinphone_tester_writable_dir_prefix, filename, format);
filepath = create_filepath(bc_tester_writable_dir_prefix, filename, format);
remove(filepath);
linphone_call_params_set_record_file(marieParams, filepath);
CU_ASSERT_TRUE(call_succeeded = call_with_params(marie, pauline, marieParams, paulineParams));
......@@ -2921,7 +2921,7 @@ static void video_call_snapshot(void) {
LinphoneCallParams *marieParams = linphone_core_create_default_call_parameters(marie->lc);
LinphoneCallParams *paulineParams = linphone_core_create_default_call_parameters(pauline->lc);
LinphoneCall *callInst = NULL;
char *filename = create_filepath(liblinphone_tester_writable_dir_prefix, "snapshot", "jpeg");
char *filename = create_filepath(bc_tester_writable_dir_prefix, "snapshot", "jpeg");
int dummy = 0;
bool_t call_succeeded = FALSE;
......@@ -3373,8 +3373,8 @@ static void call_with_generic_cn(void) {
LinphoneCoreManager* marie;
LinphoneCoreManager* pauline;
LinphoneCall *pauline_call;
char *audio_file_with_silence=ms_strdup_printf("%s/%s",liblinphone_tester_file_prefix,"sounds/ahbahouaismaisbon.wav");
char *recorded_file=ms_strdup_printf("%s/%s",liblinphone_tester_writable_dir_prefix,"result.wav");
char *audio_file_with_silence=ms_strdup_printf("%s/%s",bc_tester_read_dir_prefix,"sounds/ahbahouaismaisbon.wav");
char *recorded_file=ms_strdup_printf("%s/%s",bc_tester_writable_dir_prefix,"result.wav");
belle_sip_object_enable_leak_detector(TRUE);
begin=belle_sip_object_get_object_count();
......
/*
tester - liblinphone test suite
Copyright (C) 2013 Belledonne Communications SARL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* this must be provided at compile time*/
#include BC_CONFIG_FILE
#include "bc_tester_utils.h"
#include <stdarg.h>
#include <stdlib.h>
#include "CUnit/Automated.h"
#if WINAPI_FAMILY_PHONE_APP
const char *bc_tester_read_dir_prefix="Assets";
#elif defined(__QNX__)
const char *bc_tester_read_dir_prefix="./app/native/assets/";
#else
const char *bc_tester_read_dir_prefix=".";
#endif
/* TODO: have the same "static" for QNX and windows as above? */
#ifdef ANDROID
const char *bc_tester_writable_dir_prefix = "/data/data/org.linphone.tester/cache";
#else
const char *bc_tester_writable_dir_prefix = ".";
#endif
static test_suite_t **test_suite = NULL;
static int nb_test_suites = 0;
#ifdef HAVE_CU_CURSES
#include "CUnit/CUCurses.h"
static unsigned char curses = 0;
#endif
char* xml_file = "CUnitAutomated-Results.xml";
int xml_enabled = 0;
char * suite_name;
char * test_name;
void (*tester_printf_va)(int level, const char *fmt, va_list args);
int verbosity_info;
int verbosity_error;
static void tester_printf(int level, const char *fmt, ...) {
va_list args;
va_start (args, fmt);
tester_printf_va(level, fmt, args);
va_end (args);
}
static int tester_run_suite(test_suite_t *suite) {
int i;
CU_pSuite pSuite = CU_add_suite(suite->name, suite->init_func, suite->cleanup_func);
for (i = 0; i < suite->nb_tests; i++) {
if (NULL == CU_add_test(pSuite, suite->tests[i].name, suite->tests[i].func)) {
return CU_get_error();
}
}
return 0;
}
const char * tester_test_suite_name(int suite_index) {
if (suite_index >= nb_test_suites) return NULL;
return test_suite[suite_index]->name;
}
static int tester_test_suite_index(const char *suite_name) {
int i;
for (i = 0; i < nb_test_suites; i++) {
if ((strcmp(suite_name, test_suite[i]->name) == 0) && (strlen(suite_name) == strlen(test_suite[i]->name))) {
return i;
}
}
return -1;
}
const char * tester_test_name(const char *suite_name, int test_index) {
int suite_index = tester_test_suite_index(suite_name);
if ((suite_index < 0) || (suite_index >= nb_test_suites)) return NULL;
if (test_index >= test_suite[suite_index]->nb_tests) return NULL;
return test_suite[suite_index]->tests[test_index].name;
}
static int tester_nb_tests(const char *suite_name) {
int i = tester_test_suite_index(suite_name);
if (i < 0) return 0;
return test_suite[i]->nb_tests;
}
static void tester_list_suites() {
int j;
for(j=0;j<nb_test_suites;j++) {
fprintf(stdout, "%s\n", tester_test_suite_name(j));
}
}
static void tester_list_suite_tests(const char *suite_name) {
int j;
for( j = 0; j < tester_nb_tests(suite_name); j++) {
const char *test_name = tester_test_name(suite_name, j);
fprintf(stdout, "%s\n", test_name);
}
}
static void all_complete_message_handler(const CU_pFailureRecord pFailure) {
#ifdef HAVE_CU_GET_SUITE
char * results = CU_get_run_results_string();
tester_printf(verbosity_info,"\n%s",results);
free(results);
#endif
}
static void suite_init_failure_message_handler(const CU_pSuite pSuite) {
tester_printf(verbosity_error,"Suite initialization failed for [%s].", pSuite->pName);
}
static void suite_cleanup_failure_message_handler(const CU_pSuite pSuite) {
tester_printf(verbosity_error,"Suite cleanup failed for [%s].", pSuite->pName);
}
#ifdef HAVE_CU_GET_SUITE
static void suite_start_message_handler(const CU_pSuite pSuite) {
tester_printf(verbosity_info,"Suite [%s] started\n", pSuite->pName);
}
static void suite_complete_message_handler(const CU_pSuite pSuite, const CU_pFailureRecord pFailure) {
tester_printf(verbosity_info,"Suite [%s] ended\n", pSuite->pName);
}
static void test_start_message_handler(const CU_pTest pTest, const CU_pSuite pSuite) {
tester_printf(verbosity_info,"Suite [%s] Test [%s] started", pSuite->pName,pTest->pName);
}
/*derivated from cunit*/
static void test_complete_message_handler(const CU_pTest pTest,
const CU_pSuite pSuite,
const CU_pFailureRecord pFailureList) {
int i;
char * result = malloc(sizeof(char)*2048);//not very pretty but...
CU_pFailureRecord pFailure = pFailureList;
sprintf(result, "Suite [%s] Test [%s]", pSuite->pName, pTest->pName);
if (pFailure) {
strncat(result, " failed:", strlen(" failed:"));
for (i = 1 ; (NULL != pFailure) ; pFailure = pFailure->pNext, i++) {
sprintf(result, "%s\n %d. %s:%u - %s", result, i,
(NULL != pFailure->strFileName) ? pFailure->strFileName : "",
pFailure->uiLineNumber,
(NULL != pFailure->strCondition) ? pFailure->strCondition : "");
}
} else {
strncat(result, " passed", strlen(" passed"));
}
tester_printf(verbosity_info,"%s\n", result);
free(result);
}
#endif
static int tester_run_tests(const char *suite_name, const char *test_name) {
int i;
/* initialize the CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
for (i = 0; i < nb_test_suites; i++) {
tester_run_suite(test_suite[i]);
}
#ifdef HAVE_CU_GET_SUITE
CU_set_suite_start_handler(suite_start_message_handler);
CU_set_suite_complete_handler(suite_complete_message_handler);
CU_set_test_start_handler(test_start_message_handler);
CU_set_test_complete_handler(test_complete_message_handler);
#endif
CU_set_all_test_complete_handler(all_complete_message_handler);
CU_set_suite_init_failure_handler(suite_init_failure_message_handler);
CU_set_suite_cleanup_failure_handler(suite_cleanup_failure_message_handler);
if( xml_enabled != 0 ){
CU_automated_run_tests();
} else {
#ifndef HAVE_CU_GET_SUITE
if( suite_name ){
tester_printf(verbosity_info, "Tester compiled without CU_get_suite() function, running all tests instead of suite '%s'", suite_name);
}
#else
if (suite_name){
CU_pSuite suite;
suite=CU_get_suite(suite_name);
if (!suite) {
tester_printf(verbosity_error, "Could not find suite '%s'. Available suites are:", suite_name);
tester_list_suites();
return -1;
} else if (test_name) {
CU_pTest test=CU_get_test_by_name(test_name, suite);
if (!test) {
tester_printf(verbosity_error, "Could not find test '%s' in suite '%s'. Available tests are:", test_name, suite_name);
// do not use suite_name here, since this method is case sensitive
tester_list_suite_tests(suite->pName);
return -2;
} else {
CU_ErrorCode err= CU_run_test(suite, test);
if (err != CUE_SUCCESS) tester_printf(verbosity_error, "CU_basic_run_test error %d", err);
}
} else {
CU_run_suite(suite);
}
}
else
#endif
{
#ifdef HAVE_CU_CURSES
if (curses) {
/* Run tests using the CUnit curses interface */
CU_curses_run_tests();
}
else
#endif
{
/* Run all tests using the CUnit Basic interface */
CU_run_all_tests();
}
}
}
return CU_get_number_of_tests_failed()!=0;
}
void bc_tester_helper(const char *name, const char* additionnal_helper) {
fprintf(stdout,"%s --help\n"
"\t\t\t--list-suites\n"
"\t\t\t--list-tests <suite>\n"
"\t\t\t--suite <suite name>\n"
"\t\t\t--test <test name>\n"
#ifdef HAVE_CU_CURSES
"\t\t\t--curses\n"
#endif
"\t\t\t--xml\n"
"\t\t\t--xml-file <xml file prefix (will be suffixed by '-Results.xml')>\n"
"And additionally:\n"
"%s"
, name
, additionnal_helper);
}
void bc_tester_init(void (*ftester_printf)(int level, const char *fmt, va_list args), int iverbosity_info, int iverbosity_error) {
tester_printf_va = ftester_printf;
verbosity_error = iverbosity_error;
verbosity_info = iverbosity_info;
}
int bc_tester_parse_args(int argc, char **argv, int argid)
{
int i = argid;
if (strcmp(argv[i],"--help")==0){
return -1;
} else if (strcmp(argv[i],"--test")==0){
CHECK_ARG("--test", ++i, argc);
test_name=argv[i];
}else if (strcmp(argv[i],"--suite")==0){
CHECK_ARG("--suite", ++i, argc);
suite_name=argv[i];
} else if (strcmp(argv[i],"--list-suites")==0){
tester_list_suites();
return 0;
} else if (strcmp(argv[i],"--list-tests")==0){
CHECK_ARG("--list-tests", ++i, argc);
suite_name = argv[i];
tester_list_suite_tests(suite_name);
return 0;
} else if (strcmp(argv[i], "--xml-file") == 0){
CHECK_ARG("--xml-file", ++i, argc);
xml_file = argv[i];
xml_enabled = 1;
} else if (strcmp(argv[i], "--xml") == 0){
xml_enabled = 1;
}else {
fprintf(stderr, "Unknown option \"%s\"\n", argv[i]);
return -1;
}
if( xml_enabled && (suite_name || test_name) ){
fprintf(stderr, "Cannot use both XML and specific test suite\n");
return -1;
}
/* returns number of arguments read + 1 */
return i - argid + 1;
}
int bc_tester_start() {
int ret;
if( xml_enabled ){
char * xml_tmp_file = malloc(sizeof(char) * (strlen(xml_file) + strlen(".tmp") + 1));
sprintf(xml_tmp_file, "%s.tmp", xml_file);
CU_set_output_filename(xml_tmp_file);
free(xml_tmp_file);
}
ret = tester_run_tests(suite_name, test_name);
return ret;
}
void bc_tester_add_suite(test_suite_t *suite) {
if (test_suite == NULL) {
test_suite = (test_suite_t **)malloc(10 * sizeof(test_suite_t *));
}
test_suite[nb_test_suites] = suite;
nb_test_suites++;
if ((nb_test_suites % 10) == 0) {
test_suite = (test_suite_t **)realloc(test_suite, (nb_test_suites + 10) * sizeof(test_suite_t *));
}
}
void bc_tester_uninit() {
/* Redisplay list of failed tests on end */
if (CU_get_number_of_failure_records()){
CU_basic_show_failures(CU_get_failure_list());
tester_printf(verbosity_info,""); /*add missing final newline*/
}
CU_cleanup_registry();
if( xml_enabled ){
/*create real xml file only if tester did not crash*/
char * xml_tmp_file = malloc(sizeof(char) * (strlen(xml_file) + strlen(".tmp-Results.xml") + 1));