From a3323738a37ad3e8cae4a70931728e82fb5aeb6f Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Tue, 17 May 2016 20:38:11 -0700 Subject: [PATCH] Extract Unit to top-level Summary: [Folly] Extract `Unit` to top-level. It was in `folly/futures/`, but this diff moves it to `folly/`. It is needed for futures, but it is more general than futures and can be used separately. Users must replace `folly/futures/Unit.h` with `folly/Unit.h`. Also codemods existing usage sites: ``` hg grep -lw folly/futures/Unit.h | xargs perl -pi -e 's,\bfolly/futures/Unit\.h\b,folly/Unit.h,g' ``` Reviewed By: igorsugak Differential Revision: D3314280 fbshipit-source-id: 16279b76b1d24529bec49077ccb36cd7d39f23b8 --- folly/Makefile.am | 2 +- folly/{futures => }/Unit.h | 0 folly/futures/Timekeeper.h | 2 +- folly/futures/Try.h | 2 +- folly/futures/test/FutureTest.cpp | 2 +- folly/test/Makefile.am | 4 +++- folly/{futures => }/test/UnitTest.cpp | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) rename folly/{futures => }/Unit.h (100%) rename folly/{futures => }/test/UnitTest.cpp (98%) diff --git a/folly/Makefile.am b/folly/Makefile.am index 05058807..bc7e42d4 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -175,7 +175,6 @@ nobase_follyinclude_HEADERS = \ futures/Timekeeper.h \ futures/Try-inl.h \ futures/Try.h \ - futures/Unit.h \ futures/detail/Core.h \ futures/detail/FSM.h \ futures/detail/Types.h \ @@ -348,6 +347,7 @@ nobase_follyinclude_HEADERS = \ Traits.h \ Unicode.h \ Function.h \ + Unit.h \ Uri.h \ Uri-inl.h \ Varint.h \ diff --git a/folly/futures/Unit.h b/folly/Unit.h similarity index 100% rename from folly/futures/Unit.h rename to folly/Unit.h diff --git a/folly/futures/Timekeeper.h b/folly/futures/Timekeeper.h index f8dc51c2..bdf978a8 100644 --- a/folly/futures/Timekeeper.h +++ b/folly/futures/Timekeeper.h @@ -17,7 +17,7 @@ #pragma once #include -#include +#include namespace folly { diff --git a/folly/futures/Try.h b/folly/futures/Try.h index 5fae57f5..8d112a60 100644 --- a/folly/futures/Try.h +++ b/folly/futures/Try.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include namespace folly { diff --git a/folly/futures/test/FutureTest.cpp b/folly/futures/test/FutureTest.cpp index 2f1eaf12..8414370c 100644 --- a/folly/futures/test/FutureTest.cpp +++ b/folly/futures/test/FutureTest.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include diff --git a/folly/test/Makefile.am b/folly/test/Makefile.am index 229efaf5..9932fe61 100644 --- a/folly/test/Makefile.am +++ b/folly/test/Makefile.am @@ -215,6 +215,9 @@ indestructible_test_SOURCES = IndestructibleTest.cpp indestructible_test_LDADD = libfollytestmain.la TESTS += indestructible_test +unit_test_SOURCES = UnitTest.cpp +unit_test_LDADD = libfollytestmain.la +TESTS += unit_test futures_test_SOURCES = \ ../futures/test/CollectTest.cpp \ @@ -242,7 +245,6 @@ futures_test_SOURCES = \ ../futures/test/TimekeeperTest.cpp \ ../futures/test/TimesTest.cpp \ ../futures/test/TryTest.cpp \ - ../futures/test/UnitTest.cpp \ ../futures/test/UnwrapTest.cpp \ ../futures/test/ViaTest.cpp \ ../futures/test/WaitTest.cpp \ diff --git a/folly/futures/test/UnitTest.cpp b/folly/test/UnitTest.cpp similarity index 98% rename from folly/futures/test/UnitTest.cpp rename to folly/test/UnitTest.cpp index ba372fbb..18ff4ab5 100644 --- a/folly/futures/test/UnitTest.cpp +++ b/folly/test/UnitTest.cpp @@ -16,7 +16,7 @@ #include -#include +#include using namespace folly; -- 2.34.1