From e6651f3b54046ea1251dc56eecc0a7b2fecc2c38 Mon Sep 17 00:00:00 2001 From: Shreyas Atre Date: Fri, 16 Feb 2024 16:47:05 -0600 Subject: [PATCH] Use DynamicLibraryManager to find library Signed-off-by: Shreyas Atre --- .../CppInterOp/DynamicLibraryManagerTest.cpp | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/unittests/CppInterOp/DynamicLibraryManagerTest.cpp b/unittests/CppInterOp/DynamicLibraryManagerTest.cpp index 45021f00d..87a21548b 100644 --- a/unittests/CppInterOp/DynamicLibraryManagerTest.cpp +++ b/unittests/CppInterOp/DynamicLibraryManagerTest.cpp @@ -7,7 +7,7 @@ #include "../../lib/Interpreter/Paths.h" -#include +#include "../../lib/Interpreter/DynamicLibraryManager.h" // This function isn't referenced outside its translation unit, but it // can't use the "static" keyword because its address is used for @@ -61,27 +61,11 @@ TEST(DynamicLibraryManagerTest, Sanity) { TEST(UtilsPlatform, DLTest) { std::string err = ""; - std::string path = ""; - for (auto const& dir_entry : std::filesystem::recursive_directory_iterator( - std::filesystem::current_path())) { - if (std::string(dir_entry.path()).find("libTestSharedLib.") != - std::string::npos) { - path = dir_entry.path(); - break; - } - } + std::string path = + (new Cpp::DynamicLibraryManager)->lookupLibrary("libTestSharedLib"); EXPECT_FALSE(path.empty()); std::cout<