Tester: create tester_utils which contain factorized code for all testers (in progress)

parent 6f1c103a
......@@ -3,21 +3,23 @@ if ENABLE_TESTS
noinst_PROGRAMS=belle_sip_tester belle_sip_object_describe belle_sip_parse belle_http_get belle_sip_resolve
belle_sip_tester_SOURCES= belle_sip_tester.c belle_sip_tester.h\
belle_sip_tester_SOURCES= \
auth_helper_tester.c \
belle_generic_uri_tester.c \
belle_http_tester.c \
belle_sdp_tester.c \
belle_sip_uri_tester.c \
belle_sip_core_tester.c \
belle_sip_dialog_tester.c \
belle_sip_headers_tester.c \
belle_sip_message_tester.c \
auth_helper_tester.c \
cast_test.c \
belle_sip_register_tester.c \
belle_sip_dialog_tester.c \
belle_sip_refresher_tester.c \
belle_sip_register_tester.c \
belle_sip_resolver_tester.c \
belle_sip_core_tester.c \
belle_generic_uri_tester.c \
belle_sip_tester.c belle_sip_tester.h\
belle_sip_uri_tester.c \
cast_test.c \
register_tester.h \
belle_http_tester.c
tester_utils.c tester_utils.h
belle_sip_tester_CFLAGS=$(CUNIT_CFLAGS) $(STRICT_OPTIONS) $(STRICT_OPTIONS_CC) $(TLS_CFLAGS)
......
......@@ -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", belle_sip_tester_writable_dir_prefix, TEMPORARY_CERTIFICATE_DIR);
char *belle_sip_certificate_temporary_dir = belle_sip_strdup_printf("%s%s", 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);
......
This diff is collapsed.
/*
belle-sip - SIP (RFC3261) library.
Copyright (C) 2010-2013 Belledonne Communications SARL
Copyright (C) 2010-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 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.
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/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _BELLE_SIP_TESTER_H
#define _BELLE_SIP_TESTER_H
#include "CUnit/Basic.h"
typedef void (*test_function_t)(void);
typedef int (*test_suite_function_t)(const char *name);
typedef struct {
const char *name;
test_function_t func;
} test_t;
typedef struct {
const char *name;
CU_InitializeFunc init_func;
CU_CleanupFunc cleanup_func;
int nb_tests;
test_t *tests;
} test_suite_t;
#include "tester_utils.h"
#ifdef __cplusplus
......@@ -59,17 +42,12 @@ extern test_suite_t refresher_test_suite;
extern test_suite_t http_test_suite;
extern int belle_sip_tester_ipv6_available(void);
extern int belle_sip_tester_nb_test_suites(void);
extern int belle_sip_tester_nb_tests(const char *suite_name);
extern const char * belle_sip_tester_test_suite_name(int suite_index);
extern const char * belle_sip_tester_test_name(const char *suite_name, int test_index);
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_writable_dir_prefix;
extern const char* belle_sip_tester_client_cert;
extern const char* belle_sip_tester_client_cert_fingerprint;
extern const char* belle_sip_tester_private_key;
......
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