From 63ea5dc637048a7f508186799bb8245f47db30d6 Mon Sep 17 00:00:00 2001 From: Bart Louwers Date: Fri, 15 Mar 2024 15:57:56 +0100 Subject: [PATCH] Render Tests Maintenance (#2199) --- platform/android/DEVELOPING.md | 2 + platform/android/DISTRIBUTE.md | 6 +- render-test/android/app/build.gradle | 2 +- render-test/ios/README.md | 4 -- ...estApp_iphoneos13.2-arm64e-debug.xctestrun | 68 ------------------- ...tApp_iphoneos13.2-arm64e-release.xctestrun | 68 ------------------- .../RenderTestApp.app.xcent.template | 16 ----- .../RenderTestAppTests.xctest.xcent.template | 16 ----- ...AutomationSupport.framework.xcent.template | 16 ----- .../XCTest.framework.xcent.template | 16 ----- render-test/ios/codesigning/codesign_all.sh | 11 --- .../codesigning/generate-entitlements.swift | 40 ----------- ...libXCTestSwiftSupport.dylib.xcent.template | 16 ----- render-test/ios/fastlane/Appfile | 3 - render-test/ios/fastlane/Matchfile | 5 -- render-test/ios/setup_test_data.sh | 26 ------- 16 files changed, 6 insertions(+), 309 deletions(-) delete mode 100644 render-test/ios/RenderTestApp_iphoneos13.2-arm64e-debug.xctestrun delete mode 100644 render-test/ios/RenderTestApp_iphoneos13.2-arm64e-release.xctestrun delete mode 100644 render-test/ios/codesigning/RenderTestApp.app.xcent.template delete mode 100644 render-test/ios/codesigning/RenderTestAppTests.xctest.xcent.template delete mode 100644 render-test/ios/codesigning/XCTAutomationSupport.framework.xcent.template delete mode 100644 render-test/ios/codesigning/XCTest.framework.xcent.template delete mode 100755 render-test/ios/codesigning/codesign_all.sh delete mode 100755 render-test/ios/codesigning/generate-entitlements.swift delete mode 100644 render-test/ios/codesigning/libXCTestSwiftSupport.dylib.xcent.template delete mode 100644 render-test/ios/fastlane/Appfile delete mode 100644 render-test/ios/fastlane/Matchfile delete mode 100755 render-test/ios/setup_test_data.sh diff --git a/platform/android/DEVELOPING.md b/platform/android/DEVELOPING.md index 50222a13f..d4255015c 100644 --- a/platform/android/DEVELOPING.md +++ b/platform/android/DEVELOPING.md @@ -37,6 +37,8 @@ Run the configuration for the `MapboxGLAndroidSDKTestApp` module and select a de To run the render tests for Android, run the configuration for the `androidRenderTest.app` module. +More information on working on the render tests can be found [in the wiki](https://github.com/maplibre/maplibre-native/wiki/Working-on-Android-Render-Tests). + ## Instrumentation Tests To run the instrumentatin tests, find the `MapboxGLAndroidSDKTestApp` project in the sidebar, go to `src > androidTest`, right click and select "Run 'All Tests'". diff --git a/platform/android/DISTRIBUTE.md b/platform/android/DISTRIBUTE.md index 8f2bec19d..35a9880c5 100644 --- a/platform/android/DISTRIBUTE.md +++ b/platform/android/DISTRIBUTE.md @@ -1,6 +1,6 @@ -# Distributing Mapbox GL Native for Android +# Distributing MapLibre Native for Android -Depending on your use case, you may want to support all or just a subset of [Android ABIs](http://developer.android.com/ndk/guides/abis.html). This document covers building an `.aar` file from the Mapbox Maps SDK for Android and building `.so` files for specific ABIs. In normal circumstances an application developer will use [APK splits](https://developer.android.com/studio/build/configure-apk-splits.html) to optimize this at application level. +Depending on your use case, you may want to support all or just a subset of [Android ABIs](http://developer.android.com/ndk/guides/abis.html). This document covers building an `.aar` file from the MapLibre Native for Android and building `.so` files for specific ABIs. In normal circumstances an application developer will use [APK splits](https://developer.android.com/studio/build/configure-apk-splits.html) to optimize this at application level. ##### Build types @@ -24,7 +24,7 @@ This will build native libraries to support following ABIs: - x86_64 - mips -After succesfully finish building the native libraries, gradle will build the MapboxAndroidSDK module and generate an Android Archive file in `MapboxAndroidSDK/build/outputs/aar `. The packaged native libraries can be found in `MapboxAndroidSDK/src/main/jniLibs/`. +After successfully finish building the native libraries, Gradle will build the MapboxAndroidSDK module and generate an Android Archive file in `MapboxAndroidSDK/build/outputs/aar `. The packaged native libraries can be found in `MapboxAndroidSDK/src/main/jniLibs/`. ##### Build native libraries for a specific ABI diff --git a/render-test/android/app/build.gradle b/render-test/android/app/build.gradle index aa3ad60d9..bfea59f07 100644 --- a/render-test/android/app/build.gradle +++ b/render-test/android/app/build.gradle @@ -4,7 +4,7 @@ android { compileSdkVersion 33 defaultConfig { - applicationId = 'com.mapbox.mapboxsdk.maps.render_test_runner' + applicationId = 'org.maplibre.render_test_runner' minSdkVersion 21 targetSdkVersion 33 def abi = 'all' diff --git a/render-test/ios/README.md b/render-test/ios/README.md index d4c92bc7c..2c5a9c9dc 100644 --- a/render-test/ios/README.md +++ b/render-test/ios/README.md @@ -1,7 +1,3 @@ # iOS RenderTestRunner App -This is a blank single-view-controller iOS app, linked against to a C++ static libraries, plus a a simple unit xctest. We use CMake to create an Xcode-friendly out-of-source build system. In another word, the build system is maintained by `CMakeLists` file,instead of a configured `.xcodeproj` file. - -This CMake project can build the executable RenderTestApp which is linked to the static C++ library 'mbgl-render-test'. CMakeLists.txt files are the only build configuration kept in source control. This is in contrast to committing the `.xcodeproj` directory which includes the backing XML, which is nonsensically hard to edit by hand. - The test instantiates ObjC object of class `IosTestRunner` from the app, the class will instantiates a C++ object from the linked library `mbgl-render-test` and calls running render test function on it. It subsequently deletes the C++ object pointer. In the end, the test will check the existence of test reports, which are html files that attach to xctest result. diff --git a/render-test/ios/RenderTestApp_iphoneos13.2-arm64e-debug.xctestrun b/render-test/ios/RenderTestApp_iphoneos13.2-arm64e-debug.xctestrun deleted file mode 100644 index b92ac8c32..000000000 --- a/render-test/ios/RenderTestApp_iphoneos13.2-arm64e-debug.xctestrun +++ /dev/null @@ -1,68 +0,0 @@ - - - - - RenderTestAppTests - - BlueprintName - RenderTestAppTests - BundleIdentifiersForCrashReportEmphasis - - com.mapbox.RenderTestApp - com.mapbox.RenderTestAppTests - - CommandLineArguments - - DependentProductPaths - - __TESTROOT__/Debug-iphoneos/RenderTestApp.app - __TESTROOT__/Debug-iphoneos/RenderTestApp.app/PlugIns/RenderTestAppTests.xctest - - EnvironmentVariables - - OS_ACTIVITY_DT_MODE - YES - SQLITE_ENABLE_THREAD_ASSERTIONS - 1 - - IsAppHostedTestBundle - - ProductModuleName - RenderTestAppTests - RunOrder - 0 - SystemAttachmentLifetime - deleteOnSuccess - TestBundlePath - __TESTHOST__/PlugIns/RenderTestAppTests.xctest - TestHostBundleIdentifier - com.mapbox.RenderTestApp - TestHostPath - __TESTROOT__/Debug-iphoneos/RenderTestApp.app - TestLanguage - - TestRegion - - TestingEnvironmentVariables - - DYLD_FALLBACK_FRAMEWORK_PATH - - DYLD_INSERT_LIBRARIES - __PLATFORMS__/iPhoneOS.platform/Developer/usr/lib/libXCTestBundleInject.dylib - XCInjectBundleInto - unused - - ToolchainsSettingValue - - UITargetAppCommandLineArguments - - UserAttachmentLifetime - deleteOnSuccess - - __xctestrun_metadata__ - - FormatVersion - 1 - - - diff --git a/render-test/ios/RenderTestApp_iphoneos13.2-arm64e-release.xctestrun b/render-test/ios/RenderTestApp_iphoneos13.2-arm64e-release.xctestrun deleted file mode 100644 index 20ce81e9c..000000000 --- a/render-test/ios/RenderTestApp_iphoneos13.2-arm64e-release.xctestrun +++ /dev/null @@ -1,68 +0,0 @@ - - - - - RenderTestAppTests - - BlueprintName - RenderTestAppTests - BundleIdentifiersForCrashReportEmphasis - - com.mapbox.RenderTestApp - com.mapbox.RenderTestAppTests - - CommandLineArguments - - DependentProductPaths - - __TESTROOT__/Release-iphoneos/RenderTestApp.app - __TESTROOT__/Release-iphoneos/RenderTestApp.app/PlugIns/RenderTestAppTests.xctest - - EnvironmentVariables - - OS_ACTIVITY_DT_MODE - YES - SQLITE_ENABLE_THREAD_ASSERTIONS - 1 - - IsAppHostedTestBundle - - ProductModuleName - RenderTestAppTests - RunOrder - 0 - SystemAttachmentLifetime - deleteOnSuccess - TestBundlePath - __TESTHOST__/PlugIns/RenderTestAppTests.xctest - TestHostBundleIdentifier - com.mapbox.RenderTestApp - TestHostPath - __TESTROOT__/Release-iphoneos/RenderTestApp.app - TestLanguage - - TestRegion - - TestingEnvironmentVariables - - DYLD_FALLBACK_FRAMEWORK_PATH - - DYLD_INSERT_LIBRARIES - __PLATFORMS__/iPhoneOS.platform/Developer/usr/lib/libXCTestBundleInject.dylib - XCInjectBundleInto - unused - - ToolchainsSettingValue - - UITargetAppCommandLineArguments - - UserAttachmentLifetime - deleteOnSuccess - - __xctestrun_metadata__ - - FormatVersion - 1 - - - diff --git a/render-test/ios/codesigning/RenderTestApp.app.xcent.template b/render-test/ios/codesigning/RenderTestApp.app.xcent.template deleted file mode 100644 index 933c054b3..000000000 --- a/render-test/ios/codesigning/RenderTestApp.app.xcent.template +++ /dev/null @@ -1,16 +0,0 @@ - - - - - application-identifier - $TEAM_ID.com.mapbox.RenderTestApp - com.apple.developer.team-identifier - $TEAM_ID - get-task-allow - - keychain-access-groups - - $TEAM_ID.com.mapbox.RenderTestApp - - - \ No newline at end of file diff --git a/render-test/ios/codesigning/RenderTestAppTests.xctest.xcent.template b/render-test/ios/codesigning/RenderTestAppTests.xctest.xcent.template deleted file mode 100644 index c2138e492..000000000 --- a/render-test/ios/codesigning/RenderTestAppTests.xctest.xcent.template +++ /dev/null @@ -1,16 +0,0 @@ - - - - - application-identifier - $TEAM_ID.com.mapbox.RenderTestAppTests - com.apple.developer.team-identifier - $TEAM_ID - get-task-allow - - keychain-access-groups - - $TEAM_ID.com.mapbox.RenderTestAppTests - - - \ No newline at end of file diff --git a/render-test/ios/codesigning/XCTAutomationSupport.framework.xcent.template b/render-test/ios/codesigning/XCTAutomationSupport.framework.xcent.template deleted file mode 100644 index c2138e492..000000000 --- a/render-test/ios/codesigning/XCTAutomationSupport.framework.xcent.template +++ /dev/null @@ -1,16 +0,0 @@ - - - - - application-identifier - $TEAM_ID.com.mapbox.RenderTestAppTests - com.apple.developer.team-identifier - $TEAM_ID - get-task-allow - - keychain-access-groups - - $TEAM_ID.com.mapbox.RenderTestAppTests - - - \ No newline at end of file diff --git a/render-test/ios/codesigning/XCTest.framework.xcent.template b/render-test/ios/codesigning/XCTest.framework.xcent.template deleted file mode 100644 index c2138e492..000000000 --- a/render-test/ios/codesigning/XCTest.framework.xcent.template +++ /dev/null @@ -1,16 +0,0 @@ - - - - - application-identifier - $TEAM_ID.com.mapbox.RenderTestAppTests - com.apple.developer.team-identifier - $TEAM_ID - get-task-allow - - keychain-access-groups - - $TEAM_ID.com.mapbox.RenderTestAppTests - - - \ No newline at end of file diff --git a/render-test/ios/codesigning/codesign_all.sh b/render-test/ios/codesigning/codesign_all.sh deleted file mode 100755 index 59e0c3154..000000000 --- a/render-test/ios/codesigning/codesign_all.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -identity=$(/usr/bin/env xcrun security find-identity -v -p codesigning) -var=${identity#*1)\ } -CODE_SIGN_IDENTITY=${var%\ \"Apple\ Development*} - -codesign --force --sign $CODE_SIGN_IDENTITY --entitlements codesigning/RenderTestApp.app.xcent --timestamp=none ./Release-iphoneos/RenderTestApp.app -codesign --force --sign $CODE_SIGN_IDENTITY --deep --preserve-metadata=identifier,entitlements,flags --timestamp=none ./Release-iphoneos/RenderTestApp.app/Frameworks/libXCTestSwiftSupport.dylib -codesign --force --sign $CODE_SIGN_IDENTITY --deep --preserve-metadata=identifier,entitlements,flags --timestamp=none ./Release-iphoneos/RenderTestApp.app/Frameworks/libXCTestBundleInject.dylib -codesign --force --sign $CODE_SIGN_IDENTITY --deep --preserve-metadata=identifier,entitlements,flags --timestamp=none ./Release-iphoneos/RenderTestApp.app/Frameworks/XCTAutomationSupport.framework -codesign --force --sign $CODE_SIGN_IDENTITY --deep --preserve-metadata=identifier,entitlements,flags --timestamp=none ./Release-iphoneos/RenderTestApp.app/Frameworks/XCTest.framework -codesign --force --sign $CODE_SIGN_IDENTITY --deep --entitlements codesigning/RenderTestAppTests.xctest.xcent --timestamp=none ./Release-iphoneos/RenderTestApp.app/PlugIns/RenderTestAppTests.xctest diff --git a/render-test/ios/codesigning/generate-entitlements.swift b/render-test/ios/codesigning/generate-entitlements.swift deleted file mode 100755 index 83834483b..000000000 --- a/render-test/ios/codesigning/generate-entitlements.swift +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/swift - -/// Generates Entitlement files .xcent for codesigning, containing the correct team id -import Swift -import Foundation - -let fileManager = FileManager.default - -let contentsOfCurrentWorkingDirectory = try FileManager.default.contentsOfDirectory(at: URL(fileURLWithPath: "./codesigning/"), includingPropertiesForKeys: nil, options: []) - -guard let rawTeamIdEnv = getenv("IOS_DEVELOPMENT_TEAM") else { - print("Please add a IOS_DEVELOPMENT_TEAM environment variable.") - exit(1) -} - -let teamId2 = String(utf8String: rawTeamIdEnv) - -for file in contentsOfCurrentWorkingDirectory { - if (file.pathExtension == "template") { - var content = "" - do { - content = try String(contentsOf: file, encoding: .utf8) - } - catch { - print("Error reading xcent file: \(error).") - } - - content = content.replacingOccurrences(of: "$TEAM_ID", with: teamId2!) - - var targetFile = file - targetFile.deletePathExtension() - do { - try content.write(to: targetFile, atomically: false, encoding: .utf8) - print("Entitlement " + targetFile.absoluteString + " generated.") - } - catch { - print("Error writing xcent file: \(error).") - } - } -} \ No newline at end of file diff --git a/render-test/ios/codesigning/libXCTestSwiftSupport.dylib.xcent.template b/render-test/ios/codesigning/libXCTestSwiftSupport.dylib.xcent.template deleted file mode 100644 index c2138e492..000000000 --- a/render-test/ios/codesigning/libXCTestSwiftSupport.dylib.xcent.template +++ /dev/null @@ -1,16 +0,0 @@ - - - - - application-identifier - $TEAM_ID.com.mapbox.RenderTestAppTests - com.apple.developer.team-identifier - $TEAM_ID - get-task-allow - - keychain-access-groups - - $TEAM_ID.com.mapbox.RenderTestAppTests - - - \ No newline at end of file diff --git a/render-test/ios/fastlane/Appfile b/render-test/ios/fastlane/Appfile deleted file mode 100644 index b9fbc62d2..000000000 --- a/render-test/ios/fastlane/Appfile +++ /dev/null @@ -1,3 +0,0 @@ -app_identifier("com.mapbox.RenderTestApp") # The bundle identifier of your app -apple_id ENV['MAPBOX_APPLE_ID'] -team_id ENV['MAPBOX_APPLE_TEAM_ID'] # Developer Portal Team ID \ No newline at end of file diff --git a/render-test/ios/fastlane/Matchfile b/render-test/ios/fastlane/Matchfile deleted file mode 100644 index 6c2f977cc..000000000 --- a/render-test/ios/fastlane/Matchfile +++ /dev/null @@ -1,5 +0,0 @@ -git_url("git@github.com:mapbox/apple-certificates.git") -type("development") # The default type, can be: appstore, adhoc, enterprise or development -app_identifier(["com.mapbox.RenderTestApp", "com.mapbox.RenderTestAppTests"]) -username ENV['MAPBOX_APPLE_ID'] -keychain_name("fastlane_keychain") \ No newline at end of file diff --git a/render-test/ios/setup_test_data.sh b/render-test/ios/setup_test_data.sh deleted file mode 100755 index 482f9a161..000000000 --- a/render-test/ios/setup_test_data.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -if [ $# -eq 0 ]; then - echo "Give base directory as argument, eg. 'build'" - exit 1 -fi - -BASE_DIR=$1 - -rm -rf $BASE_DIR/test-data/ - -mkdir -p $BASE_DIR/test-data/integration/ -mkdir -p $BASE_DIR/test-data/baselines/ - -cp -r metrics/integration/render-tests $BASE_DIR/test-data/integration/ -cp -r metrics/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/ios-metal-render-test-runner-style.json $BASE_DIR/test-data/ -cp -r metrics/ios-metal-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/