Fixed address resolution failure by attaching to a host application

Added copyright statements

Fix clang format code
pull/19855/head
Tony Lu 6 years ago
parent d12f310b0d
commit b892ea749c
  1. 45
      src/objective-c/tests/BUILD
  2. 25
      src/objective-c/tests/Hosts/ios-host/AppDelegate.h
  3. 27
      src/objective-c/tests/Hosts/ios-host/AppDelegate.m
  4. 41
      src/objective-c/tests/Hosts/ios-host/Info.plist
  5. 26
      src/objective-c/tests/Hosts/ios-host/main.m

@ -24,9 +24,9 @@ load(
"testing_objc_grpc_library"
)
load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_unit_test")
load("@build_bazel_rules_apple//apple:macos.bzl", "macos_unit_test")
load("@build_bazel_rules_apple//apple:tvos.bzl", "tvos_unit_test")
load("@build_bazel_rules_apple//apple:tvos.bzl", "tvos_application", "tvos_unit_test")
exports_files(["LICENSE"])
@ -59,12 +59,42 @@ grpc_objc_testing_library(
hdrs = ["version.h"],
data = [":TestCertificates"],
defines = [
"DEBUG=1",
"PB_FIELD_32BIT=1",
"PB_NO_PACKED_STRUCTS=1",
"PB_ENABLE_MALLOC=1",
"HOST_PORT_LOCALSSL=localhost:5051",
"HOST_PORT_LOCAL=localhost:5050",
"HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com",
],
)
objc_library(
name = "host-lib",
srcs = glob(["Hosts/ios-host/*.m"]),
hdrs = glob(["Hosts/ios-host/*.h"]),
)
ios_application(
name = "ios-host",
bundle_id = "grpc.objc.tests.ios-host",
infoplists = ["Hosts/ios-host/Info.plist"],
minimum_os_version = "9.0",
families = [
"iphone",
"ipad",
],
deps = ["host-lib"],
)
tvos_application(
name = "tvos-host",
bundle_id = "grpc.objc.tests.tvos-host",
infoplists = ["Hosts/ios-host/Info.plist"],
minimum_os_version = "10.0",
deps = ["host-lib"],
)
grpc_objc_testing_library(
name = "CronetConfig",
srcs = ["ConfigureCronet.m"],
@ -159,7 +189,8 @@ ios_unit_test(
":ChannelPoolTest-lib",
":ChannelTests-lib",
":NSErrorUnitTests-lib",
]
],
test_host = ":ios-host",
)
ios_unit_test(
@ -169,8 +200,9 @@ ios_unit_test(
":InteropTestsRemote-lib",
":InteropTestsLocalSSL-lib",
":InteropTestsLocalCleartext-lib",
# ":InteropTestsMultipleChannels-lib", #??????? Cronet must be used?
# ":InteropTestsMulitpleChannels-lib", # needs Cronet
],
test_host = ":ios-host",
)
macos_unit_test(
@ -187,7 +219,7 @@ macos_unit_test(
]
)
# cares does not support tvOS CPU architecture with Bazel yet
# c-ares does not support tvOS CPU architecture with Bazel yet
tvos_unit_test(
name = "TvTests",
minimum_os_version = "10.0",
@ -198,5 +230,6 @@ tvos_unit_test(
":InteropTestsRemote-lib",
":InteropTestsLocalSSL-lib",
":InteropTestsLocalCleartext-lib",
]
],
test_host = ":tvos-host",
)

@ -0,0 +1,25 @@
/*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder<UIApplicationDelegate>
@property(strong, nonatomic) UIWindow* window;
@end

@ -0,0 +1,27 @@
/*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
@end

@ -0,0 +1,41 @@
<?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">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

@ -0,0 +1,26 @@
/*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char* argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
Loading…
Cancel
Save