rickandviv.net
Rick and Vivian Reynolds' website
Rick's Cancer
Quinlan
Palm Stuff
  PalmFrotz
  PalmCUnit
Frinkiac 7
Intellivision

rickandviv musings

PalmCUnit: A Unit Testing framework for testing Palm apps written in C

While working on PalmFrotz, I decided to apply the XP principles that I was using at work. (In this context, XP stands for eXtreme Programming -- not the Microsoft Operating System.) I found something called PalmUnit, which is a C++ test runner for Palm. Since I'm not writing PalmFrotz in C++, I'm not using that runner.

However, I also found source code (at the same website) for a test runner for Palm that was a port of CUnit. I quickly found that it was lacking some basics of a test runner, so I updated it (fixing some memory leaks and such along the way). I emailed the original author, but I never heard back from him. I assume that his version of the code is pretty much abandoned.

So I'm going to place the source code here for anyone else to use.


Ahhh... The green bar. What every XP coder strives for.


Here's PalmCUnit showing some failures.


There is a detail screen available for each test that fails.


Version History

PalmCUnit 1.4.1

Ben Combee has put a nice article about using PalmCUnit on his website palmos.combee.net (how cool!). In the process, he has provided a couple small changes and a .MCP project file for building PalmCUnit in the CodeWarrior V9 environment. I don't have access to CodeWarrior at this time, so I'm just passing the file on in this package.

Here's a download link: PalmCUnit version 1.4.1

PalmCUnit 1.4

Thanks to Michael Nordstrom at the Plucker project (http://www.plkr.org) a few embarrassing bugs have been dealt with. I guess that's to be expected when the author of the code is the only one using it for some time. Thanks Michael! Glad to know that someone else is using PalmCUnit!

PalmCUnit 1.3.2

The Main GUI pane is a little more friendly -- the "Runs:" and "Failures:" entries now change dynamically as the tests are run.

PalmCUnit 1.3.1

I've made the last suite of tests run to be the default suite on the next launch of the application. This is very handy when combined with the "Run tests on app launch" preference.

PalmCUnit 1.3

While adding GUI form testing to my PalmFrotz project, I found that I needed a different style of ASSERT macro: one that allows me to define a section of the code for cleanup at the end of the test.

I've added a set of macros that end in _GOTOERR. Each of these behaves like their similarly named counterparts, except that instead of just returning to the calling code immediately upon registering the test failure, it branches to a label called ERR:. This was very important in my form unit testing, as I needed to set the tested form as the active form in order for it to behave correctly in testing. Of course, if such a test fails, I need it to set the unit testing framework's form back to the current active form before exiting the test.

If you're not doing this kind of convoluted form testing, you probably don't need this update.

PalmCUnit 1.2.1

I've found that the application ID that PalmCUnit was using (STRT) is a default ID that is generated by CodeWarrior. Since I don't use CW, I didn't notice this. I've changed the ID to UntT, which I've registered at PalmSource.

No new features have been added to 1.2.

PalmCUnit 1.2

I've added a small preferences database that will allow you to set a checkbox that causes the testrunner to automatically run all its tests when it is run.

This has turned out to be very nice for my programming in Falch's Developer Studio. I can just punch one button in the GUI and all my unit tests run!


Check the box if you want your tests to automatically run whenever you launch the tester.

PalmCUnit 1.1

Basic feature list for version 1.1:


About Us | About This Site | Contact Us