以下是Apple自动生成代码的示例测试用例:
@interface TransformationTests : XCTestCase
@end
@implementation TransformationTests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
由于以下问题,任何测试均失败:
IDEBundleInjection.c: Error accessing bundle '<>/Library/Developer/Xcode/DerivedData/Transformation-epxdcmceeyrkpqaqhckucbknydvi/Build/Products/Debug-iphonesimulator/TransformationTests.xctest'
DevToolsBundleInjection environment:
XCInjectDiagnostics: (null)
XCInjectBundleInto: <>/Library/Developer/Xcode/DerivedData/Transformation-epxdcmceeyrkpqaqhckucbknydvi/Build/Products/Debug-iphonesimulator/Transformation.app/Transformation
XCInjectBundle: <>/Library/Developer/Xcode/DerivedData/Transformation-epxdcmceeyrkpqaqhckucbknydvi/Build/Products/Debug-iphonesimulator/TransformationTests.xctest
TestBundleLocation: <>/Library/Developer/Xcode/DerivedData/Transformation-epxdcmceeyrkpqaqhckucbknydvi/Build/Products/Debug-iphonesimulator/TransformationTests.xctest
TMPDIR: <>/Library/Developer/CoreSimulator/Devices/C55DBC49-3E15-4424-AB04-8F080B3DFB44/data/Containers/Data/Application/9166EE1F-741D-4E34-8ECE-F048215B84CC/tmp
DYLD_LIBRARY_PATH: <>/Library/Developer/Xcode/DerivedData/Transformation-epxdcmceeyrkpqaqhckucbknydvi/Build/Products/Debug-iphonesimulator
DYLD_INSERT_LIBRARIES: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection
DYLD_FRAMEWORK_PATH: <>/Library/Developer/Xcode/DerivedData/Transformation-epxdcmceeyrkpqaqhckucbknydvi/Build/Products/Debug-iphonesimulator
DYLD_FALLBACK_LIBRARY_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
DYLD_FALLBACK_FRAMEWORK_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks
*** Test session exited(1) without checking in. If you believe this error represents a bug, please attach the log file at /var/folders/d7/_7pl6k7d7nz6k0vhw3d8tnqm0000gn/T/com.apple.dt.XCTest-status/Session-2015-05-15_15:07:22-jSYNZc.log
在派生数据文件夹中,缺少xctest文件夹;我不确定如何让Xcode为我生成它。有什么指针吗?
编辑:我最好的案例解决方案是创建一个新项目。 :X
答案 0 :(得分:0)
我的解决方案 - 清除派生数据目录。为我工作。 :/