Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 13.1
run: sudo xcode-select -s /Applications/Xcode_13.1.app
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(cat xcode-version).app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh instance_tests1
- name: Capture xcresult files
Expand All @@ -29,8 +29,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 13.1
run: sudo xcode-select -s /Applications/Xcode_13.1.app
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(cat xcode-version).app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh instance_tests2
- name: Capture xcresult files
Expand All @@ -48,8 +48,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 13.1
run: sudo xcode-select -s /Applications/Xcode_13.1.app
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(cat xcode-version).app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh runner_tests
- name: Capture xcresult files
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 13.1
run: sudo xcode-select -s /Applications/Xcode_13.1.app
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(cat xcode-version).app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh instance_tests1
- name: Capture xcresult files
Expand All @@ -34,8 +34,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 13.1
run: sudo xcode-select -s /Applications/Xcode_13.1.app
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(cat xcode-version).app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh instance_tests2
- name: Capture xcresult files
Expand All @@ -53,8 +53,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 13.1
run: sudo xcode-select -s /Applications/Xcode_13.1.app
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(xcode-version).app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh runner_tests
- name: Capture xcresult files
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 13.1
run: sudo xcode-select -s /Applications/Xcode_13.1.app
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(cat xcode-version).app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh instance_tests1
- name: Capture xcresult files
Expand All @@ -32,8 +32,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 13.1
run: sudo xcode-select -s /Applications/Xcode_13.1.app
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(cat xcode-version).app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh instance_tests2
- name: Capture xcresult files
Expand All @@ -54,8 +54,8 @@ jobs:
- name: Report event trigger data
run: |
echo "Event ${{ github.event_name }}, ref: ${{ github.ref }}"
- name: Select Xcode 13.1
run: sudo xcode-select -s /Applications/Xcode_13.1.app
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(cat xcode-version).app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh runner_tests
- name: Capture xcresult files
Expand Down
8 changes: 5 additions & 3 deletions BPSampleApp/BPSampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
BAB24F261DB5D45E00867756 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1310;
ORGANIZATIONNAME = LinkedIn;
TargetAttributes = {
BA4BCFC51DC47EC700592FA4 = {
Expand Down Expand Up @@ -823,6 +823,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -880,6 +881,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -1001,7 +1003,7 @@
buildSettings = {
DEVELOPMENT_TEAM = 57Y47U492U;
INFOPLIST_FILE = BPSampleAppUITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = LI.BPSampleAppUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -1014,7 +1016,7 @@
buildSettings = {
DEVELOPMENT_TEAM = 57Y47U492U;
INFOPLIST_FILE = BPSampleAppUITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = LI.BPSampleAppUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion bluepill/bluepill.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
BAEF4B2C1DAC539400E68294 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1240;
LastUpgradeCheck = 1310;
ORGANIZATIONNAME = LinkedIn;
TargetAttributes = {
BA1809DF1DBA8FB100D7D130 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
6 changes: 5 additions & 1 deletion bp/bp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@
7A79017A1D5CB679004D4325 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1000;
LastUpgradeCheck = 1310;
ORGANIZATIONNAME = LinkedIn;
TargetAttributes = {
7A7901811D5CB679004D4325 = {
Expand Down Expand Up @@ -929,6 +929,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -987,6 +988,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -1015,6 +1017,7 @@
7A79018A1D5CB679004D4325 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
DEPLOYMENT_LOCATION = NO;
"DEVELOPER_PRIVATE_FRAMEWORKS_DIR[arch=*]" = /Library/Developer/PrivateFrameworks/;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1056,6 +1059,7 @@
7A79018B1D5CB679004D4325 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
DEPLOYMENT_LOCATION = NO;
"DEVELOPER_PRIVATE_FRAMEWORKS_DIR[arch=*]" = /Library/Developer/PrivateFrameworks/;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
2 changes: 1 addition & 1 deletion bp/bp.xcodeproj/xcshareddata/xcschemes/bp.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion bp/bp.xcodeproj/xcshareddata/xcschemes/bplib.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
13 changes: 2 additions & 11 deletions bp/src/BPConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -675,22 +675,13 @@ - (BOOL)validateConfigWithError:(NSError *__autoreleasing *)errPtr {
return NO;
}

//Check if xcode version running on the host match the intended Bluepill branch: Xcode 9 branch is not backward compatible
NSString *xcodeVersion = [BPUtils runShell:@"xcodebuild -version"];
[BPUtils printInfo:DEBUGINFO withString:@"xcode build version: %@", xcodeVersion];

if (!self.unsafeSkipXcodeVersionCheck) {
if ([xcodeVersion rangeOfString:@BP_DEFAULT_XCODE_VERSION].location == NSNotFound) {
BP_SET_ERROR(errPtr, @"ERROR: Invalid Xcode version:\n%s;\nOnly %s is supported\n", [xcodeVersion UTF8String], BP_DEFAULT_XCODE_VERSION);
return NO;
}

// Check if Bluepill compile time Xcode version is matched with Bluepill runtime Xcode version
// This check prevents Bluepill compiled with Xcode 8 running on host installed with Xcode 9
// Only compare major and minor version version Eg. 11.2 ~ 11.2.1 but 11.2 <> 11.3
if (![[[BPUtils getXcodeRuntimeVersion] substringToIndex:4] isEqualToString:@BP_DEFAULT_XCODE_VERSION]) {
if (![BPUtils sameMajorandMinor:[BPUtils getXcodeRuntimeVersion] withVersion:[BPUtils getXcodeBuildtimeVersion]]) {
BP_SET_ERROR(errPtr, @"ERROR: Bluepill runtime version %s and compile time version %s are mismatched\n",
[[[BPUtils getXcodeRuntimeVersion] substringToIndex:4] UTF8String], [@BP_DEFAULT_XCODE_VERSION UTF8String]);
[[[BPUtils getXcodeRuntimeVersion] substringToIndex:4] UTF8String], [BPUtils getXcodeBuildtimeVersion]);
return NO;
}
}
Expand Down
1 change: 0 additions & 1 deletion bp/src/BPConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import <Foundation/Foundation.h>

#pragma mark - Version Constants
#define BP_DEFAULT_XCODE_VERSION "13.1"
#define BP_DEFAULT_RUNTIME "iOS 15.0"
#define BP_DEFAULT_BASE_SDK "15.0"

Expand Down
18 changes: 9 additions & 9 deletions bp/src/BPTMDRunnerConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ - (void)connect {
dispatch_async(self.queue, ^{

DTXConnection *connection = connectToTestManager(self.context.runner.device);

[connection registerDisconnectHandler:^{
// This is called when the task is abruptly terminated (e.g. if the test times out)
[self stopVideoRecording:YES];
[BPUtils printInfo:INFO withString:@"DTXConnection disconnected."];
}];

[connection
xct_handleProxyRequestForInterface:@protocol(XCTMessagingChannel_RunnerToIDE)
peerInterface:@protocol(XCTMessagingChannel_IDEToRunner)
Expand Down Expand Up @@ -183,24 +183,24 @@ - (void)stopVideoRecording:(BOOL)forced
}
return;
}

if (forced) {
[BPUtils printInfo:ERROR withString: @"Found dangling video recording task. Stopping it."];
}

if (![task isRunning]) {
[BPUtils printInfo:ERROR withString:@"Video task exists but it was already terminated with status %d", [task terminationStatus]];
}

[BPUtils printInfo:INFO withString:@"Stopping recording video."];
[BPUtils printInfo:DEBUGINFO withString:@"Stopping video recording task with pid %d and command: %@", [task processIdentifier], [BPUtils getCommandStringForTask:task]];
[task interrupt];
[task waitUntilExit];

if ([task terminationStatus] != 0) {
[BPUtils printInfo:ERROR withString:@"Video task was interrupted, but exited with non-zero status %d", [task terminationStatus]];
}

NSString *filePath = [[task arguments].lastObject componentsSeparatedByString:@" "].lastObject;
if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
[BPUtils printInfo:ERROR withString:@"Video recording file missing, expected at path %@!", filePath];
Expand Down Expand Up @@ -344,7 +344,7 @@ - (id)_XCT_testSuite:(NSString *)tests didStartAt:(NSString *)time {

- (id)_XCT_testSuite:(NSString *)arg1 didFinishAt:(NSString *)time runCount:(NSNumber *)count withFailures:(NSNumber *)failureCount unexpected:(NSNumber *)unexpectedCount testDuration:(NSNumber *)testDuration totalDuration:(NSNumber *)totalTime {
[BPUtils printInfo:DEBUGINFO withString: @"BPTestBundleConnection_XCT_testSuite: %@, didFinishAt: %@, runCount: %@, withFailures: %@, unexpectedCount: %@, testDuration: %@, totalDuration: %@", arg1, time, count, failureCount, unexpectedCount, testDuration, totalTime];

if ([self shouldRecordVideo]) {
[self stopVideoRecording:YES];
}
Expand Down Expand Up @@ -405,7 +405,7 @@ - (id)_XCT_launchProcessWithPath:(NSString *)path bundleID:(NSString *)bundleID
return nil;
}
[BPUtils printInfo:DEBUGINFO withString:@"BPTestBundleConnection Launching app: %@ with options %@", bundleID, options];

self.appProcessPID = [self.simulator.device launchApplicationWithID:bundleID options:options error:&error];
self.bundleID = bundleID;
if (error) {
Expand Down
5 changes: 5 additions & 0 deletions bp/src/BPUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ typedef NS_ENUM(int, BPKind) {

+ (NSString *)getXcodeRuntimeVersion;

+ (NSString *)getXcodeBuildtimeVersion;

+ (bool)sameMajorandMinor:(NSString * _Nonnull)version1 withVersion:(NSString * _Nonnull)version2;


typedef BOOL (^BPRunBlock)(void);

/*!
Expand Down
13 changes: 13 additions & 0 deletions bp/src/BPUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,19 @@ + (NSString *)getXcodeRuntimeVersion {
return runTimeVersion;
}

+ (NSString *)getXcodeBuildtimeVersion {
return [NSString stringWithUTF8String:XCODE_VERSION];
}

// Compare major and minor version version Eg. 11.2 ~ 11.2.1 but 11.2 <> 11.3
+ (bool)sameMajorandMinor:(NSString * _Nonnull)version1 withVersion:(NSString * _Nonnull)version2 {
NSArray *v1parts = [version1 componentsSeparatedByString:@" "];
NSArray *v2parts = [version2 componentsSeparatedByString:@" "];
NSArray <NSString *> *v1versionParts = [[v1parts objectAtIndex:0] componentsSeparatedByString:@"."];
NSArray <NSString *> *v2versionParts = [[v2parts objectAtIndex:0] componentsSeparatedByString:@"."];
return [v1versionParts[0] isEqualToString:v2versionParts[0]] && [v1versionParts[1] isEqualToString:v2versionParts[1]];
}

+ (void)saveDebuggingDiagnostics:(NSString *)outputDirectory {
BOOL isDir = false;
NSFileManager *fm = [NSFileManager defaultManager];
Expand Down
1 change: 1 addition & 0 deletions xcode-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
13.1