Launching Unit Tests from ios-sim doesn't execute all tests

霸气de小男生 提交于 2019-12-11 03:13:49

问题


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

but something like

-args -XCTest All

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"

回答1:


2 points:

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"

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"


来源:https://stackoverflow.com/questions/27598931/launching-unit-tests-from-ios-sim-doesnt-execute-all-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!