Added dynamic test suite loading
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@239 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f1544e394c
commit
8d86fe19f9
@ -1,15 +1,23 @@
|
||||
#include "UnitTester.h"
|
||||
#include <LockerSyncObject.h>
|
||||
#include <SemaphoreSyncObject.h>
|
||||
#include <string>
|
||||
#include <Directory.h>
|
||||
|
||||
// ##### Include headers for statically linked tests here #####
|
||||
#include <ExampleTest.h>
|
||||
//#include <ExampleTest.h>
|
||||
|
||||
UnitTesterShell shell("OpenBeOS Unit Testing Framework", new LockerSyncObject);
|
||||
UnitTesterShell shell("OpenBeOS Unit Testing Framework", new SemaphoreSyncObject);
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
// ##### Add test suites for statically linked tests here #####
|
||||
shell.AddSuite( "Example", &ExampleTest::Suite );
|
||||
// shell.AddTest( "Example", ExampleTest::Suite() );
|
||||
|
||||
BTestShell::SetShell(&shell);
|
||||
|
||||
// Load our dynamically linked tests
|
||||
BDirectory libDir("./lib");
|
||||
int count = shell.LoadSuitesFrom(&libDir);
|
||||
cout << "Loaded " << count << " suites" << endl;
|
||||
|
||||
return shell.Run(argc, argv);
|
||||
}
|
||||
@ -27,15 +35,15 @@ UnitTesterShell::PrintDescription(int argc, char *argv[]) {
|
||||
cout << "of testing and verifying the various kits, classes, functions," << endl;
|
||||
cout << "and the like that comprise OpenBeOS." << endl;
|
||||
|
||||
if (AppName.rfind("UnitTester.R5") != std::string::npos) {
|
||||
if (AppName.rfind("UnitTester_r5") != std::string::npos) {
|
||||
cout << endl;
|
||||
cout << "Judging by its name (UnitTester.R5), this copy was" << endl;
|
||||
cout << "Judging by its name (UnitTester_r5), this copy was" << endl;
|
||||
cout << "probably linked against Be Inc.'s R5 implementations" << endl;
|
||||
cout << "for the sake of comparison." << endl;
|
||||
} else if (AppName.rfind("UnitTester.OpenBeOS") != std::string::npos) {
|
||||
} else if (AppName.rfind("UnitTester") != std::string::npos) {
|
||||
cout << endl;
|
||||
cout << "Judging by its name (UnitTester.OpenBeOS), this copy was probably" << endl;
|
||||
cout << "linked against our OpenBeOS implementations." << endl;
|
||||
cout << "Judging by its name (UnitTester), this copy was probably" << endl;
|
||||
cout << "linked against our own OpenBeOS implementations." << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user