在Xcode 6.3中将测试目标添加到现有项目中

时间:2015-04-10 12:09:01

标签: ios xcode unit-testing xcode6 xcode6.3

注意:这个问题是相关的,但那里给出的答案并没有解决我的问题:XC Testing Framework iOS(XCode 6.1) Test session exited(80) without checking in

我有现有的iOS代码,我想用Xcode 6.3开始编写XCTest案例。我通过单击Test Navigator中的+来创建测试目标。为我创建了一个测试目标,包括一个带有单元测试的文件测试。

测试在测试导航器中显示为灰色(我无法单击cmd + T)。

问题1 :如何启用测试?

编辑:此屏幕截图中描述了答案:https://www.evernote.com/shard/s4/sh/6a5ca990-d723-46ee-bf77-2cf0ff4e70b2/1a62c472fbbeeffa595fcecd4a9fbbf7,我在此处找到:Adding Unit Tests to an already existing project?

在我的项目设置中,我的生产目标(旧版)有以下设置: Project settings production target 以及我的测试目标的以下设置(自动生成): Project settings test target

如果我通过单击Test Navigator中的Play按钮手动运行我的测试,则会收到以下大量错误消息。

Warning: Error creating LLDB target at path '/Users/erwin/Library/Developer/Xcode/DerivedData/NyonOrder-bzkqdvtkegbjpuccyzmrgprbjqgm/Build/Products/Debug-iphonesimulator/OrderWriter.app'- using an empty LLDB target which can cause slow memory reads from remote devices.
IDEBundleInjection.c: Error 3585 loading bundle '/Users/erwin/Library/Developer/Xcode/DerivedData/NyonOrder-bzkqdvtkegbjpuccyzmrgprbjqgm/Build/Products/Debug-iphonesimulator/NyonOrderTests.xctest': The bundle “NyonOrderTests” couldn’t be loaded because it doesn’t contain a version for the current architecture.
DevToolsBundleInjection environment:
XCInjectDiagnostics: (null)
XCInjectBundleInto: /Users/erwin/Library/Developer/Xcode/DerivedData/NyonOrder-bzkqdvtkegbjpuccyzmrgprbjqgm/Build/Products/Debug-iphonesimulator/OrderWriter.app/OrderWriter
XCInjectBundle: /Users/erwin/Library/Developer/Xcode/DerivedData/NyonOrder-bzkqdvtkegbjpuccyzmrgprbjqgm/Build/Products/Debug-iphonesimulator/NyonOrderTests.xctest
TestBundleLocation: /Users/erwin/Library/Developer/Xcode/DerivedData/NyonOrder-bzkqdvtkegbjpuccyzmrgprbjqgm/Build/Products/Debug-iphonesimulator/NyonOrderTests.xctest
TMPDIR: /Users/erwin/Library/Developer/CoreSimulator/Devices/7094B929-04BD-459E-8E83-BDF9CBFA397A/data/Containers/Data/Application/B02B9956-754B-4663-9BC2-7191B0C2BFFE/tmp
DYLD_LIBRARY_PATH: /Users/erwin/Library/Developer/Xcode/DerivedData/NyonOrder-bzkqdvtkegbjpuccyzmrgprbjqgm/Build/Products/Debug-iphonesimulator
DYLD_INSERT_LIBRARIES: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection
DYLD_FRAMEWORK_PATH: /Users/erwin/Library/Developer/Xcode/DerivedData/NyonOrder-bzkqdvtkegbjpuccyzmrgprbjqgm/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(80) without checking in. Executable does not provide an architecture compatible with the current process. If you believe this error represents a bug, please attach the log file at /var/folders/cn/sfcysstx0zxb13qzdj35rh040000gn/T/com.apple.dt.XCTest-status/Session-2015-04-10_13:58:25-8ifyOV.log

问题2 :我还需要检查/更改哪些设置才能运行测试?

编辑将arm64添加到生产目标有效体系结构中解决了此特定错误。添加会有危险吗?

0 个答案:

没有答案
相关问题