The UnitTester does now find the platform specific unit testers also when invoked from another directory.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@755 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2002-08-13 22:40:35 +00:00
parent 4a87ab984b
commit d7686e939a
+11
View File
@@ -2,6 +2,8 @@
#include <iostream> #include <iostream>
#include <unistd.h> #include <unistd.h>
#include <Path.h>
/* Since some of our obos libraries (such as libtranslation.so) have /* Since some of our obos libraries (such as libtranslation.so) have
identically named R5 equivalents, it was necessary to have two identically named R5 equivalents, it was necessary to have two
separate unit testing programs, each with their own lib/ subdir, separate unit testing programs, each with their own lib/ subdir,
@@ -37,7 +39,16 @@ int main(int argc, char *argv[]) {
cmd += " " + arg; cmd += " " + arg;
} }
} }
// get test dir path
BPath path(argv[0]);
if (path.InitCheck() == B_OK) {
if (path.GetParent(&path) != B_OK)
cout << "Couldn't get test dir." << endl;
} else
cout << "Couldn't find the path to the test app." << endl;
// construct the command path
cmd = (doR5Tests ? "unittester_r5/UnitTesterHelper_r5" : "unittester/UnitTesterHelper") + cmd; cmd = (doR5Tests ? "unittester_r5/UnitTesterHelper_r5" : "unittester/UnitTesterHelper") + cmd;
cmd = string(path.Path()) + "/" + cmd;
if (beVerbose) if (beVerbose)
cout << "Executing: '" << cmd << "'" << endl; cout << "Executing: '" << cmd << "'" << endl;
system(cmd.c_str()); system(cmd.c_str());