
On Wed, 21 Jul 2004 09:59:58 +0800, Joel de Guzman wrote
Thank you Peter. After the release, I'll definitely move Spirit to use this simple, no frills, test utility. The requirements for such a facility should be 1) Works 100% on *ALL* compilers 2) Is transparent and does not get in the way (you can pretend it's not there at all) 3) Is 100% stable (no frequent API changes) 4) Is as simple as possible (less chance for Murphy's law to kick in). IMO, Boost.Test does not satisfactorily satisfy these requirements.
I have an alternative in date_time: http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/date_time/testfrmwk.hpp?rev=1.3&view=markup No macros in this one. Code hasn't been modified since well before Boost.Test was invented. Trivially simple usage: date d1(1900,1,1); //1st parameter gets passed to Pass / Fail output //second is condition to check check("1900-01-01 day is 01", d1.day() == 1); //... return printTestStats(); //returns number of failures and prints pass fail Output looks like: ====== BEGIN OUTPUT ====== Pass :: 1900-01-01 day is 01 Pass :: 1900-01-01 month is 01 Pass :: 1900-01-01 year is 1900 ... Pass :: check day of year number 75 Tests Executed: All Succeeded ====== END OUTPUT ====== Jeff ps: I wrote this in anger one day after trying to figure out cppunit -- took me way less time to write this -- never did figure out out how to use cppunit.