|
1 | 1 | #include <chrono> |
2 | 2 | #include <filesystem> |
3 | | -#include <fstream> |
4 | 3 | #include <string> |
5 | 4 |
|
6 | 5 | #include <catch2/catch_test_macros.hpp> |
@@ -84,49 +83,6 @@ TEST_CASE("PluginFactory retries a shared directory that appears later", "[plugi |
84 | 83 | std::filesystem::remove_all(root); |
85 | 84 | } |
86 | 85 |
|
87 | | -TEST_CASE("PluginFactory retries failed shared library candidates", "[plugin]") { |
88 | | - const auto root = makeTempRoot("plugin-shared-bad-library"); |
89 | | - const auto categoryDir = root / "plugins" / "module" / "category"; |
90 | | - const auto sharedDir = root / "plugins" / "_shared"; |
91 | | -#if defined(_WIN32) |
92 | | - const auto badLibrary = sharedDir / "bad.dll"; |
93 | | -#elif defined(__APPLE__) |
94 | | - const auto badLibrary = sharedDir / "libbad.dylib"; |
95 | | -#else |
96 | | - const auto badLibrary = sharedDir / "libbad.so"; |
97 | | -#endif |
98 | | - std::filesystem::create_directories(sharedDir); |
99 | | - std::ofstream(badLibrary) << "not a shared library"; |
100 | | - const auto sourceLibrary = stdc::SharedLibrary::locateLibraryPath( |
101 | | - reinterpret_cast<const void *>(&stdc::SharedLibrary::isLibrary)); |
102 | | - REQUIRE(std::filesystem::is_regular_file(sourceLibrary)); |
103 | | - const auto goodLibrary = sharedDir / ("good" + sourceLibrary.extension().string()); |
104 | | - std::filesystem::copy_file(sourceLibrary, goodLibrary); |
105 | | - TestPluginFactory factory; |
106 | | - |
107 | | - factory.addPluginPath("test.plugin", categoryDir); |
108 | | - CHECK(factory.plugin("test.plugin", "missing") == nullptr); |
109 | | - CHECK_FALSE(factory.isSharedDirectoryLoaded(sharedDir)); |
110 | | - CHECK(factory.isDirty("test.plugin")); |
111 | | - CHECK(factory.preloadedLibraryCount() == 1); |
112 | | - |
113 | | - CHECK(factory.plugin("test.plugin", "missing") == nullptr); |
114 | | - CHECK_FALSE(factory.isSharedDirectoryLoaded(sharedDir)); |
115 | | - CHECK(factory.isDirty("test.plugin")); |
116 | | - CHECK(factory.preloadedLibraryCount() == 1); |
117 | | - |
118 | | - std::filesystem::remove(badLibrary); |
119 | | - CHECK(factory.plugin("test.plugin", "missing") == nullptr); |
120 | | - CHECK(factory.isSharedDirectoryLoaded(sharedDir)); |
121 | | - CHECK_FALSE(factory.isDirty("test.plugin")); |
122 | | - CHECK(factory.preloadedLibraryCount() == 1); |
123 | | - |
124 | | - factory.setPluginPaths("test.plugin", {}); |
125 | | - CHECK(factory.preloadedLibraryCount() == 1); |
126 | | - |
127 | | - std::filesystem::remove_all(root); |
128 | | -} |
129 | | - |
130 | 86 | TEST_CASE("Runtime rejects package scans after initialize", "[runtime][packages]") { |
131 | 87 | const auto root = makeTempRoot("immutable-package-sources"); |
132 | 88 | std::filesystem::create_directories(root / "demo-package"); |
|
0 commit comments