CMakeLists.txt 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  1. cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
  2. # We use the GoogleTest module if it is available (only in CMake 3.9+)
  3. # It requires CMP0054 and CMP0057 to be enabled.
  4. if (POLICY CMP0054)
  5. cmake_policy(SET CMP0054 NEW)
  6. endif()
  7. if (POLICY CMP0057)
  8. cmake_policy(SET CMP0057 NEW)
  9. endif()
  10. # includes
  11. set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
  12. # package information
  13. set(PACKAGE_NAME "folly")
  14. set(PACKAGE_VERSION "0.58.0-dev")
  15. set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
  16. set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
  17. set(PACKAGE_BUGREPORT "https://github.com/facebook/folly/issues")
  18. # 150+ tests in the root folder anyone? No? I didn't think so.
  19. set_property(GLOBAL PROPERTY USE_FOLDERS ON)
  20. project(${PACKAGE_NAME} CXX C)
  21. set(INCLUDE_INSTALL_DIR include CACHE STRING
  22. "The subdirectory where header files should be installed")
  23. set(LIB_INSTALL_DIR lib CACHE STRING
  24. "The subdirectory where libraries should be installed")
  25. set(BIN_INSTALL_DIR bin CACHE STRING
  26. "The subdirectory where binaries should be installed")
  27. set(CMAKE_INSTALL_DIR lib/cmake/folly CACHE STRING
  28. "The subdirectory where CMake package config files should be installed")
  29. option(BUILD_SHARED_LIBS
  30. "If enabled, build folly as a shared library. \
  31. This is generally discouraged, since folly does not commit to having \
  32. a stable ABI."
  33. OFF
  34. )
  35. # Mark BUILD_SHARED_LIBS as an "advanced" option, since enabling it
  36. # is generally discouraged.
  37. mark_as_advanced(BUILD_SHARED_LIBS)
  38. set(FOLLY_SUPPORT_SHARED_LIBRARY "${BUILD_SHARED_LIBS}")
  39. if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
  40. # Check target architecture
  41. if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
  42. message(FATAL_ERROR "Folly requires a 64bit target architecture.")
  43. endif()
  44. if (MSVC_VERSION LESS 1900)
  45. message(
  46. FATAL_ERROR
  47. "This build script only supports building Folly on 64-bit Windows with "
  48. "at least Visual Studio 2017. "
  49. "MSVC version '${MSVC_VERSION}' is not supported."
  50. )
  51. endif()
  52. endif()
  53. set(TOP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
  54. set(FOLLY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/folly")
  55. set(
  56. FOLLY_DIR_PREFIXES
  57. "${CMAKE_CURRENT_SOURCE_DIR}:${CMAKE_CURRENT_BINARY_DIR}"
  58. )
  59. include(GNUInstallDirs)
  60. set(CMAKE_THREAD_PREFER_PTHREAD ON)
  61. set(THREADS_PREFER_PTHREAD_FLAG ON)
  62. find_package(Threads REQUIRED)
  63. set(FOLLY_HAVE_PTHREAD "${CMAKE_USE_PTHREADS_INIT}")
  64. list(APPEND CMAKE_REQUIRED_LIBRARIES Threads::Threads)
  65. list(APPEND FOLLY_LINK_LIBRARIES Threads::Threads)
  66. if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
  67. include(FollyCompilerMSVC)
  68. else()
  69. include(FollyCompilerUnix)
  70. endif()
  71. include(FollyFunctions)
  72. include(folly-deps) # Find the required packages
  73. include(FollyConfigChecks)
  74. configure_file(
  75. ${CMAKE_CURRENT_SOURCE_DIR}/CMake/folly-config.h.cmake
  76. ${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h
  77. )
  78. # We currently build the main libfolly library by finding all sources
  79. # and header files. We then exclude specific files below.
  80. #
  81. # In the future it would perhaps be nicer to explicitly list the files we want
  82. # to include, and to move the source lists in to separate per-subdirectory
  83. # CMakeLists.txt files.
  84. auto_sources(files "*.cpp" "RECURSE" "${FOLLY_DIR}")
  85. auto_sources(hfiles "*.h" "RECURSE" "${FOLLY_DIR}")
  86. # Exclude tests, benchmarks, and other standalone utility executables from the
  87. # library sources. Test sources are listed separately below.
  88. REMOVE_MATCHES_FROM_LISTS(files hfiles
  89. MATCHES
  90. "^${FOLLY_DIR}/build/"
  91. "^${FOLLY_DIR}/experimental/exception_tracer/"
  92. "^${FOLLY_DIR}/experimental/hazptr/bench/"
  93. "^${FOLLY_DIR}/experimental/hazptr/example/"
  94. "^${FOLLY_DIR}/experimental/pushmi/"
  95. "^${FOLLY_DIR}/futures/exercises/"
  96. "^${FOLLY_DIR}/logging/example/"
  97. "^${FOLLY_DIR}/(.*/)?test/"
  98. "^${FOLLY_DIR}/tools/"
  99. "Benchmark.cpp$"
  100. "Test.cpp$"
  101. )
  102. list(REMOVE_ITEM files
  103. ${FOLLY_DIR}/experimental/JSONSchemaTester.cpp
  104. ${FOLLY_DIR}/experimental/io/HugePageUtil.cpp
  105. ${FOLLY_DIR}/python/fibers.cpp
  106. ${FOLLY_DIR}/python/GILAwareManualExecutor.cpp
  107. )
  108. list(REMOVE_ITEM hfiles
  109. ${FOLLY_DIR}/python/fibers.h
  110. ${FOLLY_DIR}/python/GILAwareManualExecutor.h
  111. )
  112. # Explicitly include utility library code from inside
  113. # folly/test and folly/io/async/test/
  114. list(APPEND files
  115. ${FOLLY_DIR}/io/async/test/ScopedBoundPort.cpp
  116. ${FOLLY_DIR}/io/async/test/SocketPair.cpp
  117. ${FOLLY_DIR}/io/async/test/TimeUtil.cpp
  118. )
  119. list(APPEND hfiles
  120. ${FOLLY_DIR}/io/async/test/AsyncSSLSocketTest.h
  121. ${FOLLY_DIR}/io/async/test/AsyncSocketTest.h
  122. ${FOLLY_DIR}/io/async/test/AsyncSocketTest2.h
  123. ${FOLLY_DIR}/io/async/test/BlockingSocket.h
  124. ${FOLLY_DIR}/io/async/test/MockAsyncSocket.h
  125. ${FOLLY_DIR}/io/async/test/MockAsyncServerSocket.h
  126. ${FOLLY_DIR}/io/async/test/MockAsyncSSLSocket.h
  127. ${FOLLY_DIR}/io/async/test/MockAsyncTransport.h
  128. ${FOLLY_DIR}/io/async/test/MockAsyncUDPSocket.h
  129. ${FOLLY_DIR}/io/async/test/MockTimeoutManager.h
  130. ${FOLLY_DIR}/io/async/test/ScopedBoundPort.h
  131. ${FOLLY_DIR}/io/async/test/SocketPair.h
  132. ${FOLLY_DIR}/io/async/test/TestSSLServer.h
  133. ${FOLLY_DIR}/io/async/test/TimeUtil.h
  134. ${FOLLY_DIR}/io/async/test/UndelayedDestruction.h
  135. ${FOLLY_DIR}/io/async/test/Util.h
  136. ${FOLLY_DIR}/test/TestUtils.h
  137. )
  138. # Exclude specific sources if we do not have third-party libraries
  139. # required to build them.
  140. if (NOT FOLLY_USE_SYMBOLIZER)
  141. REMOVE_MATCHES_FROM_LISTS(files hfiles
  142. MATCHES
  143. "^${FOLLY_DIR}/experimental/symbolizer/"
  144. )
  145. list(REMOVE_ITEM files
  146. ${FOLLY_DIR}/SingletonStackTrace.cpp
  147. )
  148. endif()
  149. if (NOT ${LIBAIO_FOUND})
  150. list(REMOVE_ITEM files
  151. ${FOLLY_DIR}/experimental/io/AsyncIO.cpp
  152. )
  153. list(REMOVE_ITEM hfiles
  154. ${FOLLY_DIR}/experimental/io/AsyncIO.h
  155. )
  156. endif()
  157. if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
  158. list(REMOVE_ITEM files
  159. ${FOLLY_DIR}/Poly.cpp
  160. ${FOLLY_DIR}/Subprocess.cpp
  161. )
  162. list(REMOVE_ITEM hfiles
  163. ${FOLLY_DIR}/Poly.h
  164. ${FOLLY_DIR}/Poly-inl.h
  165. ${FOLLY_DIR}/detail/PolyDetail.h
  166. ${FOLLY_DIR}/detail/TypeList.h
  167. ${FOLLY_DIR}/poly/Nullable.h
  168. ${FOLLY_DIR}/poly/Regular.h
  169. )
  170. endif()
  171. add_library(folly_base OBJECT
  172. ${files} ${hfiles}
  173. ${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h
  174. )
  175. auto_source_group(folly ${FOLLY_DIR} ${files} ${hfiles})
  176. apply_folly_compile_options_to_target(folly_base)
  177. # Add the generated files to the correct source group.
  178. source_group("folly" FILES ${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h)
  179. # Generate pkg-config variables from folly_deps before we add our own
  180. # build/install-time include directory generator expressions
  181. include(GenPkgConfig)
  182. gen_pkgconfig_vars(FOLLY_PKGCONFIG folly_deps)
  183. target_include_directories(folly_deps
  184. INTERFACE
  185. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
  186. $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
  187. $<INSTALL_INTERFACE:include>
  188. )
  189. target_include_directories(folly_base
  190. PUBLIC
  191. $<TARGET_PROPERTY:folly_deps,INTERFACE_INCLUDE_DIRECTORIES>
  192. )
  193. target_compile_definitions(folly_base
  194. PUBLIC
  195. $<TARGET_PROPERTY:folly_deps,INTERFACE_COMPILE_DEFINITIONS>
  196. )
  197. add_library(folly
  198. $<TARGET_OBJECTS:folly_base>
  199. )
  200. apply_folly_compile_options_to_target(folly)
  201. target_link_libraries(folly PUBLIC folly_deps)
  202. install(TARGETS folly folly_deps
  203. EXPORT folly
  204. RUNTIME DESTINATION bin
  205. LIBRARY DESTINATION ${LIB_INSTALL_DIR}
  206. ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
  207. auto_install_files(folly ${FOLLY_DIR}
  208. ${hfiles}
  209. )
  210. install(
  211. FILES ${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h
  212. DESTINATION ${INCLUDE_INSTALL_DIR}/folly
  213. COMPONENT dev
  214. )
  215. # Generate the folly-config.cmake file for installation so that
  216. # downstream projects that use on folly can easily depend on it in their CMake
  217. # files using "find_package(folly CONFIG)"
  218. include(CMakePackageConfigHelpers)
  219. configure_package_config_file(
  220. CMake/folly-config.cmake.in
  221. folly-config.cmake
  222. INSTALL_DESTINATION ${CMAKE_INSTALL_DIR}
  223. PATH_VARS
  224. INCLUDE_INSTALL_DIR
  225. CMAKE_INSTALL_DIR
  226. )
  227. install(
  228. FILES ${CMAKE_CURRENT_BINARY_DIR}/folly-config.cmake
  229. DESTINATION ${CMAKE_INSTALL_DIR}
  230. COMPONENT dev
  231. )
  232. install(
  233. EXPORT folly
  234. DESTINATION ${CMAKE_INSTALL_DIR}
  235. NAMESPACE Folly::
  236. FILE folly-targets.cmake
  237. COMPONENT dev
  238. )
  239. # Generate a pkg-config file so that downstream projects that don't use
  240. # CMake can depend on folly using pkg-config.
  241. configure_file(
  242. ${CMAKE_CURRENT_SOURCE_DIR}/CMake/libfolly.pc.in
  243. ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc
  244. @ONLY
  245. )
  246. install(
  247. FILES ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc
  248. DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
  249. COMPONENT dev
  250. )
  251. option(BUILD_TESTS "If enabled, compile the tests." OFF)
  252. option(BUILD_BROKEN_TESTS "If enabled, compile tests that are known to be broken." OFF)
  253. option(BUILD_HANGING_TESTS "If enabled, compile tests that are known to hang." OFF)
  254. option(BUILD_SLOW_TESTS "If enabled, compile tests that take a while to run in debug mode." OFF)
  255. if (BUILD_TESTS)
  256. option(USE_CMAKE_GOOGLE_TEST_INTEGRATION "If enabled, use the google test integration included in CMake." ON)
  257. find_package(GMock MODULE REQUIRED)
  258. if (USE_CMAKE_GOOGLE_TEST_INTEGRATION)
  259. include(GoogleTest OPTIONAL RESULT_VARIABLE HAVE_CMAKE_GTEST)
  260. enable_testing()
  261. else()
  262. set(HAVE_CMAKE_GTEST OFF)
  263. endif()
  264. # The ThreadLocalTest code uses a helper shared library for one of its tests.
  265. # This can only be built if folly itself was built as a shared library.
  266. if (BUILD_SHARED_LIBS)
  267. add_library(thread_local_test_lib MODULE
  268. ${FOLLY_DIR}/test/ThreadLocalTestLib.cpp
  269. )
  270. set_target_properties(thread_local_test_lib PROPERTIES PREFIX "")
  271. apply_folly_compile_options_to_target(thread_local_test_lib)
  272. target_link_libraries(thread_local_test_lib PUBLIC folly)
  273. target_include_directories(
  274. thread_local_test_lib
  275. PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
  276. endif()
  277. add_library(folly_test_support
  278. ${FOLLY_DIR}/test/common/TestMain.cpp
  279. ${FOLLY_DIR}/test/DeterministicSchedule.cpp
  280. ${FOLLY_DIR}/test/DeterministicSchedule.h
  281. ${FOLLY_DIR}/test/SingletonTestStructs.cpp
  282. ${FOLLY_DIR}/test/SocketAddressTestHelper.cpp
  283. ${FOLLY_DIR}/test/SocketAddressTestHelper.h
  284. ${FOLLY_DIR}/experimental/test/CodingTestUtils.cpp
  285. ${FOLLY_DIR}/logging/test/ConfigHelpers.cpp
  286. ${FOLLY_DIR}/logging/test/ConfigHelpers.h
  287. ${FOLLY_DIR}/logging/test/TestLogHandler.cpp
  288. ${FOLLY_DIR}/logging/test/TestLogHandler.h
  289. ${FOLLY_DIR}/futures/test/TestExecutor.cpp
  290. ${FOLLY_DIR}/futures/test/TestExecutor.h
  291. ${FOLLY_DIR}/io/async/test/BlockingSocket.h
  292. ${FOLLY_DIR}/io/async/test/MockAsyncServerSocket.h
  293. ${FOLLY_DIR}/io/async/test/MockAsyncSocket.h
  294. ${FOLLY_DIR}/io/async/test/MockAsyncSSLSocket.h
  295. ${FOLLY_DIR}/io/async/test/MockAsyncTransport.h
  296. ${FOLLY_DIR}/io/async/test/MockAsyncUDPSocket.h
  297. ${FOLLY_DIR}/io/async/test/MockTimeoutManager.h
  298. ${FOLLY_DIR}/io/async/test/ScopedBoundPort.cpp
  299. ${FOLLY_DIR}/io/async/test/ScopedBoundPort.h
  300. ${FOLLY_DIR}/io/async/test/SocketPair.cpp
  301. ${FOLLY_DIR}/io/async/test/SocketPair.h
  302. ${FOLLY_DIR}/io/async/test/TestSSLServer.cpp
  303. ${FOLLY_DIR}/io/async/test/TestSSLServer.h
  304. ${FOLLY_DIR}/io/async/test/TimeUtil.cpp
  305. ${FOLLY_DIR}/io/async/test/TimeUtil.h
  306. ${FOLLY_DIR}/io/async/test/UndelayedDestruction.h
  307. ${FOLLY_DIR}/io/async/test/Util.h
  308. )
  309. target_compile_definitions(folly_test_support
  310. PUBLIC
  311. ${LIBGMOCK_DEFINES}
  312. )
  313. target_include_directories(folly_test_support
  314. SYSTEM
  315. PUBLIC
  316. ${LIBGMOCK_INCLUDE_DIR}
  317. )
  318. target_link_libraries(folly_test_support
  319. PUBLIC
  320. ${BOOST_LIBRARIES}
  321. follybenchmark
  322. folly
  323. ${LIBGMOCK_LIBRARIES}
  324. )
  325. apply_folly_compile_options_to_target(folly_test_support)
  326. folly_define_tests(
  327. DIRECTORY chrono/test/
  328. TEST chrono_conv_test WINDOWS_DISABLED
  329. SOURCES ConvTest.cpp
  330. DIRECTORY compression/test/
  331. TEST compression_test SLOW SOURCES CompressionTest.cpp
  332. DIRECTORY container/test/
  333. TEST access_test SOURCES AccessTest.cpp
  334. TEST array_test SOURCES ArrayTest.cpp
  335. TEST bit_iterator_test SOURCES BitIteratorTest.cpp
  336. # TODO: CMake's gtest_add_tests() function currently chokes on
  337. # EnumerateTest.cpp since it uses macros to define tests.
  338. #TEST enumerate_test SOURCES EnumerateTest.cpp
  339. TEST evicting_cache_map_test SOURCES EvictingCacheMapTest.cpp
  340. TEST f14_fwd_test SOURCES F14FwdTest.cpp
  341. TEST f14_map_test SOURCES F14MapTest.cpp
  342. TEST f14_set_test SOURCES F14SetTest.cpp
  343. TEST foreach_test SOURCES ForeachTest.cpp
  344. TEST merge_test SOURCES MergeTest.cpp
  345. TEST sparse_byte_set_test SOURCES SparseByteSetTest.cpp
  346. DIRECTORY concurrency/test/
  347. TEST atomic_shared_ptr_test SOURCES AtomicSharedPtrTest.cpp
  348. TEST cache_locality_test SOURCES CacheLocalityTest.cpp
  349. TEST core_cached_shared_ptr_test SOURCES CoreCachedSharedPtrTest.cpp
  350. TEST concurrent_hash_map_test SOURCES ConcurrentHashMapTest.cpp
  351. TEST dynamic_bounded_queue_test WINDOWS_DISABLED
  352. SOURCES DynamicBoundedQueueTest.cpp
  353. TEST unbounded_queue_test SOURCES UnboundedQueueTest.cpp
  354. DIRECTORY detail/test/
  355. TEST static_singleton_manager_test SOURCES StaticSingletonManagerTest.cpp
  356. DIRECTORY executors/test/
  357. TEST async_helpers_test SOURCES AsyncTest.cpp
  358. TEST codel_test SOURCES CodelTest.cpp
  359. TEST executor_test SOURCES ExecutorTest.cpp
  360. TEST fiber_io_executor_test SOURCES FiberIOExecutorTest.cpp
  361. TEST global_executor_test SOURCES GlobalExecutorTest.cpp
  362. TEST serial_executor_test SOURCES SerialExecutorTest.cpp
  363. TEST thread_pool_executor_test WINDOWS_DISABLED
  364. SOURCES ThreadPoolExecutorTest.cpp
  365. TEST threaded_executor_test SOURCES ThreadedExecutorTest.cpp
  366. TEST timed_drivable_executor_test SOURCES TimedDrivableExecutorTest.cpp
  367. DIRECTORY executors/task_queue/test/
  368. TEST unbounded_blocking_queue_test SOURCES UnboundedBlockingQueueTest.cpp
  369. DIRECTORY experimental/test/
  370. TEST autotimer_test SOURCES AutoTimerTest.cpp
  371. TEST bits_test_2 SOURCES BitsTest.cpp
  372. TEST bitvector_test SOURCES BitVectorCodingTest.cpp
  373. TEST dynamic_parser_test SOURCES DynamicParserTest.cpp
  374. TEST eliasfano_test SOURCES EliasFanoCodingTest.cpp
  375. TEST event_count_test SOURCES EventCountTest.cpp
  376. # FunctionSchedulerTest has a lot of timing-dependent checks,
  377. # and tends to fail on heavily loaded systems.
  378. TEST function_scheduler_test BROKEN SOURCES FunctionSchedulerTest.cpp
  379. TEST future_dag_test SOURCES FutureDAGTest.cpp
  380. TEST json_schema_test SOURCES JSONSchemaTest.cpp
  381. TEST lock_free_ring_buffer_test SOURCES LockFreeRingBufferTest.cpp
  382. #TEST nested_command_line_app_test SOURCES NestedCommandLineAppTest.cpp
  383. #TEST program_options_test SOURCES ProgramOptionsTest.cpp
  384. # Depends on liburcu
  385. #TEST read_mostly_shared_ptr_test SOURCES ReadMostlySharedPtrTest.cpp
  386. #TEST ref_count_test SOURCES RefCountTest.cpp
  387. TEST select64_test SOURCES Select64Test.cpp
  388. TEST stringkeyed_test SOURCES StringKeyedTest.cpp
  389. TEST test_util_test SOURCES TestUtilTest.cpp
  390. TEST tuple_ops_test SOURCES TupleOpsTest.cpp
  391. DIRECTORY experimental/io/test/
  392. # Depends on libaio
  393. #TEST async_io_test SOURCES AsyncIOTest.cpp
  394. TEST fs_util_test SOURCES FsUtilTest.cpp
  395. DIRECTORY logging/test/
  396. TEST async_file_writer_test SOURCES AsyncFileWriterTest.cpp
  397. TEST config_parser_test SOURCES ConfigParserTest.cpp
  398. TEST config_update_test SOURCES ConfigUpdateTest.cpp
  399. TEST file_handler_factory_test SOURCES FileHandlerFactoryTest.cpp
  400. TEST glog_formatter_test SOURCES GlogFormatterTest.cpp
  401. TEST immediate_file_writer_test SOURCES ImmediateFileWriterTest.cpp
  402. TEST log_category_test SOURCES LogCategoryTest.cpp
  403. TEST logger_db_test SOURCES LoggerDBTest.cpp
  404. TEST logger_test SOURCES LoggerTest.cpp
  405. TEST log_level_test SOURCES LogLevelTest.cpp
  406. TEST log_message_test SOURCES LogMessageTest.cpp
  407. TEST log_name_test SOURCES LogNameTest.cpp
  408. TEST log_stream_test SOURCES LogStreamTest.cpp
  409. TEST printf_test SOURCES PrintfTest.cpp
  410. TEST rate_limiter_test SOURCES RateLimiterTest.cpp
  411. TEST standard_log_handler_test SOURCES StandardLogHandlerTest.cpp
  412. TEST xlog_test
  413. HEADERS
  414. XlogHeader1.h
  415. XlogHeader2.h
  416. SOURCES
  417. XlogFile1.cpp
  418. XlogFile2.cpp
  419. XlogTest.cpp
  420. DIRECTORY fibers/test/
  421. TEST fibers_test SOURCES FibersTest.cpp
  422. DIRECTORY functional/test/
  423. TEST apply_tuple_test WINDOWS_DISABLED
  424. SOURCES ApplyTupleTest.cpp
  425. TEST partial_test SOURCES PartialTest.cpp
  426. DIRECTORY futures/test/
  427. TEST barrier_test SOURCES BarrierTest.cpp
  428. TEST callback_lifetime_test SOURCES CallbackLifetimeTest.cpp
  429. TEST collect_test SOURCES CollectTest.cpp
  430. TEST context_test SOURCES ContextTest.cpp
  431. TEST core_test SOURCES CoreTest.cpp
  432. TEST ensure_test SOURCES EnsureTest.cpp
  433. TEST filter_test SOURCES FilterTest.cpp
  434. TEST future_splitter_test SOURCES FutureSplitterTest.cpp
  435. TEST future_test WINDOWS_DISABLED
  436. SOURCES FutureTest.cpp
  437. TEST header_compile_test SOURCES HeaderCompileTest.cpp
  438. TEST interrupt_test SOURCES InterruptTest.cpp
  439. TEST map_test SOURCES MapTest.cpp
  440. TEST non_copyable_lambda_test SOURCES NonCopyableLambdaTest.cpp
  441. TEST poll_test SOURCES PollTest.cpp
  442. TEST promise_test SOURCES PromiseTest.cpp
  443. TEST reduce_test SOURCES ReduceTest.cpp
  444. TEST retrying_test SOURCES RetryingTest.cpp
  445. TEST self_destruct_test SOURCES SelfDestructTest.cpp
  446. TEST shared_promise_test SOURCES SharedPromiseTest.cpp
  447. TEST test_executor_test SOURCES TestExecutorTest.cpp
  448. TEST then_compile_test
  449. HEADERS
  450. ThenCompileTest.h
  451. SOURCES
  452. ThenCompileTest.cpp
  453. TEST then_test SOURCES ThenTest.cpp
  454. TEST timekeeper_test SOURCES TimekeeperTest.cpp
  455. TEST times_test SOURCES TimesTest.cpp
  456. TEST unwrap_test SOURCES UnwrapTest.cpp
  457. TEST via_test SOURCES ViaTest.cpp
  458. TEST wait_test SOURCES WaitTest.cpp
  459. TEST when_test SOURCES WhenTest.cpp
  460. TEST while_do_test SOURCES WhileDoTest.cpp
  461. TEST will_equal_test SOURCES WillEqualTest.cpp
  462. TEST window_test WINDOWS_DISABLED
  463. SOURCES WindowTest.cpp
  464. DIRECTORY gen/test/
  465. # MSVC bug can't resolve initializer_list constructor properly
  466. #TEST base_test SOURCES BaseTest.cpp
  467. TEST combine_test SOURCES CombineTest.cpp
  468. TEST parallel_map_test SOURCES ParallelMapTest.cpp
  469. TEST parallel_test SOURCES ParallelTest.cpp
  470. DIRECTORY hash/test/
  471. TEST checksum_test SOURCES ChecksumTest.cpp
  472. TEST hash_test WINDOWS_DISABLED
  473. SOURCES HashTest.cpp
  474. TEST spooky_hash_v1_test SOURCES SpookyHashV1Test.cpp
  475. TEST spooky_hash_v2_test SOURCES SpookyHashV2Test.cpp
  476. DIRECTORY io/test/
  477. TEST iobuf_test SOURCES IOBufTest.cpp
  478. TEST iobuf_cursor_test SOURCES IOBufCursorTest.cpp
  479. TEST iobuf_queue_test SOURCES IOBufQueueTest.cpp
  480. TEST record_io_test SOURCES RecordIOTest.cpp
  481. TEST ShutdownSocketSetTest HANGING
  482. SOURCES ShutdownSocketSetTest.cpp
  483. DIRECTORY io/async/test/
  484. # A number of tests in the async_test binary are unfortunately flaky.
  485. # When run under Travis CI a number of the tests also hang (it looks
  486. # like they do not get expected socket accept events, causing them
  487. # to never break out of their event loops).
  488. TEST async_test BROKEN
  489. CONTENT_DIR certs/
  490. HEADERS
  491. AsyncSocketTest.h
  492. AsyncSSLSocketTest.h
  493. SOURCES
  494. AsyncPipeTest.cpp
  495. AsyncSocketExceptionTest.cpp
  496. AsyncSocketTest.cpp
  497. AsyncSocketTest2.cpp
  498. AsyncSSLSocketTest.cpp
  499. AsyncSSLSocketTest2.cpp
  500. AsyncSSLSocketWriteTest.cpp
  501. AsyncTransportTest.cpp
  502. # This is disabled because it depends on things that don't exist
  503. # on Windows.
  504. #EventHandlerTest.cpp
  505. # The async signal handler is not supported on Windows.
  506. #AsyncSignalHandlerTest.cpp
  507. TEST async_timeout_test SOURCES AsyncTimeoutTest.cpp
  508. TEST AsyncUDPSocketTest SOURCES AsyncUDPSocketTest.cpp
  509. TEST DelayedDestructionTest SOURCES DelayedDestructionTest.cpp
  510. TEST DelayedDestructionBaseTest SOURCES DelayedDestructionBaseTest.cpp
  511. TEST DestructorCheckTest SOURCES DestructorCheckTest.cpp
  512. TEST EventBaseTest SOURCES EventBaseTest.cpp
  513. TEST EventBaseLocalTest SOURCES EventBaseLocalTest.cpp
  514. TEST HHWheelTimerTest SOURCES HHWheelTimerTest.cpp
  515. TEST HHWheelTimerSlowTests SLOW
  516. SOURCES HHWheelTimerSlowTests.cpp
  517. TEST NotificationQueueTest SOURCES NotificationQueueTest.cpp
  518. TEST RequestContextTest SOURCES RequestContextTest.cpp
  519. TEST ScopedEventBaseThreadTest SOURCES ScopedEventBaseThreadTest.cpp
  520. TEST ssl_session_test
  521. CONTENT_DIR certs/
  522. SOURCES
  523. SSLSessionTest.cpp
  524. TEST writechain_test SOURCES WriteChainAsyncTransportWrapperTest.cpp
  525. DIRECTORY io/async/ssl/test/
  526. TEST ssl_errors_test SOURCES SSLErrorsTest.cpp
  527. DIRECTORY lang/test/
  528. TEST bits_test SOURCES BitsTest.cpp
  529. TEST cold_class_test SOURCES ColdClassTest.cpp
  530. TEST safe_assert_test SOURCES SafeAssertTest.cpp
  531. DIRECTORY memory/test/
  532. TEST arena_test SOURCES ArenaTest.cpp
  533. TEST thread_cached_arena_test WINDOWS_DISABLED
  534. SOURCES ThreadCachedArenaTest.cpp
  535. TEST mallctl_helper_test SOURCES MallctlHelperTest.cpp
  536. DIRECTORY portability/test/
  537. TEST constexpr_test SOURCES ConstexprTest.cpp
  538. TEST libgen-test SOURCES LibgenTest.cpp
  539. TEST openssl_portability_test SOURCES OpenSSLPortabilityTest.cpp
  540. TEST pthread_test SOURCES PThreadTest.cpp
  541. TEST time-test SOURCES TimeTest.cpp
  542. DIRECTORY ssl/test/
  543. TEST openssl_hash_test SOURCES OpenSSLHashTest.cpp
  544. DIRECTORY stats/test/
  545. TEST buffered_stat_test SOURCES BufferedStatTest.cpp
  546. TEST digest_builder_test SOURCES DigestBuilderTest.cpp
  547. TEST histogram_test SOURCES HistogramTest.cpp
  548. TEST quantile_estimator_test SOURCES QuantileEstimatorTest.cpp
  549. TEST sliding_window_test SOURCES SlidingWindowTest.cpp
  550. TEST tdigest_test SOURCES TDigestTest.cpp
  551. TEST timeseries_histogram_test SOURCES TimeseriesHistogramTest.cpp
  552. TEST timeseries_test SOURCES TimeSeriesTest.cpp
  553. DIRECTORY synchronization/test/
  554. TEST baton_test SOURCES BatonTest.cpp
  555. TEST call_once_test SOURCES CallOnceTest.cpp
  556. TEST lifo_sem_test SOURCES LifoSemTests.cpp
  557. TEST rw_spin_lock_test SOURCES RWSpinLockTest.cpp
  558. DIRECTORY system/test/
  559. TEST memory_mapping_test SOURCES MemoryMappingTest.cpp
  560. TEST shell_test SOURCES ShellTest.cpp
  561. #TEST subprocess_test SOURCES SubprocessTest.cpp
  562. TEST thread_id_test SOURCES ThreadIdTest.cpp
  563. TEST thread_name_test SOURCES ThreadNameTest.cpp
  564. DIRECTORY synchronization/test/
  565. TEST atomic_struct_test SOURCES AtomicStructTest.cpp
  566. TEST small_locks_test SOURCES SmallLocksTest.cpp
  567. TEST atomic_util_test SOURCES AtomicUtilTest.cpp
  568. DIRECTORY test/
  569. TEST ahm_int_stress_test SOURCES AHMIntStressTest.cpp
  570. TEST arena_smartptr_test SOURCES ArenaSmartPtrTest.cpp
  571. TEST ascii_check_test SOURCES AsciiCaseInsensitiveTest.cpp
  572. TEST atomic_bit_set_test SOURCES AtomicBitSetTest.cpp
  573. TEST atomic_hash_array_test SOURCES AtomicHashArrayTest.cpp
  574. TEST atomic_hash_map_test HANGING
  575. SOURCES AtomicHashMapTest.cpp
  576. TEST atomic_linked_list_test SOURCES AtomicLinkedListTest.cpp
  577. TEST atomic_unordered_map_test SOURCES AtomicUnorderedMapTest.cpp
  578. TEST cacheline_padded_test SOURCES CachelinePaddedTest.cpp
  579. TEST clock_gettime_wrappers_test SOURCES ClockGettimeWrappersTest.cpp
  580. TEST concurrent_skip_list_test SOURCES ConcurrentSkipListTest.cpp
  581. TEST conv_test SOURCES ConvTest.cpp
  582. TEST cpu_id_test SOURCES CpuIdTest.cpp
  583. TEST demangle_test SOURCES DemangleTest.cpp
  584. TEST deterministic_schedule_test SOURCES DeterministicScheduleTest.cpp
  585. TEST discriminated_ptr_test SOURCES DiscriminatedPtrTest.cpp
  586. TEST dynamic_test SOURCES DynamicTest.cpp
  587. TEST dynamic_converter_test SOURCES DynamicConverterTest.cpp
  588. TEST dynamic_other_test SOURCES DynamicOtherTest.cpp
  589. TEST endian_test SOURCES EndianTest.cpp
  590. TEST exception_test SOURCES ExceptionTest.cpp
  591. TEST exception_wrapper_test SOURCES ExceptionWrapperTest.cpp
  592. TEST expected_test SOURCES ExpectedTest.cpp
  593. TEST fbvector_test SOURCES FBVectorTest.cpp
  594. TEST file_test SOURCES FileTest.cpp
  595. # Open-source linux build can't handle running this.
  596. #TEST file_lock_test SOURCES FileLockTest.cpp
  597. TEST file_util_test HANGING
  598. SOURCES FileUtilTest.cpp
  599. TEST fingerprint_test SOURCES FingerprintTest.cpp
  600. TEST format_other_test SOURCES FormatOtherTest.cpp
  601. TEST format_test SOURCES FormatTest.cpp
  602. TEST function_test BROKEN
  603. SOURCES FunctionTest.cpp
  604. TEST function_ref_test SOURCES FunctionRefTest.cpp
  605. TEST futex_test SOURCES FutexTest.cpp
  606. TEST glog_test SOURCES GLogTest.cpp
  607. TEST group_varint_test SOURCES GroupVarintTest.cpp
  608. TEST group_varint_test_ssse3 SOURCES GroupVarintTest.cpp
  609. TEST has_member_fn_traits_test SOURCES HasMemberFnTraitsTest.cpp
  610. TEST iterators_test SOURCES IteratorsTest.cpp
  611. TEST indestructible_test SOURCES IndestructibleTest.cpp
  612. TEST indexed_mem_pool_test BROKEN
  613. SOURCES IndexedMemPoolTest.cpp
  614. # MSVC Preprocessor stringizing raw string literals bug
  615. #TEST json_test SOURCES JsonTest.cpp
  616. TEST json_pointer_test SOURCES json_pointer_test.cpp
  617. TEST json_patch_test SOURCES json_patch_test.cpp
  618. TEST json_other_test
  619. CONTENT_DIR json_test_data/
  620. SOURCES
  621. JsonOtherTest.cpp
  622. TEST lazy_test SOURCES LazyTest.cpp
  623. TEST lock_traits_test SOURCES LockTraitsTest.cpp
  624. TEST locks_test SOURCES SpinLockTest.cpp
  625. TEST math_test SOURCES MathTest.cpp
  626. TEST map_util_test SOURCES MapUtilTest.cpp
  627. TEST memcpy_test SOURCES MemcpyTest.cpp
  628. TEST memory_idler_test SOURCES MemoryIdlerTest.cpp
  629. TEST memory_test WINDOWS_DISABLED
  630. SOURCES MemoryTest.cpp
  631. TEST move_wrapper_test SOURCES MoveWrapperTest.cpp
  632. TEST mpmc_pipeline_test SOURCES MPMCPipelineTest.cpp
  633. TEST mpmc_queue_test SLOW
  634. SOURCES MPMCQueueTest.cpp
  635. TEST network_address_test HANGING
  636. SOURCES
  637. IPAddressTest.cpp
  638. MacAddressTest.cpp
  639. SocketAddressTest.cpp
  640. TEST optional_test SOURCES OptionalTest.cpp
  641. TEST packed_sync_ptr_test HANGING
  642. SOURCES PackedSyncPtrTest.cpp
  643. TEST padded_test SOURCES PaddedTest.cpp
  644. #TEST poly_test SOURCES PolyTest.cpp
  645. TEST portability_test SOURCES PortabilityTest.cpp
  646. TEST producer_consumer_queue_test SLOW
  647. SOURCES ProducerConsumerQueueTest.cpp
  648. TEST random_test SOURCES RandomTest.cpp
  649. TEST range_test SOURCES RangeTest.cpp
  650. TEST scope_guard_test SOURCES ScopeGuardTest.cpp
  651. # Heavily dependent on drand and srand48
  652. #TEST shared_mutex_test SOURCES SharedMutexTest.cpp
  653. # SingletonTest requires Subprocess
  654. #TEST singleton_test SOURCES SingletonTest.cpp
  655. TEST singleton_test_global SOURCES SingletonTestGlobal.cpp
  656. TEST singleton_thread_local_test SOURCES SingletonThreadLocalTest.cpp
  657. TEST small_vector_test WINDOWS_DISABLED
  658. SOURCES small_vector_test.cpp
  659. TEST sorted_vector_types_test SOURCES sorted_vector_test.cpp
  660. TEST string_test SOURCES StringTest.cpp
  661. TEST synchronized_test WINDOWS_DISABLED
  662. SOURCES SynchronizedTest.cpp
  663. TEST thread_cached_int_test SOURCES ThreadCachedIntTest.cpp
  664. TEST thread_local_test SOURCES ThreadLocalTest.cpp
  665. TEST timeout_queue_test SOURCES TimeoutQueueTest.cpp
  666. TEST token_bucket_test SOURCES TokenBucketTest.cpp
  667. TEST traits_test SOURCES TraitsTest.cpp
  668. TEST try_test SOURCES TryTest.cpp
  669. TEST unit_test SOURCES UnitTest.cpp
  670. TEST uri_test SOURCES UriTest.cpp
  671. TEST varint_test SOURCES VarintTest.cpp
  672. )
  673. endif()
  674. add_subdirectory(folly)