From 039dc443dd9fba1d2e519b418cd396592fc55a5e Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 2 Mar 2016 10:34:23 +0100 Subject: [PATCH 1/8] Update oRTP and ms2 submodules. --- mediastreamer2 | 2 +- oRTP | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mediastreamer2 b/mediastreamer2 index b0fa19899..85798979c 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit b0fa19899afe3a30ab85f74cc6711207934cd57d +Subproject commit 85798979cc2a3cbd67151128ffe83806c34c8236 diff --git a/oRTP b/oRTP index de0aee3f2..987813308 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit de0aee3f2024cfd1a24fee5f4ed56be5a2032206 +Subproject commit 987813308e9947c4f6e3502168c7ea6775a72ff0 From cc8565574f203c0bfdf229540b0485d20b72281d Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 2 Mar 2016 13:51:20 +0100 Subject: [PATCH 2/8] Find tester component of bctoolbox for tester build + do not use object library. --- CMakeLists.txt | 7 ++++--- cmake/LinphoneConfig.cmake.in | 6 +++++- coreapi/CMakeLists.txt | 12 +++++------- mediastreamer2 | 2 +- oRTP | 2 +- tester/CMakeLists.txt | 12 ++++++------ 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0596bcb1c..da54f1764 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,11 +98,12 @@ endif() if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS) include("${EP_bellesip_CONFIG_DIR}/BelleSIPConfig.cmake") include("${EP_ms2_CONFIG_DIR}/Mediastreamer2Config.cmake") + set(BcToolbox_FIND_COMPONENTS tester) include("${EP_bctoolbox_CONFIG_DIR}/BcToolboxConfig.cmake") else() find_package(BelleSIP REQUIRED) find_package(Mediastreamer2 REQUIRED) - find_package(BcToolbox REQUIRED) + find_package(BcToolbox REQUIRED OPTIONAL_COMPONENTS tester) endif() find_package(XML2 REQUIRED) find_package(Zlib) @@ -176,7 +177,7 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/coreapi/ ${BELLESIP_INCLUDE_DIRS} ${MEDIASTREAMER2_INCLUDE_DIRS} - ${BCTOOLBOX_INCLUDE_DIRS} + ${BCTOOLBOX_CORE_INCLUDE_DIRS} ) if(ENABLE_TUNNEL) include_directories(${TUNNEL_INCLUDE_DIRS}) @@ -283,7 +284,7 @@ endif() if(ENABLE_TOOLS) add_subdirectory(tools) endif() -if(ENABLE_UNIT_TESTS) +if(ENABLE_UNIT_TESTS AND BCTOOLBOX_TESTER_FOUND) add_subdirectory(tester) endif() diff --git a/cmake/LinphoneConfig.cmake.in b/cmake/LinphoneConfig.cmake.in index b636612a5..dc815f62f 100644 --- a/cmake/LinphoneConfig.cmake.in +++ b/cmake/LinphoneConfig.cmake.in @@ -36,7 +36,11 @@ endif() find_package(Mediastreamer2 REQUIRED) find_package(BelleSIP REQUIRED) if(@ENABLE_TUNNEL@) - find_package(Tunnel) + if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS) + include("${EP_tunnel_CONFIG_DIR}/TunnelConfig.cmake") + else() + find_package(Tunnel) + endif() endif() get_filename_component(LINPHONE_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index e0f9e263f..e51ff1e0f 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -149,7 +149,7 @@ apply_compile_flags(LINPHONE_SOURCE_FILES_CXX "CPP" "CXX") apply_compile_flags(LINPHONE_SOURCE_FILES_OBJC "CPP" "OBJC") set(LIBS - ${BCTOOLBOX_LIBRARIES} + ${BCTOOLBOX_CORE_LIBRARIES} ${BELLESIP_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES} ${XML2_LIBRARIES} @@ -176,13 +176,10 @@ if(INTL_FOUND) list(APPEND LIBS ${INTL_LIBRARIES}) endif() -add_library(linphone-objects OBJECT ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC}) -set_target_properties(linphone-objects PROPERTIES POSITION_INDEPENDENT_CODE TRUE) -add_dependencies(linphone-objects liblinphone-git-version) - if(ENABLE_STATIC) - add_library(linphone-static STATIC $) + add_library(linphone-static STATIC ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC}) set_target_properties(linphone-static PROPERTIES OUTPUT_NAME linphone) + add_dependencies(linphone-static liblinphone-git-version) target_link_libraries(linphone-static ${LIBS}) if(IOS) target_link_libraries(linphone-static "-framework Foundation" "-framework AVFoundation") @@ -193,8 +190,9 @@ if(ENABLE_STATIC) ) endif() if(ENABLE_SHARED) - add_library(linphone SHARED $) + add_library(linphone SHARED ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC}) set_target_properties(linphone PROPERTIES VERSION ${LINPHONE_SO_VERSION} LINKER_LANGUAGE CXX) + add_dependencies(linphone liblinphone-git-version) target_link_libraries(linphone ${LIBS}) if(WIN32 AND CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") set_target_properties(linphone PROPERTIES PREFIX "lib") diff --git a/mediastreamer2 b/mediastreamer2 index 85798979c..7ae38a0cc 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 85798979cc2a3cbd67151128ffe83806c34c8236 +Subproject commit 7ae38a0cc81e6da5b0b2b55562929a1687e4fd37 diff --git a/oRTP b/oRTP index 987813308..82fc70766 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 987813308e9947c4f6e3502168c7ea6775a72ff0 +Subproject commit 82fc707667486072a09ba904a8cf03edf68f700e diff --git a/tester/CMakeLists.txt b/tester/CMakeLists.txt index 1cf6c75fa..1be9fd5d3 100644 --- a/tester/CMakeLists.txt +++ b/tester/CMakeLists.txt @@ -62,8 +62,8 @@ add_definitions(-DBC_CONFIG_FILE="config.h") if(IOS) add_library(linphonetester STATIC ${SOURCE_FILES}) - target_include_directories(linphonetester PUBLIC ${BCTOOLBOX_INCLUDE_DIRS}) - target_link_libraries(linphonetester linphone ${BCTOOLBOX_LIBRARIES}) + target_include_directories(linphonetester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS}) + target_link_libraries(linphonetester linphone ${BCTOOLBOX_TESTER_LIBRARIES}) install(TARGETS linphonetester RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -76,8 +76,8 @@ if(IOS) ) elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") add_library(linphone_tester_static STATIC ${SOURCE_FILES}) - target_include_directories(linphone_tester_static PUBLIC ${BCTOOLBOX_INCLUDE_DIRS}) - target_link_libraries(linphone_tester_static linphone ${BCTOOLBOX_LIBRARIES}) + target_include_directories(linphone_tester_static PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS}) + target_link_libraries(linphone_tester_static linphone ${BCTOOLBOX_TESTER_LIBRARIES}) set(RUNTIME_COMPONENT_SOURCES liblinphone_tester_windows.cpp @@ -106,8 +106,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") else() add_executable(liblinphone_tester ${SOURCE_FILES}) set_target_properties(liblinphone_tester PROPERTIES LINKER_LANGUAGE CXX) - target_include_directories(liblinphone_tester PUBLIC ${BCTOOLBOX_INCLUDE_DIRS}) - target_link_libraries(liblinphone_tester linphone ${BCTOOLBOX_LIBRARIES}) + target_include_directories(liblinphone_tester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS}) + target_link_libraries(liblinphone_tester linphone ${BCTOOLBOX_TESTER_LIBRARIES}) if (GTK2_FOUND) target_compile_definitions(liblinphone_tester PRIVATE HAVE_GTK) target_include_directories(liblinphone_tester PUBLIC ${GTK2_INCLUDE_DIRS}) From 283b03521d885384f17e1d34968cdaebab0205a3 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Wed, 2 Mar 2016 14:33:07 +0100 Subject: [PATCH 3/8] tester: do not reference cunit anymore, use bctoolbox instead --- tester/liblinphone_tester.c | 8 ++------ tester/tester.c | 12 ++++-------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/tester/liblinphone_tester.c b/tester/liblinphone_tester.c index 64cff523d..ff785448a 100644 --- a/tester/liblinphone_tester.c +++ b/tester/liblinphone_tester.c @@ -20,9 +20,6 @@ #include "linphonecore.h" #include "private.h" #include "liblinphone_tester.h" -#if HAVE_CU_CURSES -#include "CUnit/CUCurses.h" -#endif #if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) #pragma GCC diagnostic push @@ -44,7 +41,6 @@ static FILE * log_file = NULL; #include #include -#include #define CALLBACK_BUFFER_SIZE 1024 static JNIEnv *current_env = NULL; @@ -113,10 +109,10 @@ JNIEXPORT jint JNICALL Java_org_linphone_tester_Tester_run(JNIEnv *env, jobject } current_env = env; current_obj = obj; - CU_set_trace_handler(cunit_android_trace_handler); + bc_set_trace_handler(cunit_android_trace_handler); ret = main(argc, argv); current_env = NULL; - CU_set_trace_handler(NULL); + bc_set_trace_handler(NULL); for (i=0; i #if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) #pragma GCC diagnostic push #endif #pragma GCC diagnostic ignored "-Wstrict-prototypes" -#include "CUnit/TestRun.h" -#include "CUnit/Automated.h" -#if HAVE_CU_CURSES -#include "CUnit/CUCurses.h" -#endif #ifdef HAVE_GTK #include #endif @@ -270,7 +266,7 @@ bool_t transport_supported(LinphoneTransportType transport) { void linphone_core_manager_init(LinphoneCoreManager *mgr, const char* rc_file) { char *rc_path = NULL; char *hellopath = bc_tester_res("sounds/hello8000.wav"); - mgr->number_of_cunit_error_at_creation = CU_get_number_of_failures(); + mgr->number_of_cunit_error_at_creation = bc_get_number_of_failures(); mgr->v_table.registration_state_changed=registration_state_changed; mgr->v_table.auth_info_requested=auth_info_requested; mgr->v_table.call_state_changed=call_state_changed; @@ -368,7 +364,7 @@ void linphone_core_manager_start(LinphoneCoreManager *mgr, int check_for_proxies mgr->identity = linphone_address_clone(linphone_proxy_config_get_identity_address(proxy)); linphone_address_clean(mgr->identity); } - + if (linphone_core_get_stun_server(mgr->lc) != NULL){ /*before we go, ensure that the stun server is resolved, otherwise all ice related test will fail*/ BC_ASSERT_TRUE(wait_for_stun_resolution(mgr)); @@ -410,7 +406,7 @@ void linphone_core_manager_uninit(LinphoneCoreManager *mgr) { int unterminated_calls; if (!liblinphone_tester_keep_record_files && record_file){ - if ((CU_get_number_of_failures()-mgr->number_of_cunit_error_at_creation)>0) { + if ((bc_get_number_of_failures()-mgr->number_of_cunit_error_at_creation)>0) { ms_message ("Test has failed, keeping recorded file [%s]",record_file); } else { unlink(record_file); From c06b02babef17940bee3191ea20597b4268fb8cc Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Wed, 2 Mar 2016 14:42:10 +0100 Subject: [PATCH 4/8] submodules: update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 7ae38a0cc..ec38b1be2 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 7ae38a0cc81e6da5b0b2b55562929a1687e4fd37 +Subproject commit ec38b1be29cc26870fe3954d06bb1958d95d4898 From 7ca84fc81719afd1a22781cc130f7b6c1ce296f4 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Wed, 2 Mar 2016 14:47:48 +0100 Subject: [PATCH 5/8] submodules: update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index ec38b1be2..2a3a1ecc9 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit ec38b1be29cc26870fe3954d06bb1958d95d4898 +Subproject commit 2a3a1ecc9ebf793910a9043edcb44daa463f6aa4 From 804a7e3ee836c390b6a211639a06d417574504d4 Mon Sep 17 00:00:00 2001 From: Sandrine Avakian Date: Wed, 2 Mar 2016 14:56:31 +0100 Subject: [PATCH 6/8] Update mediastreamer2. --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 2a3a1ecc9..ec37937a5 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 2a3a1ecc9ebf793910a9043edcb44daa463f6aa4 +Subproject commit ec37937a58daeee742099b24575648883fdff341 From bc057a4bf9c9e990fe8e865cee5b3ac2646608fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Wed, 2 Mar 2016 15:59:44 +0100 Subject: [PATCH 7/8] Update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index ec37937a5..5e653bfe4 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit ec37937a58daeee742099b24575648883fdff341 +Subproject commit 5e653bfe4c8ea27d09c80d91794f0178a454851e From c33219b33b76e30ac30983e0b43b95f6b0fba59b Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Wed, 2 Mar 2016 16:05:39 +0100 Subject: [PATCH 8/8] autotools: use bctoolbox-tester instead of cunit --- Makefile.am | 4 ++-- configure.ac | 33 ++++----------------------------- tester/Makefile.am | 14 +++++++------- 3 files changed, 13 insertions(+), 38 deletions(-) diff --git a/Makefile.am b/Makefile.am index f080b33b1..18d95f563 100644 --- a/Makefile.am +++ b/Makefile.am @@ -244,7 +244,7 @@ pkg: $(MACAPPNAME) cp ${srcdir}/pixmaps/linphone.png ./packaging pkgbuild --install-location /Applications --scripts ${srcdir}/build/macos/pkg-scripts --component $(MACAPPNAME) ./packaging/linphone.pkg productbuild --resources . --distribution ${srcdir}/build/macos/pkg-distribution.xml --package-path ./packaging $(MACAPPPKG) - + signed-pkg: pkg mv $(MACAPPPKG) $(MACAPPPKG).tmp productsign --sign "$(BUNDLE_SIGNING_ID)" $(MACAPPPKG).tmp $(MACAPPPKG) @@ -259,7 +259,7 @@ clean-local: discovery: touch specs.c $(CC) --include $(top_builddir)/config.h \ - $(TUNNEL_CFLAGS) $(CFLAGS) $(MEDIASTREAMER2_CFLAGS) $(ORTP_CFLAGS) $(SIPSTACK_CFLAGS) $(CUNIT_CFLAGS) -E -P -v -dD specs.c + $(TUNNEL_CFLAGS) $(CFLAGS) $(MEDIASTREAMER2_CFLAGS) $(ORTP_CFLAGS) $(SIPSTACK_CFLAGS) $(BCTOOLBOXTESTER_CFLAGS) -E -P -v -dD specs.c .PHONY: $(MACAPPNAME) pkg diff --git a/configure.ac b/configure.ac index 8392b79f4..0f568997a 100644 --- a/configure.ac +++ b/configure.ac @@ -1000,36 +1000,11 @@ AC_ARG_ENABLE(tests, ) AM_CONDITIONAL(ENABLE_TESTS, test x$tests_enabled = xyes) -PKG_CHECK_MODULES(CUNIT, cunit, [found_cunit=yes],[found_cunit=no]) +PKG_CHECK_MODULES(BCTOOLBOXTESTER, bctoolbox-tester, [found_pkg_config_bctoolboxtester=yes],[found_pkg_config_bctoolboxtester=no]) -if test "$found_cunit" = "no" ; then - AC_CHECK_HEADERS(CUnit/CUnit.h, - [ - AC_CHECK_LIB(cunit,CU_add_suite,[ - found_cunit=yes - CUNIT_LIBS+=" -lcunit" - ]) - - ]) -fi - -case "$target_os" in - *darwin*) - #hack for macport - CUNIT_LIBS+=" -lncurses" - ;; -esac -AM_CONDITIONAL([BUILD_CUNIT_TESTS], [test x$found_cunit = xyes && test x$tests_enabled != xfalse]) -if test "$found_cunit" = "no" ; then - AC_MSG_WARN([Could not find cunit framework, tests are not compiled.]) -else - AC_CHECK_LIB(cunit,CU_get_suite,[ - AC_DEFINE(HAVE_CU_GET_SUITE,1,[defined when CU_get_suite is available]) - ],[foo=bar],[$CUNIT_LIBS]) - - AC_CHECK_LIB(cunit,CU_curses_run_tests,[ - AC_DEFINE(HAVE_CU_CURSES,1,[defined when CU_curses_run_tests is available]) - ],[foo=bar],[$CUNIT_LIBS]) +AM_CONDITIONAL([ENABLE_TESTS], [test x$found_pkg_config_bctoolboxtester = xyes && test x$tests_enabled != xfalse]) +if test "$found_pkg_config_bctoolboxtester" = "no" ; then + AC_MSG_WARN([Could not find bctoolbox-tester wrapper, tests are not compiled.]) fi diff --git a/tester/Makefile.am b/tester/Makefile.am index 83fef6374..8d9ca9ec8 100644 --- a/tester/Makefile.am +++ b/tester/Makefile.am @@ -83,7 +83,7 @@ EXTRA_DIST = tester_hosts\ -if BUILD_CUNIT_TESTS +if ENABLE_TESTS sounddir = $(datadir)/liblinphone_tester/sounds sound_DATA = $(TESTER_SOUNDS) @@ -131,12 +131,12 @@ liblinphonetester_la_SOURCES = \ tunnel_tester.c \ tester.c \ upnp_tester.c \ - video_tester.c + video_tester.c liblinphonetester_ladir = $(includedir)/linphone liblinphonetester_la_LDFLAGS= -no-undefined -liblinphonetester_la_LIBADD= ../coreapi/liblinphone.la $(CUNIT_LIBS) +liblinphonetester_la_LIBADD= ../coreapi/liblinphone.la $(BCTOOLBOXTESTER_LIBS) liblinphone_tester_bindir = $(bindir)/liblinphone_tester liblinphone_testerdir = $(datadir)/liblinphone_tester @@ -146,7 +146,7 @@ dist_liblinphone_tester_DATA = tester_hosts messages.db AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/coreapi -I$(top_srcdir)/tester/common AM_CFLAGS = -DBC_CONFIG_FILE=\"config.h\" $(STRICT_OPTIONS) $(STRICT_OPTIONS_CC) \ - -DIN_LINPHONE $(ORTP_CFLAGS) $(MEDIASTREAMER_CFLAGS) $(CUNIT_CFLAGS) \ + -DIN_LINPHONE $(ORTP_CFLAGS) $(MEDIASTREAMER_CFLAGS) $(BCTOOLBOXTESTER_CFLAGS) \ $(BELLESIP_CFLAGS) $(LIBXML2_CFLAGS) $(SQLITE3_CFLAGS) if BUILD_GTK_UI @@ -173,9 +173,9 @@ endif test: liblinphone_tester ./liblinphone_tester --config $(abs_srcdir) $(TEST_OPTIONS) -else !BUILD_CUNIT_TESTS +else !ENABLE_TESTS test: - @echo "CUnit must be installed to be able to run the tests!" + @echo "bctoolbox-tester must be installed to be able to run the tests!" -endif !BUILD_CUNIT_TESTS +endif !ENABLE_TESTS