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