Big CppUnit Update

+ Initial threaded test support
+ Integrated CppUnitShell code into TestShell


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@77 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder
2002-07-11 03:31:07 +00:00
parent e5c292c0c9
commit 03aa30ce94
5 changed files with 327 additions and 38 deletions
+23 -13
View File
@@ -1,33 +1,43 @@
#include <TestCase.h>
#include <unistd.h>
#include <stdio.h>
TestCase::TestCase()
: CppUnit::TestCase()
, fValidCWD(false)
{
}
TestCase::TestCase(std::string name)
BTestCase::BTestCase(std::string name)
: CppUnit::TestCase(name)
, fValidCWD(false)
, fSubTestNum(0)
{
}
// Saves the location of the current working directory. To return to the
// last saved working directory, all \ref RestorCWD().
void
TestCase::SaveCWD() {
BTestCase::tearDown() {
NextSubTestBlock();
}
void
BTestCase::NextSubTest() {
printf("[%ld]", fSubTestNum++);
fflush(stdout);
}
void
BTestCase::NextSubTestBlock() {
// printf("\n");
}
/*! To return to the last saved working directory, call RestoreCWD(). */
void
BTestCase::SaveCWD() {
fValidCWD = getcwd(fCurrentWorkingDir, B_PATH_NAME_LENGTH);
}
/* Restores the current working directory to last directory saved by a
call to SaveCWD(). If SaveCWD() has not been called and an alternate
/* If SaveCWD() has not been called and an alternate
directory is specified by alternate, the current working directory is
changed to alternate. If alternate is null, the current working directory
is not modified.
*/
void
TestCase::RestoreCWD(const char *alternate) {
BTestCase::RestoreCWD(const char *alternate) {
if (fValidCWD)
chdir(fCurrentWorkingDir);
else if (alternate != NULL)