Commit 96be3888 authored by Andrew Gallagher's avatar Andrew Gallagher Committed by Anton Likhtarov

Add and fix BUCK files for folly

Summary:
This gets almost all of folly building with buck.  There are a few
cases we don't support yet (custom test wrappers for spooky test
binaries, dlopen-enabled exception tracer binary, etc), but the
vast majority is covered.

Test Plan: built all build targets and ran all tests buck

Reviewed By: sdwilsh@fb.com

Subscribers: tjackson, sdwilsh, fugalh, njormrod

FB internal diff: D1577256

Tasks: 5055879
parent d7364d7e
......@@ -147,9 +147,21 @@ TEST(File, Locks) {
CHECK_ERR(r);
buf[r] = '\0';
fs::path helper(buf);
helper.remove_filename();
helper /= "file_test_lock_helper";
// NOTE(agallagher): Our various internal build systems layout built
// binaries differently, so the two layouts below.
fs::path me(buf);
auto helper_basename = "file_test_lock_helper";
fs::path helper;
if (fs::exists(me.parent_path() / helper_basename)) {
helper = me.parent_path() / helper_basename;
} else if (fs::exists(
me.parent_path().parent_path() / helper_basename / helper_basename)) {
helper = me.parent_path().parent_path()
/ helper_basename / helper_basename;
} else {
throw std::runtime_error(
folly::to<std::string>("cannot find helper ", helper_basename));
}
TemporaryFile tempFile;
File f(tempFile.fd());
......
......@@ -22,8 +22,8 @@
#include <thread>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <common/logging/logging.h>
#include <time.h>
using namespace folly::detail;
......
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