从ios-sim启动单元测试不会执行所有测试 [英] Launching Unit Tests from ios-sim doesn't execute all tests
问题描述
我正在尝试使用此处所述的方法,使用ios-sim从CI启动测试: https ://confluence.atlassian.com/display/BAMBOO/Xcode ,但是我在应用程序中使用的是XCTest
而不是SenTest
,所以最后一个参数应该不是
I'm trying to launch tests from my CI using ios-sim using approach described here: https://confluence.atlassian.com/display/BAMBOO/Xcode , but instead of SenTest
I'm using XCTest
in my application, so last parameter should be not
--args -SenTest All
但类似
-args -XCTest All
,如果我使用此类参数,则不会执行所有测试.如何指定使用XCtest执行所有测试?如果我使用
and if I use such parameter, not all tests are executed. How can I specify executing all tests using XCtest? If I use
--args -XCTest -test All
没有测试被执行.完整的启动命令:
none of tests are executed. The full launch command:
ios-sim launch Target.app --devicetypeid 'com.apple.CoreSimulator.SimDeviceType.iPhone-5s, 8.1' --setenv DYLD_INSERT_LIBRARIES="/../../Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection" --setenv XCInjectBundle="UnitTests.xctest" --setenv XCInjectBundleInto="Target.app/Target" --args -XCTest All "UnitTests.xctest"
推荐答案
2分:
首先,这可能失败的原因是因为您的DYLD_INSERT_LIBRARIES是错误的.您应该使用"../../Library/PrivateFrameworks/IDEBund leInjection.framework/IDEBundleInjection"而不是"/../../Library/PrivateFrameworks/IDEBund leInjection.framework/IDEBundleInjection"
First off, the reason this is likely failing is because your DYLD_INSERT_LIBRARIES is wrong. You should be using "../../Library/PrivateFrameworks/IDEBund leInjection.framework/IDEBundleInjection" rather than "/../../Library/PrivateFrameworks/IDEBund leInjection.framework/IDEBundleInjection"
第二,从Xcode 6开始,实现所需功能的受支持方法是使用simctl:
Secondly, as of Xcode 6, the supported way of doing what you want is by using simctl:
SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="../../Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection"
SIMCTL_CHILD_XCInjectBundleInto="Target.app/Target"
SIMCTL_CHILD_XCInjectBundle="UnitTests.xctest"
xcrun simctl launch [device udid or "booted"] com.mycompany.myapp -XCTest All "UnitTests.xctest"
这篇关于从ios-sim启动单元测试不会执行所有测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!