• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Capturing STDOUT from unit test
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Capturing STDOUT from unit test
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: How useful are bit operators?
  • Next by Date: Re: Capturing STDOUT from unit test
  • Previous by thread: Re: How useful are bit operators?
  • Next by thread: Re: Capturing STDOUT from unit test
  • Index(es):
    • Date
    • Thread