Finished migrating Storage Kit tests to new framework.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@292 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -23,9 +23,15 @@ BTestShell::BTestShell(const std::string &description, SyncObject *syncObject)
|
||||
, fDescription(description)
|
||||
, fTestResults(syncObject)
|
||||
, fListTestsAndExit(false)
|
||||
, fTestDir(NULL)
|
||||
{
|
||||
};
|
||||
|
||||
BTestShell::~BTestShell() {
|
||||
delete fTestDir;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BTestShell::AddSuite(BTestSuite *suite) {
|
||||
if (suite) {
|
||||
@@ -95,6 +101,9 @@ BTestShell::LoadSuitesFrom(BDirectory *libDir) {
|
||||
|
||||
int
|
||||
BTestShell::Run(int argc, char *argv[]) {
|
||||
// Make note of which directory we started in
|
||||
UpdateTestDir(argv);
|
||||
|
||||
// Parse the command line args
|
||||
if (!ProcessArguments(argc, argv))
|
||||
return 0;
|
||||
@@ -154,6 +163,11 @@ BTestShell::Verbosity() const {
|
||||
return fVerbosityLevel;
|
||||
}
|
||||
|
||||
const char*
|
||||
BTestShell::TestDir() const {
|
||||
return (fTestDir ? fTestDir->Path() : NULL);
|
||||
}
|
||||
|
||||
void
|
||||
BTestShell::PrintDescription(int argc, char *argv[]) {
|
||||
cout << endl << fDescription;
|
||||
@@ -253,8 +267,8 @@ BTestShell::InitOutput() {
|
||||
cout << "Tests" << endl;
|
||||
cout << "------------------------------------------------------------------------------" << endl;
|
||||
fTestResults.addListener(new BTestListener);
|
||||
fTestResults.addListener(&fResultsCollector);
|
||||
}
|
||||
fTestResults.addListener(&fResultsCollector);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -319,3 +333,16 @@ BTestShell::LoadDynamicSuites() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BTestShell::UpdateTestDir(char *argv[]) {
|
||||
BPath path(argv[0]);
|
||||
if (path.InitCheck() == B_OK) {
|
||||
delete fTestDir;
|
||||
fTestDir = new BPath();
|
||||
if (path.GetParent(fTestDir) != B_OK)
|
||||
cout << "Couldn't get test dir." << endl;
|
||||
} else
|
||||
cout << "Couldn't find the path to the test app." << endl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user