bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Test framework; new counter class


From: Chad Yates
Subject: RE: Test framework; new counter class
Date: Mon, 30 Dec 2002 16:51:48 -0800

Albert,

I had been stewing over what unit testing framework would be best to use for
common c++, and just in the last few days had decided on cppunit.  This
morning I began writing some cppunit tests for common c++ also.  I have felt
that it needed a good suite of tests instead of the makshift shell script
test programs and thought it would be something I could develop/contribute.

I've written test fixtures for the persistent engine, and have started one
for the various digests (which I am having problems with because of the
strDigest function being protected in the digest subclasses).

I'm glad to see someone else that is interested in pursuing this, as I
wasn't sure if it would be welcome or not.  I had planned to convert all
existing tests to the framework and some of my own, and them push for
adoption (with a lot of the work done).  My primary dev environment right
now is MS Visual C++ 6.0 and so you have a leg up on the unix side.

Anyway, glad to hear about this, and maybe we all can discuss it further.

,chad

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf Of
> Albert Strasheim
> Sent: Monday, December 30, 2002 4:17 PM
> To: address@hidden
> Subject: Test framework; new counter class
>
>
> Hello,
>
> Attached is a patch that contains the following:
>
> - some basic code for a test framework for Common C++ based on the
> CppUnit test library,
>
> - a counter class (called UberCounter for now) meant to unify the
> Counter, MutexCounter and AtomicCounter classes,
>
> - minor tweaks to configure.in and some Makefile.am files related to
> gcc compiler flags.
>
> The patch is against commoncpp2 in CVS on Tue Dec 31 02:00:00 GMT+2 2002
> or thereabouts.
>
> Firstly, a few notes about the proposed test framework.
>
> The CppUnit test library seems to be THE way to test any C++ project.
> Since Common C++ doesn't have much in the way of a test suite at the
> moment (which the exception of a few tests and demos), I think it would
> be wise to incorporate this test framework into the project to ensure a
> robust and bug-free library for everyone.
>
> To run the tests, compile Common C++ as usual, and then cd to the tests
> directory. Now run "make check" to build and run the tests.
>
> On Debian unstable, I currently configure Common C++ as follows:
>
> CC=/usr/bin/gcc-3.2 CXX=/usr/bin/g++-3.2 ./configure \
> --enable-maintainer-mode --with-cppunit-prefix=/home/fullung/opt
>
> For development purposes, I removed the "default" CppUnit from the
> system, and installed a recompiled (with gcc 3.2) CppUnit in
> /home/fullung/opt/{bin,lib,etc.}. This is neccesary due to the
> incompatible ABI changes between gcc 2.9x and gcc 3.2 which prevents
> one from linking code (the tests) compiled with gcc 3.2 against a
> library (default CppUnit) compiled with gcc 2.9x.
>
> This shouldn't be a problem on RedHat 8, which ships with gcc 3.2
> compiled libraries by default, or systems that only ship with gcc
> 2.9x compiled libraries.
>
> I noticed some weirdness when compiling the UberCounter tests with gcc
> 2.95.4, related to the tests for operator!=. If anyone else sees this
> behaviour and/or is able to provide a workaround, I would be most
> interested.
>
> The current tests are by no means complete (or even correct :-)), but it
> should serve as a good example of what can be done. Specifically, I
> still need to spend some time on the Thread tests.
>
> Secondly, some notes about the new counter class, UberCounter.
>
(snip)
>
> Cheers,
>
> Albert
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]