From d7686e939a140a1e4ec05d114fc4dd9a2660762a Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 13 Aug 2002 22:40:35 +0000 Subject: [PATCH] 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 --- src/tests/UnitTester.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/tests/UnitTester.cpp b/src/tests/UnitTester.cpp index 12c23952ba..83a7f5abfc 100644 --- a/src/tests/UnitTester.cpp +++ b/src/tests/UnitTester.cpp @@ -2,6 +2,8 @@ #include #include +#include + /* Since some of our obos libraries (such as libtranslation.so) have identically named R5 equivalents, it was necessary to have two separate unit testing programs, each with their own lib/ subdir, @@ -36,8 +38,17 @@ int main(int argc, char *argv[]) { } 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 = string(path.Path()) + "/" + cmd; if (beVerbose) cout << "Executing: '" << cmd << "'" << endl; system(cmd.c_str());