Add support for tagging a test as BROKEN in the CMake build
authorChristopher Dykes <cdykes@fb.com>
Tue, 18 Jul 2017 01:59:11 +0000 (18:59 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 18 Jul 2017 02:11:55 +0000 (19:11 -0700)
Summary: Also use it to disable function_test and indexed_mem_pool_test for now while the source of their breakage is being investigated.

Reviewed By: yfeldblum

Differential Revision: D5440415

fbshipit-source-id: 630c884ccd2db660bfc3e4529a2d35941d3bd0d3

CMake/FollyFunctions.cmake
CMakeLists.txt

index 61992c62159f3224869bbc21435cd7c752ccae7d..ee538856b20fee6819fc70beb3002941d444be0b 100755 (executable)
@@ -205,7 +205,9 @@ function(folly_define_tests)
                     "x${ARGV${currentArg}}" STREQUAL "xDIRECTORY")\r
               break()\r
             elseif (argumentState EQUAL 0)\r
-              if ("x${ARGV${currentArg}}" STREQUAL "xHANGING")\r
+              if ("x${ARGV${currentArg}}" STREQUAL "xBROKEN")\r
+                set(test_${cur_test}_tag "BROKEN")\r
+              elseif ("x${ARGV${currentArg}}" STREQUAL "xHANGING")\r
                 set(test_${cur_test}_tag "HANGING")\r
               elseif ("x${ARGV${currentArg}}" STREQUAL "xSLOW")\r
                 set(test_${cur_test}_tag "SLOW")\r
@@ -246,6 +248,7 @@ function(folly_define_tests)
   set(cur_test 0)\r
   while (cur_test LESS test_count)\r
     if ("x${test_${cur_test}_tag}" STREQUAL "xNONE" OR\r
+        ("x${test_${cur_test}_tag}" STREQUAL "xBROKEN" AND BUILD_BROKEN_TESTS) OR\r
         ("x${test_${cur_test}_tag}" STREQUAL "xSLOW" AND BUILD_SLOW_TESTS) OR\r
         ("x${test_${cur_test}_tag}" STREQUAL "xHANGING" AND BUILD_HANGING_TESTS)\r
     )\r
index 940e79a7fadf10770d4e1cc1b580727c59fba907..6f717039cea7312ce672380f6f65de87403345bc 100755 (executable)
@@ -243,6 +243,7 @@ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/folly-deps.cmake "\ninclude(folly-target
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/folly-deps.cmake DESTINATION share/folly RENAME folly-config.cmake)
 
 option(BUILD_TESTS "If enabled, compile the tests." OFF)
+option(BUILD_BROKEN_TESTS "If enabled, compile tests that are known to be broken." OFF)
 option(BUILD_HANGING_TESTS "If enabled, compile tests that are known to hang." OFF)
 option(BUILD_SLOW_TESTS "If enabled, compile tests that take a while to run in debug mode." OFF)
 if (BUILD_TESTS)
@@ -502,7 +503,8 @@ if (BUILD_TESTS)
       TEST format_other_test SOURCES FormatOtherTest.cpp
       TEST format_test SOURCES FormatTest.cpp
       TEST function_scheduler_test SOURCES FunctionSchedulerTest.cpp
-      TEST function_test SOURCES FunctionTest.cpp
+      TEST function_test BROKEN
+        SOURCES FunctionTest.cpp
       TEST function_ref_test SOURCES FunctionRefTest.cpp
       TEST futex_test SOURCES FutexTest.cpp
       TEST group_varint_test SOURCES GroupVarintTest.cpp
@@ -510,7 +512,8 @@ if (BUILD_TESTS)
       TEST has_member_fn_traits_test SOURCES HasMemberFnTraitsTest.cpp
       TEST hash_test SOURCES HashTest.cpp
       TEST indestructible_test SOURCES IndestructibleTest.cpp
-      TEST indexed_mem_pool_test SOURCES IndexedMemPoolTest.cpp
+      TEST indexed_mem_pool_test BROKEN
+        SOURCES IndexedMemPoolTest.cpp
       # MSVC Preprocessor stringizing raw string literals bug
       #TEST json_test SOURCES JsonTest.cpp
       TEST json_other_test