Split tests into test and benchmarks.
[folly.git] / folly / test / MemoryIdlerTest.cpp
index 746ab766ae3e60207882eba36a2ee78071673e52..ed4a35faffaf10b0d2dea574c3a5ae6c5c3a426e 100644 (file)
  */
 
 #include <folly/detail/MemoryIdler.h>
+
 #include <folly/Baton.h>
+
 #include <memory>
 #include <thread>
 #include <assert.h>
 #include <semaphore.h>
-#include <gflags/gflags.h>
+
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
-#include <folly/Benchmark.h>
 
 using namespace folly;
 using namespace folly::detail;
@@ -182,27 +183,3 @@ TEST(MemoryIdler, futexWaitNeverFlush) {
   EXPECT_TRUE((MemoryIdler::futexWait<MockAtom, MockClock>(
       fut, 1, -1, MockClock::duration::max())));
 }
-
-
-BENCHMARK(releaseStack, iters) {
-  for (size_t i = 0; i < iters; ++i) {
-    MemoryIdler::unmapUnusedStack();
-  }
-}
-
-BENCHMARK(releaseMallocTLS, iters) {
-  for (size_t i = 0; i < iters; ++i) {
-    MemoryIdler::flushLocalMallocCaches();
-  }
-}
-
-int main(int argc, char** argv) {
-  testing::InitGoogleTest(&argc, argv);
-  gflags::ParseCommandLineFlags(&argc, &argv, true);
-
-  auto rv = RUN_ALL_TESTS();
-  if (!rv && FLAGS_benchmark) {
-    folly::runBenchmarks();
-  }
-  return rv;
-}