Tuesday, February 8, 2011

SymbianOSUnit and Symbian^3 Compilation Issues

Although there is a lot of buzz around the future of Symbian and what OS Nokia should adopt in its place, there are a lot of developing still running over it. If Nokia plans to change its focus and leave Symbian for a Android or even Windows Phone 7 this will occur gradually. Also, if Nokia keeps Symbian as its choice for OS there will be still a lot of development with Symbian/C++ since Qt still needs to get more APIs available (QtMobility project) to encompass all the developer needs.

So the point is that the development with Symbian OS, as like any other platform, needs to support unit tests. The Symbian always had a pretty good open project for that: SymbianOSUnit . The latest available version dates from 2008-05-13. Besides that it works pretty well in S60 5th edition. The problem happens when it comes to Symbian^3 SDK. Unfortunately there are a lot of missing files when trying to compile it for the first time. To fix this the developer needs to add some missing system paths in the file SymbianOSUnit\SymbianOSUnitApp\group\S60_3RD\SymbianOSUnit.source

SYSTEMINCLUDE   \epoc32\include\mw
SYSTEMINCLUDE   \epoc32\include\platform
SYSTEMINCLUDE   \epoc32\include\platform\mw

Other problem that was preventing a successful compilation was a missing macro in the Logger.cpp file of the SymbianOSUnitApp project. The macro __PROFILE_RESET at line 31 that used to be defined in file e32def.h is now defined in file e32def_private.h under the platform folder. The solution is to add the following include in the Logger.cpp file.

#include <e32def_private.h>

After these changes the SymbianOSUnit can compile and run again.