Wrap entire GRPCCall (InternalTests) class in GRPC_TEST_OBJC

pull/9247/head
Muxi Yan 8 years ago
parent 01bbf87bf7
commit 7e151845ab
  1. 4
      src/objective-c/GRPCClient/internal_testing/GRPCCall+InternalTests.h
  2. 17
      src/objective-c/GRPCClient/internal_testing/GRPCCall+InternalTests.m
  3. 4
      src/objective-c/tests/Podfile
  4. 32
      src/objective-c/tests/Tests.xcodeproj/project.pbxproj

@ -31,6 +31,8 @@
*
*/
#ifdef GRPC_TEST_OBJC
#import "../GRPCCall.h"
/**
@ -55,3 +57,5 @@
+ (NSArray *)obtainAndCleanOpBatchLog;
@end
#endif

@ -31,6 +31,8 @@
*
*/
#ifdef GRPC_TEST_OBJC
#import "GRPCCall+InternalTests.h"
#import "../private/GRPCOpBatchLog.h"
@ -38,24 +40,13 @@
@implementation GRPCCall (InternalTests)
+ (void)enableOpBatchLog:(BOOL)enabled {
#ifdef GRPC_TEST_OBJC
[GRPCOpBatchLog enableOpBatchLog:enabled];
#else
NSLog(@"This function is for internal testing of gRPC only. "
"It is not part of gRPC's public interface. Do not use in production. "
"To enable, set the preprocessor flag GRPC_TEST_OBJC.");
#endif
}
+ (NSArray *)obtainAndCleanOpBatchLog {
#ifdef GRPC_TEST_OBJC
return [GRPCOpBatchLog obtainAndCleanOpBatchLog];
#else
NSLog(@"This function is for internal testing of gRPC only. "
"It is not part of gRPC's public interface. Do not use in production. "
"To enable, set the preprocessor flag GRPC_TEST_OBJC.");
return nil;
#endif
}
@end
#endif

@ -108,9 +108,9 @@ post_install do |installer|
if target.name == 'gRPC'
target.build_configurations.each do |config|
if config.name == 'Cronet'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_COMPILE_WITH_CRONET=1 GRPC_TEST_OBJC'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_COMPILE_WITH_CRONET=1 GRPC_TEST_OBJC=1'
elsif config.name == 'Test'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_TEST_OBJC'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_TEST_OBJC=1'
end
end
end

@ -1319,6 +1319,7 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
"GRPC_TEST_OBJC=1",
);
INFOPLIST_FILE = Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@ -1346,6 +1347,13 @@
buildSettings = {
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_TESTABILITY = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"COCOAPODS=1",
"$(inherited)",
"GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1",
"GRPC_TEST_OBJC=1",
);
INFOPLIST_FILE = Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@ -1360,6 +1368,13 @@
buildSettings = {
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_TESTABILITY = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"COCOAPODS=1",
"$(inherited)",
"GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1",
"GRPC_TEST_OBJC=1",
);
INFOPLIST_FILE = Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@ -1374,6 +1389,12 @@
buildSettings = {
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_TESTABILITY = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"COCOAPODS=1",
"GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1",
"GRPC_TEST_OBJC=1",
);
INFOPLIST_FILE = Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@ -1410,8 +1431,8 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"COCOAPODS=1",
"$(inherited)",
"GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1",
"GRPC_TEST_OBJC=1",
);
INFOPLIST_FILE = InteropTestsRemoteWithCronet/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
@ -1608,6 +1629,12 @@
buildSettings = {
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_TESTABILITY = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"COCOAPODS=1",
"$(inherited)",
"GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1",
);
INFOPLIST_FILE = Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@ -1672,10 +1699,10 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"COCOAPODS=1",
"$(inherited)",
"GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1",
"GRPC_COMPILE_WITH_CRONET=1",
"GRPC_CRONET_WITH_PACKET_COALESCING=1",
"GRPC_TEST_OBJC=1",
);
INFOPLIST_FILE = InteropTestsRemoteWithCronet/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
@ -1696,7 +1723,6 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"COCOAPODS=1",
"$(inherited)",
"GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1",
);
INFOPLIST_FILE = InteropTestsRemoteWithCronet/Info.plist;

Loading…
Cancel
Save