# Wednesday, October 03, 2007
« Don't Override MSBuild Targets, Append! | Main | Notes on Porting C++ Code from Windows t... »

Being the only one at work with any Linux experience, I was elected by default to port our C++ API over to Linux.  Luckily we had some CxxTests already being utilized on Windows, and good thing we did because as I found out, just getting our API to compile on Linux didn't mean it would run on Linux.  These unit tests saved me around 2 days of work (it only took me about 12 hours to port).

The Linux environment I chose to use was Ubuntu running Eclipse CDT.  After some Googling I found that there's an Eclipse plugin for CxxTest that is similar to the Eclipse JUnit runner.  That sounded very appealing; I sure wish there was Visual Studio CxxTest runner.  Unfortunately all of the instructions for the plugin are about getting it to work with Windows and Cygwin, which wasn't much help in my scenario.  To get the pluging to work I found I needed to:

  1. Install the BFD dev library onto my Ubuntu system using apt-get.
  2. Remove the -libintl flag from the test project's additional libraries section.

After making those changes I was able to get the CxxTest runner building and running just fine.  The one thing I did notice is that the tests run only after 2 rebuilds of the test project.  I'm not sure why that is, or if I was doing something wrong - it was getting annoying having to edit my test file, compile, edit it again, and then recompile a second time to get the tests to run.  There must be a manual way to force the tests to build...

Tuesday, June 24, 2008 1:50:34 AM (GMT Standard Time, UTC+00:00)
If you edit your .project file by cut and pasting the net.sf.webcat.eclipse.cxxtest.cxxtestrunner buildCommand block, it runs the tests twice each time you build and you don't have to do the manual extra build yourself.
Ryan R
Tuesday, June 24, 2008 4:31:50 AM (GMT Standard Time, UTC+00:00)
Awesome, thanks!
Comments are closed.