Commit 819becba authored by Alex Hornby's avatar Alex Hornby Committed by Facebook GitHub Bot

folly: fixes to renable cmake tests (#1691)

Summary:
Having the tests is useful to be able to test the OSS builds. A few were failing for me locally so I've tagged them BROKEN in CMakeLists.txt which folly's cmake config filters out

Pull Request resolved: https://github.com/facebook/folly/pull/1691

Test Plan:
tested with:

```
./build/fbcode_builder/getdeps.py --allow-system-packages build
./build/fbcode_builder/getdeps.py --allow-system-packages test
...
100% tests passed, 0 tests failed out of 2736

Total Test time (real) =  14.95 sec
````

Reviewed By: yfeldblum, Gownta

Differential Revision: D33169409

Pulled By: ahornby

fbshipit-source-id: 9c781a84b8873c295af96368dd8315254a78f096
parent 39fc6b12
......@@ -266,17 +266,19 @@ function(folly_define_tests)
set(cur_test 0)
while (cur_test LESS test_count)
if (
1
# TODO: Use IN_LIST after cmake 3.3
AND (test_${cur_test}_tag MATCHES "\\bBROKEN\\b" OR BUILD_BROKEN_TESTS)
AND (test_${cur_test}_tag MATCHES "\\bSLOW\\b" OR BUILD_SLOW_TESTS)
AND (test_${cur_test}_tag MATCHES "\\bHANGING\\b" OR BUILD_HANGING_TESTS)
AND (test_${cur_test}_tag MATCHES "\\bWINDOWS_DISABLED\\b" OR NOT WIN32)
AND (test_${cur_test}_tag MATCHES "\\bAPPLE_DISABLED\\b" OR NOT APPLE)
)
set(cur_test_name ${test_${cur_test}_name})
set(cur_dir_name ${directory_${test_${cur_test}_directory}_name})
set(cur_test_name ${test_${cur_test}_name})
set(cur_dir_name ${directory_${test_${cur_test}_directory}_name})
if ("BROKEN" IN_LIST test_${cur_test}_tag AND NOT BUILD_BROKEN_TESTS)
message("Skipping broken test ${cur_dir_name}${cur_test_name}, enable with BUILD_BROKEN_TESTS")
elseif ("SLOW" IN_LIST test_${cur_test}_tag AND NOT BUILD_SLOW_TESTS)
message("Skipping slow test ${cur_dir_name}${cur_test_name}, enable with BUILD_SLOW_TESTS")
elseif ("HANGING" IN_LIST test_${cur_test}_tag AND NOT BUILD_HANGING_TESTS)
message("Skipping hanging test ${cur_dir_name}${cur_test_name}, enable with BUILD_HANGING_TESTS")
elseif ("WINDOWS_DISABLED" IN_LIST test_${cur_test}_tag AND WIN32)
message("Skipping windows disabled test ${cur_dir_name}${cur_test_name}, enable with WINDOWS_DISABLED")
elseif ("APPLE_DISABLED" IN_LIST test_${cur_test}_tag AND APPLE)
message("Skipping apple disabled test ${cur_dir_name}${cur_test_name}, enable with APPLE_DISABLED")
else()
add_executable(${cur_test_name}
${test_${cur_test}_headers}
${test_${cur_test}_sources}
......
This diff is collapsed.
......@@ -353,8 +353,8 @@ TEST(ThreadPoolExecutorTest, EDFTaskStats) {
taskStats<EDFThreadPoolExecutor>();
}
#ifdef __linux__
TEST(ThreadPoolExecutorTest, GetUsedCpuTime) {
#ifdef __linux__
CPUThreadPoolExecutor e(4);
ASSERT_EQ(e.numActiveThreads(), 0);
ASSERT_EQ(e.getUsedCpuTime(), nanoseconds(0));
......@@ -399,9 +399,7 @@ TEST(ThreadPoolExecutorTest, GetUsedCpuTime) {
baton.wait();
auto elapsed3 = e.getUsedCpuTime();
ASSERT_NEAR_NS(elapsed3, elapsed2 + 500ms, 100ms);
}
#else
TEST(ThreadPoolExecutorTest, GetUsedCpuTime) {
CPUThreadPoolExecutor e(1);
// Just make sure 0 is returned
ASSERT_EQ(e.getUsedCpuTime(), nanoseconds(0));
......@@ -414,8 +412,8 @@ TEST(ThreadPoolExecutorTest, GetUsedCpuTime) {
});
baton.wait();
ASSERT_EQ(e.getUsedCpuTime(), nanoseconds(0));
}
#endif
}
template <class TPE>
static void expiration() {
......
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