Skip to content

Commit

Permalink
Make the DynamicLibraryManagerTests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
fsfod committed Jan 19, 2024
1 parent b9ee737 commit 0ff4ee5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions unittests/CppInterOp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ target_link_libraries(DynamicLibraryManagerTests
clangCppInterOp
)

set_output_directory(DynamicLibraryManagerTests BINARY_DIR ${CMAKE_BINARY_DIR}/unittests/bin/$<CONFIG>/)

add_dependencies(DynamicLibraryManagerTests TestSharedLib)
#export_executable_symbols_for_plugins(TestSharedLib)
add_subdirectory(TestSharedLib)
3 changes: 2 additions & 1 deletion unittests/CppInterOp/DynamicLibraryManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ TEST(DynamicLibraryManagerTest, Sanity) {
<< "'";

EXPECT_TRUE(Cpp::LoadLibrary(PathToTestSharedLib.c_str()));

// Force ExecutionEngine to be created.
Cpp::Process("");
// FIXME: Conda returns false to run this code on osx.
#ifndef __APPLE__
EXPECT_TRUE(Cpp::GetFunctionAddress("ret_zero"));
Expand Down
4 changes: 2 additions & 2 deletions unittests/CppInterOp/TestSharedLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ add_llvm_library(TestSharedLib
TestSharedLib.cpp)
# Put TestSharedLib next to the unit test executable.
set_output_directory(TestSharedLib
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/../
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/../
BINARY_DIR ${CMAKE_BINARY_DIR}/unittests/bin/$<CONFIG>/
LIBRARY_DIR ${CMAKE_BINARY_DIR}/unittests/bin/$<CONFIG>/
)
set_target_properties(TestSharedLib PROPERTIES FOLDER "Tests")

0 comments on commit 0ff4ee5

Please sign in to comment.