6

I am new to running unit tests using Catch.

I am using the Catch to run unit tests in my Xcode project. I have added a target to my project which includes my Catch files and tests cases. Selecting that target and running from Xcode runs fine. I am now trying to get it to run from the command line which will be the way it is run from Jenkins. I have a shell script that contains:

xcodebuild clean install
xcodebuild -target TestApp  -configuration “Debug”  -sdk iphonesimulator7.1   CONFIGURATION_BUILD_DIR=TestBuild ONLY_ACTIVE_ARCH=NO

The result is:

** INSTALL SUCCEEDED **

Build settings from command line:
    CONFIGURATION_BUILD_DIR = TestBuild
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphonesimulator7.1

--- xcodebuild: WARNING: Configuration “Release” is not in the project. Building default configuration.

=== BUILD TARGET CreativeSDKTest OF PROJECT CreativeSDKImage WITH THE DEFAULT CONFIGURATION (Release) ===

Check dependencies

** BUILD SUCCEEDED **

But the application doesn’t launch in the simulator. Maybe I’m not seeing the obvious but from all the docs I’ve read, this should launch the application.

1
  • BTW, I've tried adding the line: ./TestBuild/CreativeSDKTest.app/CreativeSDKTest but I get this as a result: dyld: Library not loaded: /System/Library/Frameworks/UIKit.framework/UIKit Referenced from: /Users/mscarafo/mscarafo_mscarafo-osx_278/ImageSDK.git/CreativeSDK/source/elements/image/build/./TestBuild/CreativeSDKTest.app/CreativeSDKTest Reason: image not found ./unit_test.sh: line 10: 65751 Trace/BPT trap: 5 ./TestBuild/CreativeSDKTest.app/CreativeSDKTest Commented Apr 17, 2014 at 17:05

1 Answer 1

1

I think you'll need to tell xcodebuild to test the project:

xcodebuild clean install
xcodebuild -target TestApp  -configuration “Debug”  -sdk iphonesimulator7.1   CONFIGURATION_BUILD_DIR=TestBuild ONLY_ACTIVE_ARCH=NO clean test

(See the end of the last command)

EDIT: In fact you probably don't even need the first command and just the second will do.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for the response but including the clean test results in this:
** CLEAN SUCCEEDED ** === BUILD TARGET CreativeSDKTest OF PROJECT CreativeSDKImage WITH THE DEFAULT CONFIGURATION (Release) === Check dependencies unsupported build action 'test' ** TEST FAILED **
What's the output of xcodebuild -list (run from the same directory where the .xcodeproj is?
Remember I'm am using Catch as a unit test frame work, not XCTest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.