It is accomplished ...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user