RE: [Cppunit-devel] CppUnit and multi-threading
Brought to you by:
blep
From: Tzanev, S. <Ste...@re...> - 2003-07-17 21:11:39
|
Hi Baptiste, Thank you for the prompt response. I was trying to do (2) - a test suite with two threads. I'm work on a socket application which acts both as a server and as a client. For this purpose the test harness has to have a primary thread (from which the client calls, like connect, send, recv and disconnect are made) and a secondary thread for the listener (for calls like bind, listen, accept, send and recv). I was hoping that I should be able to have only one TestRunner and that CppUnit would handle under the hood the exceptions that were thrown (via CPPUNIT_ASSERT and the like) from the secondary thread. As this is not the case and because I am lazy enough not to rush into creating a special mechanism for exception propagation between the threads I used the following workaround: I use named registries and a separate TestRunner for each thread. It works fine. The only disadvantage is that two sets of results are reported. But that's not a big deal. Thanks again. Regards, Stefan =20 -----Original Message----- From: Baptiste Lepilleur [mailto:gai...@fr...]=20 Sent: Thursday, July 17, 2003 4:53 PM To: Tzanev, Stefan; cpp...@li... Subject: Re: [Cppunit-devel] CppUnit and multi-threading TestFactoryRegistry is not thread-safe, but you can easily wrap it to make it so. =20 CppUnit is thread-safe, which the exception of the TypeInfoHelper which use a static variable (but it should be initialized at when registering the test factory, so it is probably ok). =20 What exactly are you trying to multithread ?=20 1) running multiple test case at the same time, using multiple test result ? 2) a test case which multiple thread ? 3) ??? =20 Baptiste. ----- Original Message -----=20 From: Tzanev, Stefan <mailto:Ste...@re...>=20=20 To: cpp...@li...=20 Sent: Tuesday, July 15, 2003 9:31 PM Subject: [Cppunit-devel] CppUnit and multi-threading Dear Sirs, I'm using CppUnit for a first time and I have problems testing a multithreaded system. Should I create a separate TestFixture (suite) for each thread or is there a=20 different approach? That is, does CppUnit support multi-threading? Is it possible to use TestFactoryRegistry in a multi-threaded environment? Thank you. Sincerely, =20 Stefan Tzanev Software Engineer Software Applications Group Respironics, Inc. Phone: 724-387-4860 =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D CONFIDENTIALITY NOTICE ---------------------- This message, together with any attachments, may be legally privileged and is confidential information intended only for the use of the individual or entity to which it is addressed. It is exempt from disclosure under applicable law including court orders. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution or copy of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender and delete this message, along with any attachments, from your computer.=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D CONFIDENTIALITY NOTICE ---------------------- This message, together with any attachments, may be legally privileged and is confidential information intended only for the use of the individual or entity to which it is addressed. It is exempt from disclosure under applicable law including court orders. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution or copy of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender and delete this message, along with any attachments, from your computer. |