Capturing STDOUT from unit test
Capturing STDOUT from unit test
- Subject: Capturing STDOUT from unit test
- From: "Jason Sallis" <email@hidden>
- Date: Tue, 24 Jul 2007 15:14:03 -0600
I'm trying to write a unit test around an object that logs using NSLog and
printf. To verify that things are being logged correctly, in my unit tests
I want to instantiate an object, get it to log something, and then verify
the log output. Is there any way for me to capture what's output by NSLog
or printf this way? I've seen examples of using NSTask and NSPipe but they
seem to be used primarily when monitoring a spawned process, whereas I want
to just capture the output from my object.
Thanks,
Jason
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden