onsdag 20 april 2011

iPhone Simulator + unittests

I just recently added the google test framework to my code and when doing so I also had may aims set at making sure I got it working on as many platforms as possible. First out was testing on OSX which worked fine and from there the next step was adding support for the iphone simulator.

Making it gtest compile for iphone/simulator wasn't anymore trouble some than compiling other libraries cross platform. Instead, the trouble came when trying to execute the compiled tests through the simulator.

lördag 16 april 2011

valgrind + osx

I just started implementing unit tests for my hobby project and I wanted to integrate valgrind into my testing process, especially since it recently got fully supported on OSX. So I tried the MacPorts installation of the package. Unfortunately, I run a 10.6 64-bit os and so the packages that are automatically built come out as x86_64 executables. But in my hobby project, I keep everything 32bit. And even though the valgrind documentation indicates that it should work with both 32 bit and 64 bit executables, I couldn't get it to work. It just produced errors like:
valgrind: ./a.out: cannot execute binary file


So, my current solution is that I've downloaded the source and compiled it with only 32 bit support. Instructions are found here with the change:
./configure --enable-only32bit

And I keep the working 64 version available so I can still test all executables.

If anyone knows what I should do to get both 32/64 bit support in the same valgrind executable, please let me know!