summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/ios/ios-test-runners.cmake12
-rw-r--r--platform/ios/ios.cmake4
-rwxr-xr-xrender-test/ios/setup_test_data.sh33
3 files changed, 32 insertions, 17 deletions
diff --git a/platform/ios/ios-test-runners.cmake b/platform/ios/ios-test-runners.cmake
index 0caa900cea..d407f615d4 100644
--- a/platform/ios/ios-test-runners.cmake
+++ b/platform/ios/ios-test-runners.cmake
@@ -2,11 +2,16 @@ if(MBGL_IOS_RENDER_TEST)
include(${PROJECT_SOURCE_DIR}/vendor/zip-archive.cmake)
initialize_ios_target(mbgl-vendor-zip-archive)
- set(PREPARE_CMD "${PROJECT_SOURCE_DIR}/render-test/ios/setup_test_data.sh")
- execute_process(COMMAND ${PREPARE_CMD} RESULT_VARIABLE CMD_ERROR WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
+ if(MBGL_WITH_OPENGL)
+ message("-- Setting up test data for iOS render test with OpenGL renderer")
+ set(PREPARE_CMD "${PROJECT_SOURCE_DIR}/render-test/ios/setup_test_data.sh")
+ endif()
+ add_custom_target(RenderTestApp-prepare COMMAND ${PREPARE_CMD} ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
+
+ execute_process(COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/test-data RESULT_VARIABLE CMD_ERROR WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
set(RESOURCES ${PROJECT_SOURCE_DIR}/platform/ios/test/common/Main.storyboard
- ${PROJECT_SOURCE_DIR}/platform/ios/test/common/LaunchScreen.storyboard ${PROJECT_SOURCE_DIR}/test-data)
+ ${PROJECT_SOURCE_DIR}/platform/ios/test/common/LaunchScreen.storyboard ${CMAKE_CURRENT_BINARY_DIR}/test-data)
add_executable(
RenderTestApp
@@ -20,6 +25,7 @@ if(MBGL_IOS_RENDER_TEST)
${RESOURCES}
)
initialize_ios_target(RenderTestApp)
+ add_dependencies(RenderTestApp RenderTestApp-prepare)
set_target_properties(
RenderTestApp
diff --git a/platform/ios/ios.cmake b/platform/ios/ios.cmake
index 8d7eafdb7f..8b5696e481 100644
--- a/platform/ios/ios.cmake
+++ b/platform/ios/ios.cmake
@@ -74,7 +74,9 @@ target_include_directories(
include(${PROJECT_SOURCE_DIR}/vendor/icu.cmake)
# include(${PROJECT_SOURCE_DIR}/platform/ios/ccache.cmake)
-include(${PROJECT_SOURCE_DIR}/platform/ios/ios-test-runners.cmake)
+if(MBGL_WITH_OPENGL)
+ include(${PROJECT_SOURCE_DIR}/platform/ios/ios-test-runners.cmake)
+endif()
initialize_ios_target(mbgl-core)
initialize_ios_target(mbgl-vendor-csscolorparser)
diff --git a/render-test/ios/setup_test_data.sh b/render-test/ios/setup_test_data.sh
index 0461622341..6e43779918 100755
--- a/render-test/ios/setup_test_data.sh
+++ b/render-test/ios/setup_test_data.sh
@@ -1,17 +1,24 @@
#!/bin/bash
-rm -rf test-data/
+if [ $# -eq 0 ]; then
+ echo "Give base directory as argument, eg. 'build'"
+ exit 1
+fi
-mkdir -p test-data/integration/
-mkdir -p test-data/baselines/
+BASE_DIR=$1
-cp -r mapbox-gl-js/test/integration/render-tests test-data/integration/
-cp -r mapbox-gl-js/test/integration/query-tests test-data/integration/
-cp -r metrics/expectations test-data/
-cp -r metrics/ignores test-data/
-cp -r metrics/tests test-data/
-cp -r metrics/ios-render-test-runner test-data/
-cp -r metrics/ios-render-test-runner-style.json test-data/
-cp -r metrics/ios-render-test-runner-metrics.json test-data/
-cp -r metrics/cache-metrics.db test-data/
-cp -r metrics/cache-style.db test-data/
+rm -rf $BASE_DIR/test-data/
+
+mkdir -p $BASE_DIR/test-data/integration/
+mkdir -p $BASE_DIR/test-data/baselines/
+
+cp -r mapbox-gl-js/test/integration/render-tests $BASE_DIR/test-data/integration/
+cp -r mapbox-gl-js/test/integration/query-tests $BASE_DIR/test-data/integration/
+cp -r metrics/expectations $BASE_DIR/test-data/
+cp -r metrics/ignores $BASE_DIR/test-data/
+cp -r metrics/tests $BASE_DIR/test-data/
+cp -r metrics/ios-render-test-runner $BASE_DIR/test-data/
+cp -r metrics/ios-render-test-runner-style.json $BASE_DIR/test-data/
+cp -r metrics/ios-render-test-runner-metrics.json $BASE_DIR/test-data/
+cp -r metrics/cache-metrics.db $BASE_DIR/test-data/
+cp -r metrics/cache-style.db $BASE_DIR/test-data/