Tester: terminate tester_utils for belle-sip

parent ba07a770
......@@ -22,7 +22,12 @@ belle_sip_tester_SOURCES= \
common/tester_utils.c common/tester_utils.h
belle_sip_tester_CFLAGS=$(CUNIT_CFLAGS) $(STRICT_OPTIONS) $(STRICT_OPTIONS_CC) $(TLS_CFLAGS)
belle_sip_tester_CFLAGS=\
-DBC_CONFIG_FILE=\"config.h\" \
$(CUNIT_CFLAGS) \
$(STRICT_OPTIONS) \
$(STRICT_OPTIONS_CC) \
$(TLS_CFLAGS)
belle_sip_tester_LDFLAGS=$(CUNIT_LIBS) $(AM_LDFLAGS)
......
......@@ -92,7 +92,7 @@ static void test_generate_and_parse_certificates(void) {
belle_sip_signing_key_t *key, *parsed_key;
char *pem_certificate, *pem_parsed_certificate, *pem_key, *pem_parsed_key;
int ret = 0;
char *belle_sip_certificate_temporary_dir = belle_sip_strdup_printf("%s%s", tester_writable_dir_prefix, TEMPORARY_CERTIFICATE_DIR);
char *belle_sip_certificate_temporary_dir = belle_sip_strdup_printf("%s%s", bc_tester_writable_dir_prefix, TEMPORARY_CERTIFICATE_DIR);
/* create 2 certificates in the temporary certificate directory (TODO : set the directory in a absolute path?? where?)*/
ret = belle_sip_generate_self_signed_certificate(belle_sip_certificate_temporary_dir, "test_certificate1", &certificate, &key);
......
......@@ -79,23 +79,23 @@ void belle_sip_tester_init() {
belle_sip_log_handler = belle_sip_get_log_handler();
belle_sip_set_log_handler(belle_sip_logv_out);
tester_init(log_handler);
bc_tester_init(log_handler, BELLE_SIP_LOG_MESSAGE, BELLE_SIP_LOG_ERROR);
belle_sip_init_sockets();
belle_sip_object_enable_marshal_check(TRUE);
ipv6_available=_belle_sip_tester_ipv6_available();
tester_add_suite(&cast_test_suite);
tester_add_suite(&sip_uri_test_suite);
tester_add_suite(&generic_uri_test_suite);
tester_add_suite(&headers_test_suite);
tester_add_suite(&core_test_suite);
tester_add_suite(&sdp_test_suite);
tester_add_suite(&resolver_test_suite);
tester_add_suite(&message_test_suite);
tester_add_suite(&authentication_helper_test_suite);
tester_add_suite(&register_test_suite);
tester_add_suite(&dialog_test_suite);
tester_add_suite(&refresher_test_suite);
tester_add_suite(&http_test_suite);
bc_tester_add_suite(&cast_test_suite);
bc_tester_add_suite(&sip_uri_test_suite);
bc_tester_add_suite(&generic_uri_test_suite);
bc_tester_add_suite(&headers_test_suite);
bc_tester_add_suite(&core_test_suite);
bc_tester_add_suite(&sdp_test_suite);
bc_tester_add_suite(&resolver_test_suite);
bc_tester_add_suite(&message_test_suite);
bc_tester_add_suite(&authentication_helper_test_suite);
bc_tester_add_suite(&register_test_suite);
bc_tester_add_suite(&dialog_test_suite);
bc_tester_add_suite(&refresher_test_suite);
bc_tester_add_suite(&http_test_suite);
}
const char * belle_sip_tester_get_root_ca_path(void) {
......@@ -109,7 +109,7 @@ void belle_sip_tester_set_root_ca_path(const char *root_ca_path) {
void belle_sip_tester_uninit(void) {
belle_sip_object_unref(pool);
belle_sip_uninit_sockets();
tester_uninit();
bc_tester_uninit();
}
static const char* belle_sip_helper =
......@@ -124,6 +124,7 @@ static const char* belle_sip_helper =
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
int main (int argc, char *argv[]) {
int i;
int ret;
const char *root_ca_path = NULL;
const char *env_domain=getenv("TEST_DOMAIN");
......@@ -157,11 +158,11 @@ int main (int argc, char *argv[]) {
CHECK_ARG("--root-ca", ++i, argc);
root_ca_path = argv[i];
}else {
int ret = tester_parse_args(argc, argv, i);
int ret = bc_tester_parse_args(argc, argv, i);
if (ret>0) {
i += ret;
} else {
tester_helper(argv[0], belle_sip_helper);
bc_tester_helper(argv[0], belle_sip_helper);
return ret;
}
}
......@@ -169,6 +170,8 @@ int main (int argc, char *argv[]) {
belle_sip_tester_set_root_ca_path(root_ca_path);
pool=belle_sip_object_pool_push();
return tester_start();
ret = bc_tester_start();
belle_sip_tester_uninit();
return ret;
}
#endif
......@@ -42,11 +42,8 @@ extern test_suite_t refresher_test_suite;
extern test_suite_t http_test_suite;
extern int belle_sip_tester_ipv6_available(void);
extern void belle_sip_tester_init(void);
extern void belle_sip_tester_uninit(void);
extern const char * belle_sip_tester_get_root_ca_path(void);
extern void belle_sip_tester_set_root_ca_path(const char *root_ca_path);
extern int belle_sip_tester_run_tests(const char *suite_name, const char *test_name);
extern const char* belle_sip_tester_client_cert;
extern const char* belle_sip_tester_client_cert_fingerprint;
......
This diff is collapsed.
......@@ -22,8 +22,8 @@
#include "CUnit/Basic.h"
extern const char *tester_file_prefix;
extern const char *tester_writable_dir_prefix;
extern const char *bc_tester_read_dir_prefix;
extern const char *bc_tester_writable_dir_prefix;
typedef void (*test_function_t)(void);
typedef int (*test_suite_function_t)(const char *name);
......@@ -52,26 +52,13 @@ fprintf(stderr, "Missing argument for \"%s\"\n", argument); \
return -1; \
} \
void tester_init(void (*tester_printf)(int level, const char *fmt, va_list args));
void tester_helper(const char *name, const char* additionnal_helper);
int tester_parse_args(int argc, char** argv, int argid);
int tester_start();
int tester_test_suite_index(const char *suite_name);
void tester_list_suites();
void tester_list_suite_tests(const char *suite_name);
int tester_test_index(const char *suite_name, const char *test_name);
int tester_nb_test_suites(void);
int tester_nb_tests(const char *suite_name);
const char * tester_test_suite_name(int suite_index);
const char * tester_test_name(const char *suite_name, int test_index);
int tester_run_tests(const char *suite_name, const char *test_name);
void tester_add_suite(test_suite_t *suite);
int tester_run_suite(test_suite_t *suite);
void tester_uninit();
void bc_tester_init(void (*ftester_printf)(int level, const char *fmt, va_list args)
, int verbosity_info, int verbosity_error);
void bc_tester_helper(const char *name, const char* additionnal_helper);
int bc_tester_parse_args(int argc, char** argv, int argid);
int bc_tester_start();
void bc_tester_add_suite(test_suite_t *suite);
void bc_tester_uninit();
#ifdef __cplusplus
......
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