diff options
author | zmiao <miao.zhao@mapbox.com> | 2020-01-21 23:23:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-21 23:23:35 +0200 |
commit | 1ade6c77849aec2c8486a568720258547aa1d670 (patch) | |
tree | 4c2dc4cf31f24aa6df15716265858cc6e1859fdc /next/platform | |
parent | 6dc435f66465eff76e730053d80efae90fa249c5 (diff) | |
download | qtlocation-mapboxgl-1ade6c77849aec2c8486a568720258547aa1d670.tar.gz |
[test-runner] Enable IOS RenderTestRunner and run it on Firebase (#16111)
* [test-runner] Setup iOS RenderTestRunner
* [test-runner] Make app runnable on firebase
* Add iOS platform dependent expectation and ignores; Run prepare script via cmake
* Make RenderTestRunner report test status
Diffstat (limited to 'next/platform')
-rw-r--r-- | next/platform/ios/ios.cmake | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/next/platform/ios/ios.cmake b/next/platform/ios/ios.cmake index 0de0fc1ddc..9f50f6a529 100644 --- a/next/platform/ios/ios.cmake +++ b/next/platform/ios/ios.cmake @@ -23,6 +23,7 @@ target_sources( ${MBGL_ROOT}/platform/darwin/src/collator.mm ${MBGL_ROOT}/platform/darwin/src/gl_functions.cpp ${MBGL_ROOT}/platform/darwin/src/headless_backend_eagl.mm + ${MBGL_ROOT}/platform/darwin/src/native_apple_interface.m ${MBGL_ROOT}/platform/darwin/src/http_file_source.mm ${MBGL_ROOT}/platform/darwin/src/native_apple_interface.m ${MBGL_ROOT}/platform/darwin/src/image.mm @@ -56,6 +57,8 @@ target_sources( ${MBGL_ROOT}/platform/default/src/mbgl/util/png_writer.cpp ${MBGL_ROOT}/platform/default/src/mbgl/util/thread_local.cpp ${MBGL_ROOT}/platform/default/src/mbgl/util/utf.cpp + ${MBGL_ROOT}/platform/default/src/mbgl/util/thread_local.cpp + ${MBGL_ROOT}/platform/default/src/mbgl/layermanager/layer_manager.cpp ) target_include_directories( @@ -90,4 +93,101 @@ target_link_libraries( z ) +if(MBGL_IOS_RENDER_TEST) + set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") + + set(PREPARE_CMD "${MBGL_ROOT}/render-test/ios/setup_test_data.sh") + message("COMMAND: ${PREPARE_CMD}") + execute_process(COMMAND ${PREPARE_CMD} RESULT_VARIABLE CMD_ERROR) + message(STATUS "CMD_ERROR:" ${CMD_ERROR}) + + set(RESOURCES ${MBGL_ROOT}/render-test/ios/Main.storyboard ${MBGL_ROOT}/render-test/ios/LaunchScreen.storyboard ${MBGL_ROOT}/test-data) + + set(PUBLIC_HEADER ${MBGL_ROOT}/render-test/ios/iosTestRunner.h) + + add_executable( + RenderTestApp + ${MBGL_ROOT}/render-test/ios/ios_test_runner.hpp + ${MBGL_ROOT}/render-test/ios/ios_test_runner.cpp + ${MBGL_ROOT}/render-test/ios/AppDelegate.h + ${MBGL_ROOT}/render-test/ios/AppDelegate.m + ${MBGL_ROOT}/render-test/ios/ViewController.h + ${MBGL_ROOT}/render-test/ios/ViewController.m + ${MBGL_ROOT}/render-test/ios/iosTestRunner.h + ${MBGL_ROOT}/render-test/ios/iosTestRunner.mm + ${MBGL_ROOT}/render-test/ios/main.m + ${RESOURCES} + ) + + initialize_ios_target(RenderTestApp) + # Turn on ARC + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-arc") + + set_target_properties( + RenderTestApp + PROPERTIES + MACOSX_BUNDLE + TRUE + MACOSX_BUNDLE_IDENTIFIER + com.mapbox.RenderTestAPP + MACOSX_BUNDLE_INFO_PLIST + ${MBGL_ROOT}/render-test/ios/Info.plist + RESOURCE + "${RESOURCES}" + ) + + target_include_directories( + RenderTestApp + PUBLIC {MBGL_ROOT}/render-test/include ${MBGL_ROOT}/include + ) + + target_include_directories( + RenderTestApp + PRIVATE + ${MBGL_ROOT}/platform/darwin/src + ${MBGL_ROOT}/platform/darwin/include + ${MBGL_ROOT}/platform/darwin/include/mbgl/interface/ + ${MBGL_ROOT}/platform/default/include + ${MBGL_ROOT}/src + ) + + target_include_directories( + RenderTestApp + PUBLIC ${MBGL_ROOT}/render-test/ios + ) + + target_link_libraries( + RenderTestApp + PRIVATE + "-framework CoreGraphics" + "-framework CoreLocation" + "-framework Foundation" + "-framework OpenGLES" + "-framework QuartzCore" + "-framework UIKit" + mbgl-render-test + ) + + find_package(XCTest REQUIRED) + + xctest_add_bundle(RenderTestAppTests RenderTestApp ${MBGL_ROOT}/render-test/ios/tests/Tests.m) + + set_target_properties( + RenderTestAppTests + PROPERTIES + XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET + "${IOS_DEPLOYMENT_TARGET}" + XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH + $<$<CONFIG:Debug>:YES> + ) + + target_include_directories( + RenderTestAppTests + PUBLIC ${MBGL_ROOT}/render-test/ios + ) + + xctest_add_test(XCTest.RenderTestApp RenderTestAppTests) + + set_target_properties(RenderTestAppTests PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${MBGL_ROOT}/render-test/ios/tests/Info.plist) +endif() unset(IOS_DEPLOYMENT_TARGET CACHE) |