MLCE-189 Adding more checks around dynamic backend directory paths.
authorColm Donelan <Colm.Donelan@arm.com>
Tue, 16 Jun 2020 16:14:51 +0000 (17:14 +0100)
committerColm Donelan <Colm.Donelan@arm.com>
Tue, 16 Jun 2020 16:15:11 +0000 (17:15 +0100)
* It appears that the customer ends up with an invalid value of
  sharedObjectPath in GetBasePath. Inserting an explicit check for
  it.
* Also checking the final derived path for the value dynamic backend
  shared object.

Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
Change-Id: I8bee4ea8ac2a6b8ad846b9c958731718669455d4

src/backends/backendsCommon/test/DynamicBackendTests.hpp

index 0c24ec6..a2a6df0 100644 (file)
@@ -108,8 +108,8 @@ std::string GetBasePath(const std::string& basePath)
 
     path programLocation = boost::dll::program_location().parent_path();
     path sharedObjectPath = programLocation.append(basePath);
-    BOOST_CHECK(exists(sharedObjectPath));
-
+    BOOST_CHECK_MESSAGE(exists(sharedObjectPath), "Base path for shared objects does not exist: " +
+                                                   sharedObjectPath.string());
     return sharedObjectPath.string();
 }
 
@@ -344,6 +344,11 @@ void CreateValidDynamicBackendObjectTestImpl()
     using namespace armnn;
 
     std::string testSubDirectory = GetTestSubDirectory(g_TestDynamicBackendSubDir);
+
+    // We expect this path to exists so we can load a valid dynamic backend.
+    BOOST_CHECK_MESSAGE(boost::filesystem::exists(testSubDirectory),
+                       "Base path for shared objects does not exist: " + testSubDirectory);
+
     std::string sharedObjectFilePath = GetTestFilePath(testSubDirectory, g_TestValidTestDynamicBackendFileName);
 
     void* sharedObjectHandle = nullptr;