diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-07-31 11:05:16 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-07-31 11:05:18 +0100 |
commit | a77d80e757630e5cbc62f39690df99907ecaf1a6 (patch) | |
tree | 56588f3554cdf10671c489e5d6be24d9938c41b0 | |
parent | 0cf01dce414db3ce9595a438cf3c3f10dd938450 (diff) | |
download | armnn-a77d80e757630e5cbc62f39690df99907ecaf1a6.tar.gz |
IVGCVSW-3561 Use absolute path of unit tests
* Using the absolute path of the unit tests executable so that
the unit tests can be run from anywhere and the relative path
to the test shared objects would still work
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Change-Id: I57401daa162570e9ab1717d28a54a19f421afb0e
-rw-r--r-- | src/backends/backendsCommon/test/DynamicBackendTests.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backends/backendsCommon/test/DynamicBackendTests.hpp b/src/backends/backendsCommon/test/DynamicBackendTests.hpp index 1b3edc5e22..2bc4558500 100644 --- a/src/backends/backendsCommon/test/DynamicBackendTests.hpp +++ b/src/backends/backendsCommon/test/DynamicBackendTests.hpp @@ -15,6 +15,7 @@ #include <boost/test/unit_test.hpp> #include <boost/filesystem.hpp> +#include <boost/dll.hpp> static std::string g_TestSharedObjectSubDir = "src/backends/backendsCommon/test/"; static std::string g_TestSharedObjectFileName = "libarmnnTestSharedObject.so"; @@ -31,8 +32,8 @@ std::string GetTestFilePath(const std::string& fileName) { using namespace boost::filesystem; - path currentPath(current_path()); - path sharedObjectPath = currentPath.append(g_TestSharedObjectSubDir); + path programLocation = boost::dll::program_location().parent_path(); + path sharedObjectPath = programLocation.append(g_TestSharedObjectSubDir); path sharedObjectFile = sharedObjectPath.append(fileName); BOOST_TEST(exists(sharedObjectFile)); |