2002-07-09 16:24:59 +04:00
|
|
|
#ifndef _beos_test_case_h_
|
|
|
|
#define _beos_test_case_h_
|
|
|
|
|
|
|
|
#include <cppunit/TestCase.h>
|
|
|
|
#include <StorageDefs.h>
|
2002-07-11 07:28:37 +04:00
|
|
|
#include <SupportDefs.h>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2002-07-11 07:28:37 +04:00
|
|
|
//! Base class for single threaded unit tests
|
|
|
|
class BTestCase : public CppUnit::TestCase {
|
2002-07-09 16:24:59 +04:00
|
|
|
public:
|
2002-07-11 07:28:37 +04:00
|
|
|
BTestCase(std::string Name = "");
|
|
|
|
|
|
|
|
//! Displays the next sub test progress indicator (i.e. [0][1][2][3]...).
|
|
|
|
virtual void NextSubTest();
|
|
|
|
|
|
|
|
//! Starts a new sub test block (i.e. prints a newline :-)
|
|
|
|
virtual void NextSubTestBlock();
|
|
|
|
|
2002-07-17 14:50:55 +04:00
|
|
|
/*! \brief Prints to standard out just like printf, except shell verbosity
|
|
|
|
settings are honored.
|
|
|
|
*/
|
|
|
|
virtual void Outputf(const char *str, ...);
|
|
|
|
|
2002-07-11 07:28:37 +04:00
|
|
|
//! Saves the location of the current working directory.
|
2002-07-09 16:24:59 +04:00
|
|
|
void SaveCWD();
|
2002-07-11 07:28:37 +04:00
|
|
|
|
|
|
|
virtual void tearDown();
|
|
|
|
|
|
|
|
//! Restores the current working directory to last directory saved by a call to SaveCWD().
|
2002-07-09 16:24:59 +04:00
|
|
|
void RestoreCWD(const char *alternate = NULL);
|
|
|
|
protected:
|
|
|
|
bool fValidCWD;
|
2002-07-11 07:28:37 +04:00
|
|
|
char fCurrentWorkingDir[B_PATH_NAME_LENGTH+1];
|
|
|
|
int32 fSubTestNum;
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
2002-09-28 04:11:29 +04:00
|
|
|
#endif // _beos_test_case_h_
|