1 #ifndef _beos_threaded_test_case_h_
2 #define _beos_threaded_test_case_h_
11 //! Base class for single threaded unit tests
12 class CPPUNIT_API BThreadedTestCase
: public BTestCase
{
14 BThreadedTestCase(std::string Name
= "", std::string progressSeparator
= ".");
15 virtual ~BThreadedTestCase();
17 /*! \brief Displays the next sub test progress indicator for the
18 thread in which it's called (i.e. [A.0][B.0][A.1][A.2][B.1]...). */
19 virtual void NextSubTest();
21 /*! \brief Prints to standard out just like printf, except shell verbosity
22 settings are honored, and output from threads other than the main thread
23 happens before the test is over.
25 \note Currently your output is limited to a length of 1024 characters. If
26 you really need to print a single string that's long than that, fix the
27 function yourself :-).
29 virtual void Outputf(const char *str
, ...);
31 //! Saves the location of the current working directory.
34 //! Restores the current working directory to last directory saved by a call to SaveCWD().
35 void RestoreCWD(const char *alternate
= NULL
);
36 void InitThreadInfo(thread_id id
, std::string threadName
);
37 bool RegisterForUse();
38 void UnregisterForUse();
40 std::vector
<std::string
>& AcquireUpdateList();
41 void ReleaseUpdateList();
45 // friend class ThreadManager<BThreadedTestCase>;
46 std::string fProgressSeparator
;
48 struct ThreadSubTestInfo
{
52 std::map
<thread_id
, ThreadSubTestInfo
*> fNumberMap
;
53 std::vector
<std::string
> fUpdateList
;
58 #endif // _beos_threaded_test_case_h_