Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#33 Threads support

open
nobody
5
2003-11-30
2003-11-30
zaufi
No

Hi!
In my project I wrote some addons for CppUnit for
multithreaded tests with ability to detect deadlocks...
So if u interesting in it I may send some sources to
u... In general it look like:
class ThreadedTestCaller_tester : public
CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(ThreadedTestCaller_tester);
CPPUNIT_DEADLOCK_TEST(forever_loop, 500,
CppUnit::FAIL_IF_NOT_DEADLOCK);
CPPUNIT_DEADLOCK_TEST(just_return, 500,
CppUnit::FAIL_IF_DEADLOCK);
CPPUNIT_MULTITHREADED_TEST_BEGIN(1000,
CppUnit::FAIL_IF_DEADLOCK);
CPPUNIT_TEST_THREAD_ORD(waiter, 1);
CPPUNIT_TEST_THREAD_ORD(signaler, 2);
CPPUNIT_TEST_THREAD(default_priority_thread);
CPPUNIT_MULTITHREADED_TEST_END();
CPPUNIT_TEST_SUITE_END();
...
};

it very help me to test some tricky locking code and
simulate multi node tests ...

Discussion

  • Logged In: NO

    can you please send the code to support multithreading to
    cppUnit?