Re: C++ unit testing in Xcode
Re: C++ unit testing in Xcode
- Subject: Re: C++ unit testing in Xcode
- From: Tim Hart <email@hidden>
- Date: Mon, 07 Mar 2005 08:03:26 -0600
On Sunday, March 06, 2005, at 09:16PM, Sean Houghton <email@hidden> wrote:
>When a test fails Xcode detects the failure in the custom build stage
>but doesn't tell me about it. I have to look in the detailed build
>results, find the failure, manually open the file and go to the line
>that failed.
<snip>
>I've seen a few OC testing tools for Xcode that appear to add test
>failures to the "Errors and Warnings" list in Xcode. Can I populate
>this list from a shell script or AppleScript? Is anyone else using
>C++ and unit tests with Xcode?
You can certainly use any of the existing OC testing frameworks in order to test C++ code.
The built-in assertions would be fairly limited for you, with the notable exception of most frameworks' version of 'assertTrue'.
The way that the OC testing tools get XCode to identify errors and warnings is a bit kludgy, though. The command line tool actually sets up it's warning and error output format to be identical to that of gcc. This works most of the time, but can cause some cosmetic trouble.
For example, if a test fails, XCode will show you the line the test failed on. However, if the test code isn't 'touched', then the nice red 'x' on that line of the test source code will not disappear the next time the code is built. If your test build is fairly long, this can lead to confusing results - the error won't disappear until the entire test is successful.
If you want the format that XCode searches for, feel free to contact me off list and I'll provide it for you. It's probably to your best interest to choose an OC testing framework and use it, though. The next version of XCode/gcc may look for an entirely different error/warning string, which means a maintenance headache for you.
I'd be more than willing to work with you to add assertions that are C++ friendly to TestKit.
http://testkit.sourceforge.net
Tim Hart
>--
>Sean Houghton
> _______________________________________________
>Do not post admin requests to the list. They will be ignored.
>Xcode-users mailing list (email@hidden)
>Help/Unsubscribe/Update your Subscription:
>
>This email sent to email@hidden
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden