![]() You could also get the latest from Subversion, but we’ll focus on the stable version for this tutorial.  You can get it from here: google-toolbox-for-mac-1-5-1.zip  The latest stable version is their 1.5.1 from June of 2008.  We won’t even use the entire unit testing portion, since there are helpers for Mac OS X unit testing as well.įirst, you’ll need to download the source. In this tutorial, we’ll focus on one subset of Google Toolbox for Mac, the unit testing portion.  For example, I used their Address Book interface to make working with Address Book on the iPhone much nicer.  It actually does a lot more than unit testing.  They’ve created a great project called Google Toolbox for Mac.  I was specifically referring to the Google Mac Team. In the first post, I alluded to a group of “diligent and ingenious engineers”. Step 3: Find and Install a Unit Testing Framework  You should see a UnitTestingFramework group underneath the example1 project. You should see a Group called “UnitTestingFramework” underneath the “example1” Project. ![]()  When the sheet pops up, do not select “Copy items into destination group’s folder (if needed).”  The reason is because it already is in the “example1” folder.  Create a folder named UnitTestingFramework in the example1 project folder.ĭrag and drop the “UnitTestingFramework” folder from Finder into the “example1” project in Xcode. So: In Finder, create a new Folder inside your “example1” project folder called “UnitTestingFramework.”  If you’re using a lot of external code in your project, you could put this under another folder called “OpenSourceFrameworks.”  I’ve done this in most of my consulting projects, but we’ll keep it simple since we’re only working with one “framework” in this tutorial. In this example, we will create a folder named “UnitTestingFramework” in our project to separate it from the rest of our code.  Instead, you end up copying all the files into your project.  There is no dynamic loading of libraries (which frameworks are) on the iPhone.  I say “frameworks” loosely because you can’t really have Mac OS X-style frameworks in your iPhone projects.  It helps if you isolate your “frameworks” into folders in Finder. One of the lessons learned from my iPhone consulting is that iPhone projects can get big and messy. Step 2: Create a Folder to Organize Your Unit Testing “Framework” Now that you have created the project, you can add the supporting files to enable unit testing.  Choose “View-Based Application” (you can choose any, but we’ll use this type here.)  Name your project “example1” to follow along with this tutorial.Īfter your project is created, it should look something like this: How do I set up an iPhone project that lets me unit test my app?Ĭreate a new project via File > New Project.  There are other guides out there but I’d like to make this very visual and easy.  My aim is to take you step by step through the process of setting up an iPhone Project in Xcode that lets you run unit tests. I am targeting this at iPhone Developers. This is the second part of a blog series I am writing on How to Do iPhone Unit Testing or Lessons Learned from Unit Testing iPhone Apps.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |