iOS C++ Unit Tests Bazel target & running on CI (#1534)

This commit is contained in:
Bart Louwers
2023-08-22 21:52:20 +02:00
committed by GitHub
parent e16995ec33
commit 32d65850c9
21 changed files with 308 additions and 155 deletions

View File

@@ -169,7 +169,7 @@ jobs:
cd Payload/RenderTestApp.app/PlugIns
zip -r "$render_test_app_dir"/RenderTest.xctest.zip RenderTest.xctest
echo render_test_artifacts_dir="$render_test_app_dir" >> "$GITHUB_ENV"
- uses: actions/upload-artifact@v3
with:
name: ios-render-test
@@ -177,3 +177,29 @@ jobs:
path: |
${{ env.render_test_artifacts_dir }}/RenderTest.xctest.zip
${{ env.render_test_artifacts_dir }}/RenderTestApp.ipa
# C++ unit tests
- name: Build CppUnitTests .ipa and .xctest for AWS Device Farm
run: |
set -e
bazel run //platform/ios:xcodeproj
build_dir="$(mktemp -d)"
xcodebuild build-for-testing -scheme CppUnitTests -project MapLibre.xcodeproj -derivedDataPath "$build_dir"
ios_cpp_test_app_dir="$(dirname "$(find "$build_dir" -name CppUnitTestsApp.app)")"
cd "$ios_cpp_test_app_dir"
mkdir Payload
mv CppUnitTestsApp.app Payload
zip -r CppUnitTestsApp.zip Payload
mv CppUnitTestsApp.zip CppUnitTestsApp.ipa
cd Payload/CppUnitTestsApp.app/PlugIns
zip -r "$ios_cpp_test_app_dir"/CppUnitTests.xctest.zip CppUnitTests.xctest
echo ios_cpp_test_artifacts_dir="$ios_cpp_test_app_dir" >> "$GITHUB_ENV"
- uses: actions/upload-artifact@v3
with:
name: ios-cpp-unit-tests
retention-days: 3
path: |
${{ env.ios_cpp_test_artifacts_dir }}/CppUnitTests.xctest.zip
${{ env.ios_cpp_test_artifacts_dir }}/CppUnitTestsApp.ipa

View File

@@ -1,4 +1,4 @@
name: ios-render-test
name: ios-device-test
on:
workflow_run:
@@ -7,7 +7,15 @@ on:
- completed
jobs:
ios-render-test:
ios-device-test:
strategy:
matrix:
test: [
{artifactName: ios-render-test, xcTestFile: RenderTest.xctest.zip, ipaFile: RenderTestApp.ipa, name: "iOS Render Tests"},
{artifactName: ios-cpp-unit-tests, xcTestFile: CppUnitTests.xctest.zip, ipaFile: CppUnitTestsApp.ipa, name: "iOS C++ Unit Tests"},
]
max-parallel: 1
fail-fast: true
runs-on: ubuntu-22.04
if: github.repository_owner == 'maplibre'
steps:
@@ -15,9 +23,8 @@ jobs:
- uses: ./.github/actions/download-workflow-run-artifact
with:
artifact-name: ios-render-test
expect-files: "RenderTest.xctest.zip, RenderTestApp.ipa"
artifact-name: ${{ matrix.test.artifactName }}
expect-files: "${{ matrix.test.xcTestFile }}, ${{ matrix.test.ipaFile }}"
- name: Generate token
id: generate_token
@@ -32,7 +39,7 @@ jobs:
token: ${{ steps.generate_token.outputs.token }}
details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
status: in_progress
name: iOS Render Test
name: ${{ matrix.test.name }}
sha: ${{ github.event.workflow_run.head_sha }}
- name: Configure AWS Credentials
@@ -47,7 +54,7 @@ jobs:
- name: Create upload app
run: |
response=$(aws devicefarm create-upload --type IOS_APP --name RenderTestApp.ipa --project-arn ${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }})
response=$(aws devicefarm create-upload --type IOS_APP --name ${{ matrix.test.ipaFile }} --project-arn ${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }})
echo "$response"
arn="$(jq -r '.upload.arn' <<< "$response")"
url="$(jq -r '.upload.url' <<< "$response")"
@@ -56,17 +63,17 @@ jobs:
- name: Create upload test package
run: |
response=$(aws devicefarm create-upload --type XCTEST_TEST_PACKAGE --name RenderTest.xctest.zip --project-arn ${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }})
response=$(aws devicefarm create-upload --type XCTEST_TEST_PACKAGE --name ${{ matrix.test.xcTestFile }} --project-arn ${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }})
echo "$response"
arn="$(jq -r '.upload.arn' <<< "$response")"
url="$(jq -r '.upload.url' <<< "$response")"
echo "test_package_arn=$arn" >> "$GITHUB_ENV"
echo "test_package_url=$url" >> "$GITHUB_ENV"
- name: Upload iOS Render test
- name: Upload ${{ matrix.test.name }}
run: |
curl -T RenderTestApp.ipa "${{ env.app_url }}"
curl -T RenderTest.xctest.zip "${{ env.test_package_url }}"
curl -T ${{ matrix.test.ipaFile }} "${{ env.app_url }}"
curl -T ${{ matrix.test.xcTestFile }} "${{ env.test_package_url }}"
max_checks=10
sleep_time=5
@@ -92,7 +99,7 @@ jobs:
- name: Schedule test run
uses: realm/aws-devicefarm/test-application@master
with:
name: MapLibre Native iOS Render Test
name: MapLibre Native ${{ matrix.test.name }}
project_arn: ${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }}
device_pool_arn: ${{ vars.AWS_DEVICE_FARM_IPHONE_DEVICE_POOL_ARN }}
app_arn: ${{ env.app_arn }}

View File

@@ -97,6 +97,7 @@ cc_library(
"//platform/darwin:__pkg__",
"//platform/ios:__pkg__",
"//platform/linux:__pkg__",
"//test:__pkg__",
],
deps = [
"//:mbgl-core",

View File

@@ -7,7 +7,7 @@ load(
"xcodeproj",
)
load("//platform/ios/bazel:macros.bzl", "info_plist")
load("//platform/ios/bazel:config.bzl", "BUNDLE_ID_PREFIX")
load("//platform/ios/bazel:config.bzl", "BUILD_MODE", "BUNDLE_ID_PREFIX")
load(
"//platform/ios/bazel:files.bzl",
"MLN_IOS_PRIVATE_HEADERS",
@@ -213,7 +213,7 @@ genrule(
xcodeproj(
name = "xcodeproj",
bazel_env = {"PATH": "/bin:/usr/bin:/usr/local/bin:/opt/homebrew/bin"},
build_mode = "xcode",
build_mode = BUILD_MODE,
default_xcode_configuration = "Debug",
minimum_xcode_version = "14",
project_name = "MapLibre",
@@ -247,6 +247,13 @@ xcodeproj(
"device",
],
),
top_level_target(
"//platform/ios/test/core:CppUnitTests",
target_environments = [
"simulator",
"device",
],
),
],
xcode_configurations = {
"Debug": {"//command_line_option:compilation_mode": "dbg"},

View File

@@ -95,12 +95,6 @@ cp bazel/example_config.bzl bazel/config.bzl
You need to set your `BUNDLE_ID_PREFIX` to be unique (ideally use a domain that you own in reverse domain name notation).
```
APPLE_MOBILE_PROVISIONING_PROFILE_TEAM_ID = "FFNX6834U8"
APPLE_MOBILE_PROVISIONING_PROFILE_NAME = "iOS Team Provisioning Profile: *"
BUNDLE_ID_PREFIX = "com.firstnamelastname"
```
You can keep leave the `APPLE_MOBILE_PROVISIONING_PROFILE_NAME` alone.
Set the Team ID to the Team ID of your Apple Developer Account (paid or unpaid both work). If you do not know your Team ID, enter the following command in the terminal:
@@ -130,6 +124,8 @@ Confirm that no errors are shown:
Try to run the example App in the simulator and on a device to confirm your setup works.
If no provisioning profile was found, you could try changing the `BUILD_MODE` in `config.bzl` to `"xcode"`. Try the steps in this section again afterwards.
#### Using Bazel from the Command Line
It is also possible to build and run the test application in a simulator from the command line without opening Xcode.

View File

@@ -1,3 +1,8 @@
APPLE_MOBILE_PROVISIONING_PROFILE_TEAM_ID = "TC45MCF93C"
APPLE_MOBILE_PROVISIONING_PROFILE_NAME = "iOS Team Provisioning Profile: *"
BUNDLE_ID_PREFIX = "com.firstnamelastname"
# Change the BUILD_MODE to "xcode" below if you experience problems with
# not finding a provisioning profile when building.
# https://github.com/MobileNativeFoundation/rules_xcodeproj/blob/main/docs/bazel.md#xcodeproj-build_mode
BUILD_MODE = "bazel"

View File

@@ -10,12 +10,13 @@ cc_library(
".",
],
visibility = [
"//platform/ios/test/core:__pkg__",
"//render-test/ios:__pkg__",
],
)
objc_library(
name = "render_test_app_srcs",
name = "test_app_srcs",
srcs = [
"AppDelegate.h",
"AppDelegate.m",
@@ -25,6 +26,9 @@ objc_library(
"LaunchScreen.storyboard",
"Main.storyboard",
],
visibility = [
"//platform/ios/test/core:__pkg__",
],
deps = [
"ios_test_runner_lib",
],
@@ -43,7 +47,7 @@ ios_application(
"//visibility:public",
],
deps = [
"render_test_app_srcs",
"test_app_srcs",
"//render-test/ios:render_test_ios_src",
],
)

View File

@@ -1,84 +0,0 @@
#import "iosTestRunner.h"
#include <ios_test_runner.hpp>
#include <string>
@interface IosTestRunner ()
@property (nullable) TestRunner *runner;
@property (copy, nullable) NSString *resultPath;
@property BOOL testStatus;
@end
@implementation IosTestRunner
-(instancetype)init
{
self = [super init];
if (self) {
self.testStatus = NO;
self.runner = new TestRunner();
NSError *error;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *bundleRoot = [[NSBundle mainBundle] bundlePath];
NSArray *bundleContents = [fileManager contentsOfDirectoryAtPath: bundleRoot error: &error];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [paths objectAtIndex: 0];
for (uint32_t i = 0; i < bundleContents.count; i++) {
NSString *dirName = [bundleContents objectAtIndex: i];
if ([dirName isEqualToString: dataDir]) {
NSString *destinationPath = [documentsDir stringByAppendingPathComponent: dirName];
BOOL success = [fileManager fileExistsAtPath: destinationPath];
if (success) {
[fileManager removeItemAtPath:destinationPath error:NULL];
}
success = [fileManager fileExistsAtPath: destinationPath];
if (!success) {
NSString *copyDirPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent: dirName];
success = [fileManager copyItemAtPath: copyDirPath toPath: destinationPath error: &error];
if (!success) {
NSLog(@"Failed to copy file '%@'", dirName);
NSAssert1(0, @"Failed to copy file, error '%@'", [error localizedDescription]);
} else {
NSLog(@"File '%@' copied OK", dirName);
}
} else {
NSLog(@"Failed to remove file '%@'", dirName);
NSAssert1(0, @"Failed to remove file, error '%@'", [error localizedDescription]);
}
break;
}
}
NSString *baseDir = [documentsDir stringByAppendingPathComponent: dataDir];
std::string basePath = std::string([baseDir UTF8String]);
self.testStatus = self.runner->startTest(basePath) ? YES : NO;
self.resultPath = [baseDir stringByAppendingPathComponent: resultFilePath];
BOOL fileFound = [fileManager fileExistsAtPath: self.resultPath];
if (fileFound == NO) {
NSLog(@"Test result file '%@' does not exist", self.resultPath);
self.testStatus = NO;
}
delete self.runner;
self.runner = nullptr;
}
return self;
}
- (NSString*) getResultPath {
return self.resultPath;
}
- (BOOL) getTestStatus {
return self.testStatus;
}
@end

View File

@@ -0,0 +1,68 @@
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_unit_test")
load("//platform/ios/bazel:config.bzl", "BUNDLE_ID_PREFIX")
load("//bazel:flags.bzl", "CPP_FLAGS", "MAPLIBRE_FLAGS")
load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle")
cc_library(
name = "test_cpp_srcs",
srcs = [
"ios_test_runner.cpp",
],
copts = CPP_FLAGS + MAPLIBRE_FLAGS,
deps = [
"//platform:ios-sdk",
"//platform/ios/test/common:ios_test_runner_lib",
"//test:testlib",
"//test:tests",
],
)
apple_resource_bundle(
name = "TestData",
infoplists = [
"//render-test/ios:Empty.plist",
],
structured_resources = [
"//test:fixtures",
"//:scripts/style-spec-reference/v8.json",
],
)
objc_library(
name = "test_objc_srcs",
srcs = [
"Tests.m",
"iosTestRunner.h",
"iosTestRunner.mm",
],
deps = [
"TestData",
"test_cpp_srcs",
"//platform/ios/test/common:ios_test_runner_lib",
],
)
ios_application(
name = "CppUnitTestsApp",
bundle_id = "{}.maplibre.UnitTestsApp".format(BUNDLE_ID_PREFIX),
families = ["iphone"],
infoplists = [
"Info.plist",
],
minimum_os_version = "12.0",
provisioning_profile = "//platform/ios:xcode_profile",
deps = [
"//platform/ios/test/common:test_app_srcs",
],
)
ios_unit_test(
name = "CppUnitTests",
minimum_os_version = "12.0",
provisioning_profile = "//platform/ios:xcode_profile",
test_host = "CppUnitTestsApp",
visibility = ["@rules_xcodeproj//xcodeproj:generated"],
deps = [
"test_objc_srcs",
],
)

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
@@ -8,16 +8,12 @@
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>UnitTestsApp</string>
<key>CFBundleIdentifier</key>
<string>com.mapbox.UnitTestsApp</string>
<key>CFBundleGetInfoString</key>
<string>com.mapbox.UnitTestsApp</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>1.0</string>
<key>CFBundleLongVersionString</key>
<string>1.0</string>
<key>CFBundleName</key>
<string>com.mapbox.UnitTestsApp</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
@@ -30,8 +26,6 @@
<true/>
<key>NSHumanReadableCopyright</key>
<string>© 2014–2020 Mapbox</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>

View File

@@ -1,7 +1,6 @@
#import <Foundation/Foundation.h>
#pragma once
NSString *dataDir = @"test-data";
NSString *resultFilePath = @"test/results.xml";
#import <Foundation/Foundation.h>
__attribute__((visibility ("default")))
@interface IosTestRunner : NSObject

View File

@@ -0,0 +1,92 @@
#import "iosTestRunner.h"
#include <ios_test_runner.hpp>
#include <string>
@interface IosTestRunner ()
@property (nullable) TestRunner *runner;
@property (copy, nullable) NSString *resultPath;
@property BOOL testStatus;
@end
@implementation IosTestRunner
-(instancetype)init
{
self = [super init];
if (self) {
self.testStatus = NO;
self.runner = new TestRunner();
NSError *error;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *xcTestBundleRoot = [[NSBundle bundleForClass:[self class]] resourcePath];
NSString *testDataDir = [xcTestBundleRoot stringByAppendingString:@"/TestData.bundle"];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [paths objectAtIndex: 0];
NSString *destinationPath = [documentsDir stringByAppendingPathComponent: @"test"];
[self copyFileAtPath:testDataDir toPath:destinationPath];
[self copyFileAtPath:[testDataDir stringByAppendingPathComponent: @"scripts"] toPath:[documentsDir stringByAppendingPathComponent: @"scripts"]];
NSLog(@"Starting test");
std::string basePath = std::string([documentsDir UTF8String]);
self.testStatus = self.runner->startTest(basePath) ? YES : NO;
self.resultPath = [destinationPath stringByAppendingPathComponent: @"results.xml"];
BOOL fileFound = [fileManager fileExistsAtPath: self.resultPath];
if (fileFound == NO) {
NSLog(@"Test result file '%@' does not exist", self.resultPath);
self.testStatus = NO;
}
delete self.runner;
self.runner = nullptr;
}
return self;
}
/**
Copies a file from the source path to the destination path.
@param sourcePath The path of the source file to be copied.
@param destinationPath The destination path where the file should be copied.
*/
- (void)copyFileAtPath:(NSString *)sourcePath toPath:(NSString *)destinationPath {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error = nil;
BOOL success;
// delete destinationPath if it exists
if ([fileManager fileExistsAtPath:destinationPath]) {
success = [fileManager removeItemAtPath: destinationPath error: &error];
if (!success) {
NSAssert1(0, @"Failed to delete '%@'.", destinationPath);
}
}
success = [fileManager copyItemAtPath:sourcePath toPath:destinationPath error:&error];
if (!success) {
NSAssert1(0, @"Failed to copy file '%@'.", [error localizedDescription]);
NSLog(@"Failed to copy %@ file, error %@", sourcePath, [error localizedDescription]);
} else {
NSLog(@"File copied %@ OK", sourcePath);
}
}
- (NSString*) getResultPath {
return self.resultPath;
}
- (BOOL) getTestStatus {
return self.testStatus;
}
@end

View File

@@ -25,7 +25,7 @@ bool TestRunner::startTest(const std::string& basePath) {
mbgl::Log::Info(mbgl::Event::General, "Start TestRunner");
int status = mbgl::runTests(static_cast<uint32_t>(argv.size()), argv.data());
mbgl::Log::Info(mbgl::Event::General, "TestRunner finished with status: '%d'", status);
mbgl::Log::Info(mbgl::Event::General, "TestRunner finished with status: '" + std::to_string(status) + "'");
return status == 0;
}

View File

@@ -62,5 +62,6 @@ ios_unit_test(
)
exports_files([
"Empty.plist",
"Info.plist",
])

View File

@@ -213,13 +213,15 @@ IntersectionResult Frustum::intersects(const AABB& aabb) const {
bool fullyInside = true;
const auto epsilon = 1e-10;
for (const vec4& plane : planes) {
size_t pointsInside = 0;
pointsInside += vec4Dot(plane, aabbPoints[0]) >= 0.0;
pointsInside += vec4Dot(plane, aabbPoints[1]) >= 0.0;
pointsInside += vec4Dot(plane, aabbPoints[2]) >= 0.0;
pointsInside += vec4Dot(plane, aabbPoints[3]) >= 0.0;
pointsInside += vec4Dot(plane, aabbPoints[0]) >= -epsilon;
pointsInside += vec4Dot(plane, aabbPoints[1]) >= -epsilon;
pointsInside += vec4Dot(plane, aabbPoints[2]) >= -epsilon;
pointsInside += vec4Dot(plane, aabbPoints[3]) >= -epsilon;
if (!pointsInside) {
// Separating axis found, no intersection

View File

@@ -13,45 +13,84 @@ cc_library(
cc_library(
name = "testlib",
srcs = glob(
[
"src/mbgl/test/*.cpp",
],
exclude = [
"src/mbgl/test/test.cpp",
"src/mbgl/test/http_server.cpp",
],
),
srcs = select({
"//:ios": glob(
["src/mbgl/test/*.cpp"],
allow_empty = False,
),
"//conditions:default": glob(
["src/mbgl/test/*.cpp"],
allow_empty = False,
exclude = ["src/mbgl/test/http_server.cpp"],
),
}) + [
"include/mbgl/test.hpp",
],
hdrs = glob([
"src/mbgl/test/*.hpp",
]),
copts = CPP_FLAGS + MAPLIBRE_FLAGS,
copts = CPP_FLAGS + MAPLIBRE_FLAGS + select({
"//:ios": ["-DUSE_CPP_TEST_SERVER"],
"//conditions:default": [],
}),
includes = [
"include",
],
strip_include_prefix = "src",
visibility = [
"//platform/ios/test/core:__pkg__",
],
deps = [
"testutils",
"//:mbgl-core",
],
] + select({
"//:ios": ["//vendor:httplib"],
"//conditions:default": [],
}),
)
cc_test(
name = "core",
cc_library(
name = "tests",
srcs = glob(
[
"**/*.test.cpp",
],
),
args = [
"--gtest_filter=-Map.StyleNetworkErrorRetry:Map.StyleNotFound:MainResourceLoader.CachedResourceLowPriority",
],
copts = CPP_FLAGS + MAPLIBRE_FLAGS,
data = glob(["fixtures/**/*"]) + [
"//:scripts/style-spec-reference/v8.json",
visibility = [
"//platform/ios/test/core:__pkg__",
],
deps = [
"testlib",
"testutils",
"//:mbgl-core",
"//platform/linux:impl",
"//platform/default:mbgl-default",
"//vendor/googletest:gtest_main",
],
alwayslink = True,
)
filegroup(
name = "fixtures",
srcs = glob(
["fixtures/**/*"],
allow_empty = False,
),
visibility = [
"//platform/ios/test/core:__pkg__",
],
)
cc_test(
name = "core",
args = [
"--gtest_filter=-Map.StyleNetworkErrorRetry:Map.StyleNotFound:MainResourceLoader.CachedResourceLowPriority",
],
data = glob(["fixtures/**/*"]) + [
"//:scripts/style-spec-reference/v8.json",
],
deps = [
"tests",
"//platform/linux:impl",
],
)

View File

@@ -187,18 +187,6 @@ target_include_directories(
include(${PROJECT_SOURCE_DIR}/vendor/cpp-httplib.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/googletest.cmake)
if(CMAKE_SYSTEM_NAME STREQUAL iOS)
set_target_properties(mbgl-vendor-googletest PROPERTIES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IOS_DEPLOYMENT_TARGET}")
set_target_properties(mbgl-vendor-googletest PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
set_target_properties(mbgl-vendor-googletest PROPERTIES XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE bitcode)
set_target_properties(mbgl-vendor-googletest PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH $<$<CONFIG:Debug>:YES>)
set_target_properties(mbgl-test PROPERTIES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IOS_DEPLOYMENT_TARGET}")
set_target_properties(mbgl-test PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
set_target_properties(mbgl-test PROPERTIES XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE bitcode)
set_target_properties(mbgl-test PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH $<$<CONFIG:Debug>:YES>)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set_target_properties(mbgl-test mbgl-vendor-googletest PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH $<$<CONFIG:Debug>:YES>)
set_target_properties(mbgl-test mbgl-vendor-googletest

View File

@@ -7,7 +7,7 @@
namespace mbgl {
int runTests(int argc, char *argv[]) {
#if TEST_HAS_SERVER && defined(__QT__)
#if (TEST_HAS_SERVER && defined(__QT__)) || USE_CPP_TEST_SERVER
auto server = std::make_unique<test::HttpServer>();
#endif

View File

@@ -43,7 +43,7 @@ public:
virtual void setClientOptions(ClientOptions) override {}
virtual ClientOptions getClientOptions() { return ClientOptions{}; }
virtual ClientOptions getClientOptions() override { return ClientOptions{}; }
private:
std::unordered_map<std::string, std::shared_ptr<std::string>> assets;

8
vendor/BUILD.bazel vendored
View File

@@ -137,6 +137,14 @@ cc_library(
visibility = ["//visibility:public"],
)
cc_library(
name = "httplib",
hdrs = ["cpp-httplib/httplib.h"],
copts = CPP_FLAGS,
includes = ["cpp-httplib"],
visibility = ["//visibility:public"],
)
# vendor/protozero-files.json
cc_library(
name = "protozero",