Skip to content

Commit 0686324

Browse files
Cleanup
1 parent 2f2f152 commit 0686324

File tree

5 files changed

+8
-75
lines changed

5 files changed

+8
-75
lines changed

unittests/CppInterOp/CMakeLists.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ set_output_directory(DynamicLibraryManagerTests BINARY_DIR ${CMAKE_BINARY_DIR}/u
4242
add_dependencies(DynamicLibraryManagerTests TestSharedLib)
4343
#export_executable_symbols_for_plugins(TestSharedLib)
4444
add_subdirectory(TestSharedLib)
45+
4546
add_dependencies(DynamicLibraryManagerTests TestSharedLib1)
4647
#export_executable_symbols_for_plugins(TestSharedLib1)
4748
add_subdirectory(TestSharedLib1)
49+
4850
add_dependencies(DynamicLibraryManagerTests TestSharedLib2)
4951
#export_executable_symbols_for_plugins(TestSharedLib2)
5052
add_subdirectory(TestSharedLib2)
51-
add_dependencies(DynamicLibraryManagerTests TestSharedLib3)
52-
#export_executable_symbols_for_plugins(TestSharedLib3)
53-
add_subdirectory(TestSharedLib3)

unittests/CppInterOp/DynamicLibraryManagerTest.cpp

+6-47
Original file line numberDiff line numberDiff line change
@@ -167,51 +167,10 @@ TEST(DynamicLibraryManagerTest, LibrariesAutoloadExtraCoverage) {
167167
rss << MU;
168168
EXPECT_STRNE("", rss.str().c_str()) << "MU problem!";
169169

170-
// Cover: LoadLibrary error
171-
// if (DLM->loadLibrary(lib, false) != DynamicLibraryManager::LoadLibResult::kLoadLibSuccess) {
172-
// LLVM_DEBUG(dbgs() << "MU: Failed to load library " << lib);
173-
// string err = "MU: Failed to load library! " + lib;
174-
// perror(err.c_str());
175-
// } else {
176-
// Find library with "ret_value" symbol defined and exported
177-
std::string PathToTestSharedLib3 =
178-
Cpp::SearchLibrariesForSymbol(MangleNameForDlsym("ret_val").c_str(), /*search_system=*/false);
179-
// If result is "" then we cannot find this library.
180-
EXPECT_STRNE("", PathToTestSharedLib3.c_str())
181-
<< "Cannot find: '" << PathToTestSharedLib3 << "' in '" << Dir.str() << "'";
182-
// Remove library for simulate load error
183-
llvm::sys::fs::remove(PathToTestSharedLib3, true);
184-
EXPECT_TRUE(Cpp::GetLibrariesAutoload());
185-
// FIXME: Conda returns false to run this code on osx.
186-
EXPECT_FALSE(Cpp::GetFunctionAddress(MangleNameForDlsym("ret_val").c_str()));
187-
188-
// Cover
189-
// } else {
190-
// // Collect all failing symbols, delegate their responsibility and then
191-
// // fail their materialization. R->defineNonExistent() sounds like it
192-
// // should do that, but it's not implemented?!
193-
// failedSymbols.insert(symbol);
194-
// TODO: implement test this case
195-
196-
// Cover
197-
// if (!failedSymbols.empty()) {
198-
// auto failingMR = R->delegate(failedSymbols);
199-
// if (failingMR) {
200-
// (*failingMR)->failMaterialization();
201-
// TODO: implement test this case
202-
203-
// Cover
204-
// void discard(const llvm::orc::JITDylib &JD, const llvm::orc::SymbolStringPtr &Name) override {}
205-
// TODO: implement test this case
206-
207-
// Cover
208-
// if (Path.empty()) {
209-
// LLVM_DEBUG(dbgs() << "DynamicLibraryManager::lookupLibMaybeAddExt(): "
210-
// TODO: implement test this case
211-
212-
// Cover
213-
// platform::DLClose(dyLibHandle, &errMsg);
214-
// if (!errMsg.empty()) {
215-
// LLVM_DEBUG(dbgs() << "DynamicLibraryManager::unloadLibrary(): "
216-
// TODO: implement test this case
170+
//TODO: Test and cover also if it is possible:
171+
// 1. Error when LoadLibrary
172+
// 2. if (!failedSymbols.empty()) { ...
173+
// 3. void discard(const llvm::orc::JITDylib &JD, const llvm::orc::SymbolStringPtr &Name) override {}
174+
// 4. if (Path.empty()) { ...
175+
// 5. platform::DLClose(dyLibHandle, &errMsg);
217176
}

unittests/CppInterOp/TestSharedLib3/CMakeLists.txt

-11
This file was deleted.

unittests/CppInterOp/TestSharedLib3/TestSharedLib3.cpp

-3
This file was deleted.

unittests/CppInterOp/TestSharedLib3/TestSharedLib3.h

-11
This file was deleted.

0 commit comments

Comments
 (0)