Search for THE UnitTest Framework

September 29, 2006

I’m currently trying out Test Driven Development with some of my team members who are interested.
I’ve been looking for a unit test framework that is easy to use and light weight.
I’ve looked at CppUnit first since it is the most popular but it seemed difficult to use and the framework seemed to be too heavy.
I was looking for a framework for C/C++ that can support both Win32 development on the desktop and on a Windows Mobile(or Windows CE based) device.
I don’t know of any but I wanted something that can be ported to Windows Mobile with minor work.

During the search I came across a good article comparing 6 popular(?) frameworks.
(http://www.gamesfromwithin.com/articles/0412/000061.html)

After reading the article I tried out CppUnitLite and thought this was what I wanted.
Although it lacked some features like providing fixtures or test suites, I figured I could add the featured I’ve needed myself.
The framework was very lightweight and it seemed to be easily portable to any plaform.

After doing more searching I’ve found that the guy who wrote the article above also modified CppUnitLite and released it as CppUnitLite2.
(http://www.gamesfromwithin.com/articles/0512/000103.html)

Even more searching lead me to find that he and a few others evolved the framework and released it under a new name called “UnitTest++”.
(http://www.gamesfromwithin.com/articles/0603/000108.html)

After experimenting it a little I knew this is the framework that closely matches what I’ve been looking for.
It was easy to use just like CppUnitLite however there were enough features added to make a good use of it right away.
It wasn’t very lightweight but it’s not heavyweight either and it seemed perfect for my(or our) needs.
I’ve setup a new Windows Mobile 5.0 project on Visual Studio 2005 and tried building the framework.
I only had to comment out 2 functions that does not exist on Windows CE based device and it built successfully.

I’m planning to cover little bit more about my experienced on the framework on several following posts.

Advertisements

3 Responses to “Search for THE UnitTest Framework”

  1. kenny goers Says:

    Just wondering how you faired with building UnitTest++ for pocket pc and smartphone. I’ve it running with the exception of null pointer references in the TestUnitTest++ tests.

    Thanks,
    Kenny Goers

  2. coderiff Says:

    Wow! First commenter to my blog.
    Now I got a reason to update it 🙂

    Frankly, I haven’t used UnitTest++ much. I wanted to use it during software development at work but the project I’m working on involves lot’s of existing code and extensive use of network protocols and with couple of other factors make it very diffcult to use unit testing.
    All I did was comment out the ThreadAffinity() API which does not exists on Windows Mobile and I just ran the test code in debug mode(F5). I can find the results on the output window.
    It seems that exception handling is different on WM so the application would break on exceptions and stop running but for me it doesn’t matter much since you have to fix the code anyway.
    Anyway we don’t use C++ exceptions in our current code.
    I wanted have a close look at the framework source code but since I’m not actively using right now. I’m just leaving it as it is. I haven’t used it much but I still think its the best I’ve found so far for both Windows desktop and Window Mobile.

  3. Miron ophir Says:

    Could you publish the required changes to make it work on a Windows Mobile smartphone device?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: