1#ifndef _beos_test_case_h_
2#define _beos_test_case_h_
3
4#include <BeBuild.h>
5#include <cppunit/TestCase.h>
6#include <StorageDefs.h>
7#include <SupportDefs.h>
8
9//! Base class for single threaded unit tests
10class CPPUNIT_API BTestCase : public CppUnit::TestCase {
11public:
12	BTestCase(std::string Name = "");
13
14	//! Displays the next sub test progress indicator (i.e. [0][1][2][3]...).
15	virtual void NextSubTest();
16
17	//! Starts a new sub test block (i.e. prints a newline :-)
18	virtual void NextSubTestBlock();
19
20	/*! \brief Prints to standard out just like printf, except shell verbosity
21		settings are honored.
22	*/
23	virtual void Outputf(const char *str, ...);
24
25	//! Saves the location of the current working directory.
26	void SaveCWD();
27
28	virtual void tearDown();
29
30	//! Restores the current working directory to last directory saved by a	call to SaveCWD().
31	void RestoreCWD(const char *alternate = NULL);
32protected:
33	bool fValidCWD;
34	char fCurrentWorkingDir[B_PATH_NAME_LENGTH+1];
35	int32 fSubTestNum;
36};
37
38#endif // _beos_test_case_h_
39