(You've already installed the OS X Developer Tools, right? Because otherwise you don't have any compiler in the first place.)
You just type 'sudo port selfupdate' to get the list of ports, then type 'sudo port install cppunit' and let it chug away. It'll take a while, because the developers of macports decided that supplying prebuilt binaries would be too much hassle or something, so you'll have to compile all the dependencies. I suggest downloading Doxygen from the doxygen site instead of building it because it takes a very long time to compile using macports: ftp link However, the GUI isn't terribly helpful, so the command line version might be better.
After it's done, you should be able to type doxygen to use it. To include cppunit, you should add
"-I/opt/local/include -L/opt/local/lib" to your g++ command, like so:
g++ -ansi -pedantic -I/opt/local/include -L/opt/local/lib -lcppunit -ldl -Wall -DTEST main.c++ -o main.app
I also omit the .app extension from the output file, because on OS X that's supposed to be an application and the output from g++ isn't.
Or you could just simply ssh to the CS machines. But I think it's important to understand how to do things on OS X.
Windows users: if you want a command line that sucks less than command prompt, use a PuTTY session to the CS machines, or if you want to build locally, a mintty set up with Cygwin.
Aside: we should be using googletest, because it's cooler and doesn't require registering every single test. It even has 'death tests' that check that a test crashes, and non-fatal assertions.