Last updated: July 3, 2009
These notes describe how to test that your C++ setup, including your gcc compiler, UnitTest++, and Makefile, are ready for use in my C++ courses.
Be sure that you have installed all the software described here including the the sample geometry project archive. This includes code that uses UnitTest++ and the NU EECS Magic Makefile. This Makefile can be used unchanged in any course project to automatically compile the C++ files in a directory.
Extract the files from the sample project archive into the directory where you are keeping projects for your course. The Zip file will create the subdirectory geometry.
Open a terminal window (Unix or MacOS X) or a Cygwin window (Windows).
cd to the geometry directory.
If everything is set up correctly, the project should build without
errors or warnings.
If the build succeeds, type
./geometry.exe to run the code.
You should see this output:
GeometryTests.cpp:22: error: Failure in areaNegativeSides: Expected 0 but was -10 GeometryTests.cpp:23: error: Failure in areaNegativeSides: Expected 0 but was -10 GeometryTests.cpp:24: error: Failure in areaNegativeSides: Expected 0 but was 10 FAILURE: 1 out of 3 tests failed (3 failures). Test time: 0.01 seconds.
The above failure messages are OK. If you do not see these messages, or see different messages, there's something wrong with your setup.
Comments? Let me know!