Re: cross platform TestPlugIn

"Baptiste Lepilleur" <[email protected]> Wed, 18 Jun 2003 10:00:34 +0200
Newsgroups gmane.comp.lib.cppunit.devel
Message-ID <008401c3356f$b3acbcb0$bb86c2d4@gaia>
----- Original Message ----- 
From: "Allen Unueco" <[email protected]>
To: <[email protected]>
Sent: Wednesday, June 18, 2003 1:34 AM
Subject: [Cppunit-devel] cross platform TestPlugIn


> Currently we are using an older version of cppunit and I created a
> dynamically loadable TestSuite which is similar to the
TestPlugInInterface.
>
> Our use model is this; A long TestRunner process which loads the test
> dll/so, get the suite, run the tests, free the suite and then unload the
> test dll/so. This allows you to then re-compile/link the test dll and run
> the tests again without having to restart the TestRunner. There were
issues
> with allocating/de-allocating memory between lib boundaries so my
> TestLibrary interface was basically like this.
>
> virtual CppUnit::TestSuite* GetSuite(void);
> virtual void FreeSuite(CppUnit::TestSuite* pTests);
>
> I'm in the process of updating to the latest version cppunit in cvs. I
> noticed that are TestPlugIn's but at this point it seems like it only
> supports Win32. Has anyone worked on supporting this across the rest of
the

How did you come to that conclusion ? Test plug-in should works on BeOS,
Hp-UX (shl), Unix (dl lib) and WIN32.

Test registration is done through the TestFactoryRegistry. This may be
automatic (using the test registration macro, as it is a singleton), or
explicit using the initialize/uninitialize hook of CppUnitTestPlugIn.

It requires allocation between dll boundary to be compatible. As far as I
know, it is not possible to run the test outside the dll and not have this
requirement, as exception may cross dll boundary.

Notes that you need to compile cppunit as a dynamic library to use the
TestFactoryRegistry automatically (so the singleton is shared).

> unix platforms? I also didn't see where the CppUnit::Test* would be
cleaned
> up. If I remember correctly there were issues with the TestRunner and
> TestResult classes where they would try to free the Test classes, I had to
> make some changes in this area also.
>
> I would like to be able to use cppunit 'out of the box' as opposed to
> maintain our own modified version. We need to the same level of support on
> the 5 platforms listed below.
>
> Windows i386/ia64/x86-64 / MS 2003 DDK
> Linux / GCC 3.x / STLport 4.5.3
> Solaris (7,8,9) / Sun Workshop 6.2 / STLport 4.5.3
> HP-UX / aCC A.03.30 / STLport 4.5.0
> AIX / Visual Age C++ 6.0 / STLport 4.5.3

Expect trouble on AIX when compiling the shared library. I think the issue
is related to gnu libtool, but I don't know enough to make a valuable
report.

Please, report the correct configure line they differ from the one indicated
in install-UNIX.

> We can offer some resources to get this completed I just didn't want to
step
> on anyone toes or duplicate any effort. Who is coordinating the next
(2.0?)
> cppunit release? What are the release criteria?

I guess that would be me if I'm still around ;-). The next version should be
1.10 (basically the current cvs snapshot).

2.0 is a full reimplementation which should  be simpler and more flexible
(the use of smart-pointer help). I plan to open a wiki for features and
design discussion when I have enough of the core base working.

Baptiste.

> -allen



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php