xcode - Adding OCMock causes Test to launch main app instead of running tests -
xcode - Adding OCMock causes Test to launch main app instead of running tests -
i'm trying add together ocmock existing cocoa project, running unusual problem don't see else cover.
i isolated following: if add together ocmock.framework reference project (i.e. drag in somehow link binary libraries build phase), when run tests, real app gets launched instead.
without ocmock, output normal:
test suite 'multiple selected tests' started @ 2013-02-07 20:07:03 +0000
with ocmock framework link (partial output):
error loading myprojtests.octest/contents/macos/myprojtests library not loaded: @rpath/ocmock.framework/versions/a/ocmock reason: image not found idebundleinjection.c: error loading bundle '/users/alex/library/developer/xcode/deriveddata/myproj-bqwyxyspdiudktfnjcdgibdmpgsa/build/products/debug/myprojtests.octest'
other app output appears normal after point. while app running, test progress spinning on lastly tab of project navigator, , doesn't stop until quit app. test supposedly in progress whole time app running.
clearing test host or bundle loader didn't solve, produced linking errors wrong architecture.
i'm using latest xcode, 4.6. help appreciated.
ok, figured out, before nail submit here on so, figured i'd share answer. problem ocmock.framework wasn't available @ runtime.
the official ocmock steps download , add together target, don't tell add together re-create phase. added new phase in test target re-create framework products directory , tests run fine.
it unexpected main app launch, , hope helps else.
edit:
added pictures. loves pictures
step 1
step 2
step 3
step 4
xcode unit-testing compilation ocmock
Comments
Post a Comment