尝试在XcodeServer上针对模拟器设备运行测试时出错.测试有时会传递给一个设备而另一个设备会失败,但是失败的设备并不总是相同的.这可以在单个会话中发生.
日志文件错误如下:
2015-03-23 10:44:11.029 Initializing test infrastructure.
2015-03-23 10:44:11.029 Writing testing status log to /Library/Developer/XcodeServer/Integrations/Integration-7e6e54f21a2fd25cddc9df0436cb3688/Session-2015-03-23_10:44:10-tH1BD4.log.
2015-03-23 10:44:28.676 Launch session started, setting a disallow-finish-token on the run operation.
2015-03-23 10:44:30.352 Adding console adaptor for test process.
2015-03-23 10:44:39.566 Creating the connection.
2015-03-23 10:44:39.567 Listening for proxy connection request from the test bundle (all platforms)
2015-03-23 10:44:39.567 Resuming the connection.
2015-03-23 10:44:39.567 Test connection requires daemon assistance.
2015-03-23 10:44:39.568 Checking test manager availability..., will wait up to 120s
2015-03-23 10:45:05.253 testmanagerd handled …Run Code Online (Sandbox Code Playgroud) 我正在尝试对使用NSFileManager的方法进行单元测试,以检查文件是否存在并删除该文件。我不确定我是否正确设置了模拟对象。
即使可以确定,我仍收到“方法未调用”的信息。我是否在设置过程中缺少某些东西?
我将模拟对象设置如下:
- (void)testdeleteFileWithPath {
id fileManagerMock = OCMClassMock([NSFileManager class]);
OCMStub([NSFileManager defaultManager]).andReturn(fileManagerMock);
NSString *filePath = @"testPDF.pdf";
NSURL *fileURL = [self.documentsDirectory URLByAppendingPathComponent:filePath];
[self.fileDAO deleteFileWithPath:filePath];
OCMVerify([fileManagerMock fileExistsAtPath:[fileURL path]]);
}
- (void)deleteFileWithPath:(NSString *)filePath
{
if (filePath) {
NSURL *fileURL = [self.documentsDirectory URLByAppendingPathComponent:filePath];
NSError *error = nil;
if (![[NSFileManager defaultManager] fileExistsAtPath:[fileURL path]]) {
NSLog(@"File to delete does not exist. \nPath: %@", [fileURL absoluteString]);
} else
{
[[NSFileManager defaultManager] removeItemAtURL:fileURL error:&error];
NSLog(@"Error: %@", [error description]);
}
}
}
Run Code Online (Sandbox Code Playgroud) 升级到Xcode7之后,我们设置的机器人无法构建,并出现以下错误:
2015-09-23 15:57:22.989 xcodebuild[23194:3737599] [MT] iPhoneSimulator: Could not launch simulator: -1712
xcodebuild: error: Failed to build workspace *XXX* with scheme YYY.
Reason: The operation couldn’t be completed. (OSStatus error -1712.)
Run Code Online (Sandbox Code Playgroud)
机器人设置为iPads与之对抗IOS 9.0.
请建议我.
谢谢.