简体   繁体   中英

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.

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

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM