Skip to content

Commit f695b5a

Browse files
authored
Merge pull request #32 from linkedin/small-bug-fixes
Small bug fixes
2 parents e50fcae + 95fcfd8 commit f695b5a

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

Bluepill-cli/Bluepill-cli/Bluepill/Bluepill.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ - (void)createSimulatorWithContext:(BPExecutionContext *)context {
202202

203203
handler.beginWith = ^{
204204
[[BPStats sharedStats] endTimer:stepName];
205-
[BPUtils printInfo:(__handler.error ? FAILED : INFO) withString:[@"Completed: " stringByAppendingString:stepName]];
205+
[BPUtils printInfo:(__handler.error ? FAILED : INFO)
206+
withString:[NSString stringWithFormat:@"Completed: %@ %@", stepName, context.runner.UDID]];
206207
};
207208

208209
handler.onSuccess = ^{

Bluepill-cli/Bluepill-cli/Simulator/SimulatorRunner.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
@interface SimulatorRunner : NSObject
1818

1919
@property (nonatomic, assign, readonly) BOOL needsRetry;
20+
@property (nonatomic, readonly) NSString *UDID;
2021

2122
+ (instancetype)simulatorRunnerWithConfiguration:(BPConfiguration *)config;
2223

Bluepill-cli/Bluepill-cli/Simulator/SimulatorRunner.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,4 +324,8 @@ - (BPExitStatus)exitStatus {
324324
return ([self.monitor exitStatus]);
325325
}
326326

327+
- (NSString *)UDID {
328+
return [self.device.UDID UUIDString];
329+
}
330+
327331
@end

Bluepill-runner/Bluepill-runner/BPRunner.m

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121

2222
void onInterrupt(int ignore) {
2323
interrupted ++;
24-
if (interrupted >=5) {
25-
fprintf(stderr, "You really want to terminate, OK!\n");
26-
exit(0);
27-
}
28-
fprintf(stderr, "Received interrupt (Ctrl-C) %d times, waiting for child processes to finish.\n", interrupted);
2924
}
3025

3126
int
@@ -163,8 +158,17 @@ - (int)run {
163158
int seconds = 0;
164159
__block NSMutableArray *taskList = [[NSMutableArray alloc] init];
165160
self.nsTaskList = [[NSMutableArray alloc] init];
161+
int old_interrupted = interrupted;
166162
while (1) {
167163
if (interrupted) {
164+
if (interrupted >=5) {
165+
[BPUtils printInfo:ERROR withString:@"You really want to terminate, OK!"];
166+
exit(0);
167+
}
168+
if (interrupted != old_interrupted) {
169+
[BPUtils printInfo:WARNING withString:[NSString stringWithFormat:@"Received interrupt (Ctrl-C) %d times, waiting for child processes to finish.", interrupted]];
170+
old_interrupted = interrupted;
171+
}
168172
[self interrupt];
169173
}
170174
if (([bundles count] == 0 && launchedTasks == 0) || (interrupted && launchedTasks == 0)) break;

0 commit comments

Comments
 (0)