tester: add support of tests execution on iOS

parent acdd3074
......@@ -20,6 +20,19 @@
#
############################################################################
if(ENABLE_STATIC)
set(MS2_LIBS_FOR_TOOLS mediastreamer_voip-static mediastreamer_base-static)
if(XV_FOUND)
list(APPEND MS2_LIBS_FOR_TOOLS Xext)
endif()
else()
set(MS2_LIBS_FOR_TOOLS mediastreamer_voip mediastreamer_base)
endif()
set(RESOURCES_FILES
sounds
scenarios
)
set(SOURCE_FILES_C
mediastreamer2_adaptive_tester.c
mediastreamer2_audio_stream_tester.c
......@@ -55,7 +68,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_library(mediastreamer2_tester_static STATIC ${SOURCE_FILES_C})
target_include_directories(mediastreamer2_tester_static PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(mediastreamer2_tester_static mediastreamer_voip mediastreamer_base ${BCTOOLBOX_TESTER_LIBRARIES})
target_link_libraries(mediastreamer2_tester_static ${MS2_LIBS_FOR_TOOLS} ${BCTOOLBOX_TESTER_LIBRARIES})
set(RUNTIME_COMPONENT_SOURCES
mediastreamer2_tester_windows.cpp
......@@ -83,13 +96,18 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
endif()
else()
add_executable(mediastreamer2_tester ${SOURCE_FILES_C} ${SOURCE_FILES_OBJC})
if (IOS)
set_source_files_properties(${RESOURCES_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
add_executable(mediastreamer2_tester MACOSX_BUNDLE ${RESOURCES_FILES} ${SOURCE_FILES_C} ${SOURCE_FILES_OBJC})
else()
add_executable(mediastreamer2_tester ${SOURCE_FILES_C} ${SOURCE_FILES_OBJC})
endif()
target_include_directories(mediastreamer2_tester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(mediastreamer2_tester mediastreamer_voip mediastreamer_base ${BCTOOLBOX_TESTER_LIBRARIES})
target_link_libraries(mediastreamer2_tester ${MS2_LIBS_FOR_TOOLS} ${BCTOOLBOX_TESTER_LIBRARIES})
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(LINK_FLAGS_STR)
set_target_properties(mediastreamer2_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
endif()
......@@ -109,7 +109,7 @@ int main (int argc, char *argv[]) {
// this allows to launch tester from outside of tester directory
if (strstr(argv[0], ".libs")) {
int prefix_length = strstr(argv[0], ".libs") - argv[0] + 1;
long prefix_length = strstr(argv[0], ".libs") - argv[0] + 1;
char *prefix = ms_strdup_printf("%s%.*s", argv[0][0] == '/' ? "" : "./", prefix_length, argv[0]);
ms_warning("Resource prefix set to %s", prefix);
bc_tester_set_resource_dir_prefix(prefix);
......
......@@ -41,6 +41,7 @@ static void* _apple_main(void* data) {
bc_tester_set_resource_dir_prefix([bundlePath UTF8String]);
bc_tester_set_writable_dir_prefix([documentPath UTF8String]);
apple_main(g_argc,g_argv);
[bundlePath release];
......
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