[llvm] [CASPlugin] Move CASPluginTest next to the CAS unit tests (PR #227546)
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 2 19:23:50 PDT 2026
================
@@ -33,22 +32,9 @@ using namespace llvm::unittest::cas;
// fixed.
#if !LLVM_HWADDRESS_SANITIZER_BUILD
-extern const char *TestMainArgv0;
-static std::string TestStringArg1("castest-string-arg1");
-
-/// \returns the path of the libCASPluginTest dynamic library, which implements
+/// \returns the path of the CASPluginTest dynamic library, which implements
/// the CAS plugin API for testing purposes.
-static std::string getCASPluginPath() {
- std::string Executable =
- sys::fs::getMainExecutable(TestMainArgv0, &TestStringArg1);
- llvm::SmallString<256> PathBuf(sys::path::parent_path(Executable));
-#if !defined(_WIN32) || defined(__MINGW32__)
- sys::path::append(PathBuf, "libCASPluginTest" LLVM_PLUGIN_EXT);
-#else
- sys::path::append(PathBuf, "CASPluginTest" LLVM_PLUGIN_EXT);
-#endif
- return std::string(PathBuf);
-}
+static std::string getCASPluginPath() { return CAS_PLUGIN_PATH; }
----------------
nico wrote:
(note to future self: llvm/unittests/Analysis/PluginInlineOrderAnalysisTest.cpp has a different take on this)
https://github.com/llvm/llvm-project/pull/227546
More information about the llvm-commits
mailing list