Skip to content

Commit

Permalink
Partial revert of "Fix wrong exit status (linkedin#338)"
Browse files Browse the repository at this point in the history
  • Loading branch information
ravimandala committed Sep 20, 2019
1 parent 57dd5e1 commit 3b31024
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (void)testAppCrash0 {
XCTAssert(YES);
}

- (void)testAppCrash1 {
- (void)DISABLED_testAppCrash1 {
NSDictionary *env = [[NSProcessInfo processInfo] environment];
NSString *simulatorVersionInfo = [env objectForKey:@"SIMULATOR_VERSION_INFO"];
NSString *attempt = attemptFromSimulatorVersionInfo(simulatorVersionInfo);
Expand Down
2 changes: 1 addition & 1 deletion bp/src/BPConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ -(id)copyWithZone:(NSZone *)zone {
}

- (id)mutableCopyWithZone:(NSZone *)zone {
BPConfiguration *newConfig = [[BPConfiguration alloc] initWithProgram:self.program];
BPConfiguration *newConfig = [[BPConfiguration alloc] initWithProgram:(int)self.program];
assert(newConfig);
for(int i = 0; BPOptions[i].name; i++) {
const char *name = BPOptions[i].property;
Expand Down
4 changes: 3 additions & 1 deletion bp/src/Bluepill.m
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,9 @@ - (void)finishWithContext:(BPExecutionContext *)context {
if (![self hasRemainingTestsInContext:context] && (context.attemptNumber <= [context.config.errorRetriesCount integerValue])) {
[BPUtils printInfo:INFO withString:@"No more tests to run."];
[BPUtils printInfo:INFO withString:@"%s:%d finalExitStatus = %@", __FILE__, __LINE__, [BPExitStatusHelper stringFromExitStatus:self.finalExitStatus]];
self.finalExitStatus = context.exitStatus;
// TODO: Temporarily disabling the fix from PR#338 while the issue is being investigated
// self.finalExitStatus = context.exitStatus;
self.finalExitStatus = context.finalExitStatus | context.exitStatus;
self.exitLoop = YES;
return;
}
Expand Down
4 changes: 2 additions & 2 deletions bp/src/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ int main(int argc, char * argv[]) {
NSString *fileName = [NSString stringWithFormat:@"%@-stats.json", [[config.testBundlePath lastPathComponent] stringByDeletingPathExtension]];
NSString *outputFile = [config.outputDirectory stringByAppendingPathComponent:fileName];
BPWriter *statsWriter = [[BPWriter alloc] initWithDestination:BPWriterDestinationFile andPath:outputFile];
[[BPStats sharedStats] exitWithWriter:statsWriter exitCode:exitCode];
[[BPStats sharedStats] exitWithWriter:statsWriter exitCode:(int)exitCode];
}

[BPUtils printInfo:INFO withString:@"BP exiting %ld", (long)exitCode];
return exitCode;
return (int)exitCode;
}
}
2 changes: 1 addition & 1 deletion bp/tests/BluepillTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ - (void)testKeepSimulatorWithAppCrashingTestsSet {
}

//simulator shouldn't be kept in this case
- (void)testKeepSimulatorWithAppHaningTestsSet {
- (void)testKeepSimulatorWithAppHangingTestsSet {
NSString *testBundlePath = [BPTestHelper sampleAppHangingTestsBundlePath];
self.config.testBundlePath = testBundlePath;
self.config.keepSimulator = YES;
Expand Down
4 changes: 2 additions & 2 deletions scripts/bluepill.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ bluepill_instance_tests()
xcodebuild test \
-workspace Bluepill.xcworkspace \
-scheme bp-tests \
-derivedDataPath "build/" 2>&1 | tee result.txt | $XCPRETTY --output build/reports/instance.xml
-derivedDataPath "build/" 2>&1 | tee result.txt | $XCPRETTY | tee build/reports/instance.xml

if ! grep '\*\* TEST SUCCEEDED \*\*' result.txt; then
echo 'Test failed'
Expand All @@ -104,7 +104,7 @@ bluepill_runner_tests()
xcodebuild test \
-workspace Bluepill.xcworkspace \
-scheme bluepill-tests \
-derivedDataPath "build/" 2>&1 | tee result.txt | $XCPRETTY --output build/reports/runner.xml
-derivedDataPath "build/" 2>&1 | tee result.txt | $XCPRETTY | tee build/reports/runner.xml

if ! grep '\*\* TEST SUCCEEDED \*\*' result.txt; then
echo 'Test failed'
Expand Down

0 comments on commit 3b31024

Please sign in to comment.