Big CppUnit update

+ Initial threaded test support
+ Integrated CppUnitShell code into TestShell


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@75 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder
2002-07-11 03:28:37 +00:00
parent aa3f51a786
commit 530d2bc9fe
9 changed files with 595 additions and 21 deletions
+38
View File
@@ -0,0 +1,38 @@
#ifndef _beos_threaded_test_case_h_
#define _beos_threaded_test_case_h_
#include <Locker.h>
#include <kernel/OS.h>
#include <TestCase.h>
#include <map>
#include <string>
//! Base class for single threaded unit tests
class BThreadedTestCase : public BTestCase {
public:
BThreadedTestCase(std::string Name = "", std::string progressSeparator = ".");
virtual ~BThreadedTestCase();
/*! \brief Displays the next sub test progress indicator for the
thread in which it's called (i.e. [A.0][B.0][A.1][A.2][B.1]...). */
virtual void NextSubTest();
//! Saves the location of the current working directory.
void SaveCWD();
//! Restores the current working directory to last directory saved by a call to SaveCWD().
void RestoreCWD(const char *alternate = NULL);
void InitThreadInfo(thread_id id, std::string threadName);
protected:
// friend class ThreadManager<BThreadedTestCase>;
std::string fProgressSeparator;
struct ThreadSubTestInfo {
std::string name;
int32 subTestNum;
};
std::map<thread_id, ThreadSubTestInfo*> fNumberMap;
BLocker *fNumberMapLock;
};
#endif // _beos_threaded_test_case_h_