Commit a2ab682a authored by Pekka Pessi's avatar Pekka Pessi

check_nua: moved to libsofia-sip-ua/nua

darcs-hash:20080507183706-db55f-d785a8a34a8edd9334a72d85afebbb63f16cd7b5.gz
parent 6a27305a
...@@ -16,6 +16,11 @@ noinst_LTLIBRARIES = libnua.la ...@@ -16,6 +16,11 @@ noinst_LTLIBRARIES = libnua.la
check_PROGRAMS = check_PROGRAMS =
TESTS = TESTS =
if HAVE_CHECK
check_PROGRAMS += check_nua
TESTS += check_nua
endif
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Rules for building the targets # Rules for building the targets
...@@ -38,6 +43,28 @@ libnua_la_SOURCES = nua.c nua_stack.h nua_common.c nua_stack.c \ ...@@ -38,6 +43,28 @@ libnua_la_SOURCES = nua.c nua_stack.h nua_common.c nua_stack.c \
COVERAGE_INPUT = $(libnua_la_SOURCES) $(include_sofia_HEADERS) COVERAGE_INPUT = $(libnua_la_SOURCES) $(include_sofia_HEADERS)
check_nua_SOURCES = check_nua.c check_nua.h check_session.c \
s2tester.h s2tester.c
check_nua_LDADD = $(nua_libs) @CHECK_LIBS@
nua_libs = libnua.la \
../iptsec/libiptsec.la \
../ipt/libipt.la \
../nea/libnea.la \
../nta/libnta.la \
../sresolv/libsresolv.la \
../tport/libtport.la \
../stun/libstun.la \
../soa/libsoa.la \
../sdp/libsdp.la \
../sip/libsip.la \
../http/libhttp.la \
../msg/libmsg.la \
../url/liburl.la \
../bnf/libbnf.la \
../su/libsu.la
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Install and distribution rules # Install and distribution rules
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "config.h" #include "config.h"
#include "check2_sofia.h" #include "check_nua.h"
#include <stdlib.h> #include <stdlib.h>
...@@ -41,16 +41,18 @@ int main(int argc, char *argv[]) ...@@ -41,16 +41,18 @@ int main(int argc, char *argv[])
{ {
int failed = 0; int failed = 0;
Suite *suite; Suite *suite = suite_create("Unit tests for Sofia-SIP UA Engine");
SRunner *runner; SRunner *runner;
suite = suite2_for_nua(); check_register_cases(suite);
check_session_cases(suite);
runner = srunner_create(suite); runner = srunner_create(suite);
if (argv[1]) { if (argv[1]) {
srunner_set_xml(runner, argv[1]); srunner_set_xml(runner, argv[1]);
} }
srunner_run_all(runner, CK_VERBOSE); srunner_run_all(runner, CK_ENV);
failed = srunner_ntests_failed(runner); failed = srunner_ntests_failed(runner);
srunner_free(runner); srunner_free(runner);
......
#ifndef CHECK_NUA_H
#include <check.h>
void check_session_cases(Suite *suite);
void check_register_cases(Suite *suite);
#endif
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* *
*/ */
/**@CFILE suite2_for_nua.c /**@CFILE check_session.c
* *
* @brief Check-driven tester for Sofia SIP User Agent library * @brief Check-driven tester for Sofia SIP User Agent library
* *
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "config.h" #include "config.h"
#include "check2_sofia.h" #include "check_nua.h"
#include "s2tester.h" #include "s2tester.h"
...@@ -113,6 +113,11 @@ TCase *register_tcase(void) ...@@ -113,6 +113,11 @@ TCase *register_tcase(void)
return tc; return tc;
} }
void check_register_cases(Suite *suite)
{
suite_add_tcase(suite, register_tcase());
}
/* ====================================================================== */ /* ====================================================================== */
/* Call cases */ /* Call cases */
...@@ -1476,9 +1481,8 @@ TCase *empty_tcase(void) ...@@ -1476,9 +1481,8 @@ TCase *empty_tcase(void)
/* Suite used to debug single test case */ /* Suite used to debug single test case */
Suite *suite2_for_nua(void) void check_session_cases(Suite *suite)
{ {
Suite *suite = suite_create("Debug suite");
TCase *tc = tcase_create("debug"); TCase *tc = tcase_create("debug");
setenv("CK_FORK", "no", 1); setenv("CK_FORK", "no", 1);
...@@ -1486,17 +1490,12 @@ Suite *suite2_for_nua(void) ...@@ -1486,17 +1490,12 @@ Suite *suite2_for_nua(void)
tcase_add_checked_fixture(tc, call_setup, call_teardown); tcase_add_checked_fixture(tc, call_setup, call_teardown);
tcase_add_test(tc, s2_empty); tcase_add_test(tc, s2_empty);
suite_add_tcase(suite, tc); suite_add_tcase(suite, tc);
return suite;
} }
#else #else
Suite *suite2_for_nua(void) void check_session_cases(Suite *suite)
{ {
Suite *suite = suite_create("Sofia-SIP UA suite 2");
suite_add_tcase(suite, register_tcase());
suite_add_tcase(suite, invite_tcase()); suite_add_tcase(suite, invite_tcase());
suite_add_tcase(suite, cancel_tcase()); suite_add_tcase(suite, cancel_tcase());
suite_add_tcase(suite, session_timer_tcase()); suite_add_tcase(suite, session_timer_tcase());
...@@ -1506,8 +1505,6 @@ Suite *suite2_for_nua(void) ...@@ -1506,8 +1505,6 @@ Suite *suite2_for_nua(void)
if (0) /* Template */ if (0) /* Template */
suite_add_tcase(suite, empty_tcase()); suite_add_tcase(suite, empty_tcase());
return suite;
} }
#endif #endif
#ifndef CHECK2_SOFIA_H
#include <check.h>
Suite *suite2_for_nua(void);
#endif
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