Matt - sanemat
Matt - sanemat

Reputation: 5618

How do I catch OCUnit's test fail/success in command line?

My Expect: # Build Successed # and # Test Failed #

Actual Result: only # Build Succeeded #

How do I get fail/success in command line? [iphone, objective-c, xcode4, OCUnit]

I'm newbe of OCUnit and Xcode4. I create project: https://github.com/sanemat/HogeHoge This is scafold code by xcode4. I run test in xcode gui, #Test Failed# appear in successfully. In commandline (I want to use jenkins),I use following command.

xcodebuild -target HogeHogeTests -configuration Debug -sdk iphonesimulator4.3 clean build

I see # Build Succeeded # and then completed. I want run test and get it's result. How?

Edited:

I found BPOCUnitXMLReporter. This is for MacOS. I forked and adjusted iOS.

Upvotes: 0

Views: 1004

Answers (4)

bigkm
bigkm

Reputation: 2277

what you're looking for is this undocumented argument (you do need sdk and target too) to run your OCUnit Tests from the terminal

xcodebuild  -target MyTarget -sdk iphonesimulator   TEST_AFTER_BUILD=YES

Upvotes: 0

Matt - sanemat
Matt - sanemat

Reputation: 5618

I found BPOCUnitXMLReporter. This is for MacOS. I forked and adjusted iOS.

Upvotes: 1

Johannes Rudolph
Johannes Rudolph

Reputation: 35741

You can integrate a custom test logger with OCUnit. See my answer here: How do I trap OCUnit test pass/failure messages/events

Upvotes: 0

aflat
aflat

Reputation: 4329

Try the Text Finder Plugin It allows you to search a log for a string, and set pass or fail based on that.

Upvotes: 0

Related Questions