Files
haiku-beta6/src/tools/cppunit/TestShell.cpp
T

37 lines
712 B
C++
Raw Normal View History

2002-07-09 12:24:59 +00:00
#include <TestShell.h>
#include <iostream>
#include <Path.h>
#include <stdio.h>
TestShell::TestShell(const std::string &description, SyncObject *syncObject)
: CppUnitShell(description, syncObject),
fTestDir(NULL)
{
}
TestShell::~TestShell()
{
delete fTestDir;
}
int
TestShell::Run(int argc, char *argv[])
{
// Let's hope BPath does work. ;-)
BPath path(argv[0]);
if (path.InitCheck() == B_OK) {
fTestDir = new BPath();
if (path.GetParent(fTestDir) != B_OK)
printf("Couldn't get test dir.\n");
} else
printf("Couldn't find the path to the test app.\n");
return CppUnitShell::Run(argc, argv);
}
const char*
TestShell::TestDir() const
{
return (fTestDir ? fTestDir->Path() : NULL);
}