From 1fe78a4073d23a96536b57e90216c4146c13136f Mon Sep 17 00:00:00 2001 From: Islam AbdelRahman Date: Tue, 13 Oct 2015 10:32:05 -0700 Subject: [PATCH] Fix tests failing in ROCKSDB_LITE Summary: Fix tests that compile under ROCKSDB_LITE but currently failing. table_test: RandomizedLongDB test is using internal stats which is not supported in ROCKSDB_LITE compaction_job_test: Using CompactionJobStats which is not supported perf_context_test: KeyComparisonCount test try to open DB in ReadOnly mode which is not supported Test Plan: run the tests under ROCKSDB_LITE Reviewers: yhchiang, sdong, igor Reviewed By: igor Subscribers: dhruba Differential Revision: https://reviews.facebook.net/D48585 --- db/compaction_job_test.cc | 13 +++++++++++++ db/perf_context_test.cc | 2 ++ table/table_test.cc | 2 ++ 3 files changed, 17 insertions(+) diff --git a/db/compaction_job_test.cc b/db/compaction_job_test.cc index b1a8909ef..b05694017 100644 --- a/db/compaction_job_test.cc +++ b/db/compaction_job_test.cc @@ -3,6 +3,8 @@ // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. +#ifndef ROCKSDB_LITE + #include #include #include @@ -695,3 +697,14 @@ int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } + +#else +#include + +int main(int argc, char** argv) { + fprintf(stderr, + "SKIPPED as CompactionJobStats is not supported in ROCKSDB_LITE\n"); + return 0; +} + +#endif // ROCKSDB_LITE diff --git a/db/perf_context_test.cc b/db/perf_context_test.cc index 359562a16..ba369d373 100644 --- a/db/perf_context_test.cc +++ b/db/perf_context_test.cc @@ -444,6 +444,7 @@ void ProfileQueries(bool enabled_time = false) { } } +#ifndef ROCKSDB_LITE TEST_F(PerfContextTest, KeyComparisonCount) { SetPerfLevel(kEnableCount); ProfileQueries(); @@ -454,6 +455,7 @@ TEST_F(PerfContextTest, KeyComparisonCount) { SetPerfLevel(kEnableTime); ProfileQueries(true); } +#endif // ROCKSDB_LITE // make perf_context_test // export ROCKSDB_TESTS=PerfContextTest.SeekKeyComparison diff --git a/table/table_test.cc b/table/table_test.cc index 928861ae2..5f4dc2fa8 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -1974,6 +1974,7 @@ TEST_F(HarnessTest, Randomized) { } } +#ifndef ROCKSDB_LITE TEST_F(HarnessTest, RandomizedLongDB) { Random rnd(test::RandomSeed()); TestArgs args = { DB_TEST, false, 16, kNoCompression, 0 }; @@ -1997,6 +1998,7 @@ TEST_F(HarnessTest, RandomizedLongDB) { } ASSERT_GT(files, 0); } +#endif // ROCKSDB_LITE class MemTableTest : public testing::Test {};