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:
Tyler Dauwalder
2002-07-18 01:03:19 +00:00
parent feae69d2c9
commit aad997bd6c
33 changed files with 1034 additions and 584 deletions
+28 -1
View File
@@ -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;
}