EECS 211
MacPorts Notes

This course uses the gcc compiler and, to a lesser extent, the Unix or Linux environment, both for consistency, and to expose you to the platform used by many practitioners in computer science. MacOS X comes with the gcc compiler already installed. MacPorts, somewhat like the CygWin installer, is an application that makes it easy to download and install open-source software packages, such as CppUnit, a C++ testing framework.

Installing MacPorts

The Apple Developer Connection has a very nice article on how to install MacPorts, use MacPorts to install other code, and build an XCode project using the code installed by MacPorts. You should read that article first. Our notes below show what to do to use MacPorts to install and test CppUnit.

First, make sure you have XCode installed. It's on the developer CD that came with your Macintosh. If you don't have it, you can get it from Apple. It's a very big download, so use the CD if you have it.

Next, download and run the current version of the MacPorts installer from the MacPorts website.

Installing CppUnit with MacPorts

Installing software packages with MacPorts is very easy. We'll show how to use it to CppUnit. The same steps would work with any other package.

The default way to run MacPorts is to enter text commands in a Terminal window. There are graphical front-ends as well, but the command lines are very simple for what you'll need to do, so that's all we'll show here.

Using CppUnit in XCode

To test that CppUnit is installed and working correctly, follow these example XCode project setup instructions. These files have code that define some simple test cases. Some of these tests are supposed to fail, in order to show you what that looks like.


Comments? comment icon Contact the Prof!

Valid HTML 4.01 Transitional