Commit 442584e7 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by facebook-github-bot-1

Fix Build: folly/test/ThreadLocalTest

Summary: [Folly] Fix Build: `folly/test/ThreadLocalTest`.

The problem is that the to the shared lib used in the test is hardcoded. It's a relative path, so that's nice, but it has too many assumptions about where the build system deposits test binaries.

Instead, let the code simply look for the shared lib in the same directory as the test binary. This makes fewer assumptions on the build system.

Reviewed By: andriigrynenko

Differential Revision: D2689047

fb-gh-sync-id: 648da079b7af5bc9893709d009e577347dd4a463
parent aba93096
......@@ -39,6 +39,7 @@
#include <folly/Benchmark.h>
#include <folly/Baton.h>
#include <folly/experimental/io/FsUtil.h>
using namespace folly;
......@@ -541,10 +542,10 @@ TEST(ThreadLocal, Fork2) {
}
}
TEST(ThreadLocal, SharedLibrary)
{
auto handle = dlopen("./_bin/folly/test/lib_thread_local_test.so",
RTLD_LAZY);
TEST(ThreadLocal, SharedLibrary) {
auto exe = fs::executable_path();
auto lib = exe.parent_path() / "lib_thread_local_test.so";
auto handle = dlopen(lib.string().c_str(), RTLD_LAZY);
EXPECT_NE(nullptr, handle);
typedef void (*useA_t)();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment