Block tests under ROCKSDB_LITE

Summary:
This patch will block all tests (not including db_test) that don't compile / fail under ROCKSDB_LITE

Test Plan:
OPT=-DROCKSDB_LITE make db_compaction_filter_test -j64 &&
OPT=-DROCKSDB_LITE make db_compaction_test -j64 &&
OPT=-DROCKSDB_LITE make db_dynamic_level_test -j64 &&
OPT=-DROCKSDB_LITE make db_log_iter_test -j64 &&
OPT=-DROCKSDB_LITE make db_tailing_iter_test -j64 &&
OPT=-DROCKSDB_LITE make db_universal_compaction_test -j64 &&
OPT=-DROCKSDB_LITE make ldb_cmd_test -j64

make clean

make db_compaction_filter_test -j64 &&
make db_compaction_test -j64 &&
make db_dynamic_level_test -j64 &&
make db_log_iter_test -j64 &&
make db_tailing_iter_test -j64 &&
make db_universal_compaction_test -j64 &&
make ldb_cmd_test -j64

Reviewers: yhchiang, igor, sdong

Reviewed By: sdong

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D48723
main
Islam AbdelRahman 9 years ago
parent 5eee1ef2dd
commit 6d730b4ae7
  1. 6
      db/db_compaction_filter_test.cc
  2. 7
      db/db_compaction_test.cc
  3. 6
      db/db_dynamic_level_test.cc
  4. 6
      db/db_log_iter_test.cc
  5. 6
      db/db_tailing_iter_test.cc
  6. 6
      db/db_universal_compaction_test.cc
  7. 11
      tools/ldb_cmd_test.cc

@ -186,6 +186,7 @@ class ChangeFilterFactory : public CompactionFilterFactory {
virtual const char* Name() const override { return "ChangeFilterFactory"; } virtual const char* Name() const override { return "ChangeFilterFactory"; }
}; };
#ifndef ROCKSDB_LITE
TEST_F(DBTestCompactionFilter, CompactionFilter) { TEST_F(DBTestCompactionFilter, CompactionFilter) {
Options options = CurrentOptions(); Options options = CurrentOptions();
options.max_open_files = -1; options.max_open_files = -1;
@ -362,6 +363,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilterDeletesAll) {
delete itr; delete itr;
} }
#endif // ROCKSDB_LITE
TEST_F(DBTestCompactionFilter, CompactionFilterWithValueChange) { TEST_F(DBTestCompactionFilter, CompactionFilterWithValueChange) {
do { do {
@ -493,6 +495,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilterWithMergeOperator) {
ASSERT_EQ(newvalue, four); ASSERT_EQ(newvalue, four);
} }
#ifndef ROCKSDB_LITE
TEST_F(DBTestCompactionFilter, CompactionFilterContextManual) { TEST_F(DBTestCompactionFilter, CompactionFilterContextManual) {
KeepFilterFactory* filter = new KeepFilterFactory(true, true); KeepFilterFactory* filter = new KeepFilterFactory(true, true);
@ -550,6 +553,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilterContextManual) {
ASSERT_EQ(count, 1); ASSERT_EQ(count, 1);
} }
} }
#endif // ROCKSDB_LITE
TEST_F(DBTestCompactionFilter, CompactionFilterContextCfId) { TEST_F(DBTestCompactionFilter, CompactionFilterContextCfId) {
KeepFilterFactory* filter = new KeepFilterFactory(false, true); KeepFilterFactory* filter = new KeepFilterFactory(false, true);
@ -580,6 +584,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilterContextCfId) {
ASSERT_TRUE(filter->compaction_filter_created()); ASSERT_TRUE(filter->compaction_filter_created());
} }
#ifndef ROCKSDB_LITE
// Compaction filters should only be applied to records that are newer than the // Compaction filters should only be applied to records that are newer than the
// latest snapshot. This test inserts records and applies a delete filter. // latest snapshot. This test inserts records and applies a delete filter.
TEST_F(DBTestCompactionFilter, CompactionFilterSnapshot) { TEST_F(DBTestCompactionFilter, CompactionFilterSnapshot) {
@ -615,6 +620,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilterSnapshot) {
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), nullptr, nullptr)); ASSERT_OK(db_->CompactRange(CompactRangeOptions(), nullptr, nullptr));
ASSERT_EQ(0U, CountLiveFiles()); ASSERT_EQ(0U, CountLiveFiles());
} }
#endif // ROCKSDB_LITE
} // namespace rocksdb } // namespace rocksdb

@ -14,8 +14,7 @@
namespace rocksdb { namespace rocksdb {
// SYNC_POINT is not supported in released Windows mode. // SYNC_POINT is not supported in released Windows mode.
#if !(defined NDEBUG) || !defined(OS_WIN) #if (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
class DBCompactionTest : public DBTestBase { class DBCompactionTest : public DBTestBase {
public: public:
@ -1844,11 +1843,11 @@ TEST_P(DBCompactionTestWithParam, ForceBottommostLevelCompaction) {
INSTANTIATE_TEST_CASE_P(DBCompactionTestWithParam, DBCompactionTestWithParam, INSTANTIATE_TEST_CASE_P(DBCompactionTestWithParam, DBCompactionTestWithParam,
::testing::Values(1, 4)); ::testing::Values(1, 4));
#endif // !(defined NDEBUG) || !defined(OS_WIN) #endif // (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
} // namespace rocksdb } // namespace rocksdb
int main(int argc, char** argv) { int main(int argc, char** argv) {
#if !(defined NDEBUG) || !defined(OS_WIN) #if (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
rocksdb::port::InstallStackTraceHandler(); rocksdb::port::InstallStackTraceHandler();
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();

@ -10,7 +10,7 @@
// Introduction of SyncPoint effectively disabled building and running this test // Introduction of SyncPoint effectively disabled building and running this test
// in Release build. // in Release build.
// which is a pity, it is a good test // which is a pity, it is a good test
#if !(defined NDEBUG) || !defined(OS_WIN) #if (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
#include "db/db_test_util.h" #include "db/db_test_util.h"
#include "port/stack_trace.h" #include "port/stack_trace.h"
@ -484,10 +484,10 @@ TEST_F(DBTestDynamicLevel, MigrateToDynamicLevelMaxBytesBase) {
} }
} // namespace rocksdb } // namespace rocksdb
#endif // !(defined NDEBUG) || !defined(OS_WIN) #endif // (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
int main(int argc, char** argv) { int main(int argc, char** argv) {
#if !(defined NDEBUG) || !defined(OS_WIN) #if (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
rocksdb::port::InstallStackTraceHandler(); rocksdb::port::InstallStackTraceHandler();
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();

@ -10,7 +10,7 @@
// Introduction of SyncPoint effectively disabled building and running this test // Introduction of SyncPoint effectively disabled building and running this test
// in Release build. // in Release build.
// which is a pity, it is a good test // which is a pity, it is a good test
#if !(defined NDEBUG) || !defined(OS_WIN) #if (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
#include "db/db_test_util.h" #include "db/db_test_util.h"
#include "port/stack_trace.h" #include "port/stack_trace.h"
@ -277,10 +277,10 @@ TEST_F(DBTestXactLogIterator, TransactionLogIteratorBlobs) {
} }
} // namespace rocksdb } // namespace rocksdb
#endif // !(defined NDEBUG) || !defined(OS_WIN) #endif // (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
int main(int argc, char** argv) { int main(int argc, char** argv) {
#if !(defined NDEBUG) || !defined(OS_WIN) #if (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
rocksdb::port::InstallStackTraceHandler(); rocksdb::port::InstallStackTraceHandler();
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();

@ -10,7 +10,7 @@
// Introduction of SyncPoint effectively disabled building and running this test // Introduction of SyncPoint effectively disabled building and running this test
// in Release build. // in Release build.
// which is a pity, it is a good test // which is a pity, it is a good test
#if !(defined NDEBUG) || !defined(OS_WIN) #if (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
#include "db/db_test_util.h" #include "db/db_test_util.h"
#include "db/forward_iterator.h" #include "db/forward_iterator.h"
@ -646,10 +646,10 @@ TEST_F(DBTestTailingIterator, ManagedTailingIteratorSeekToSame) {
} // namespace rocksdb } // namespace rocksdb
#endif // !(defined NDEBUG) || !defined(OS_WIN) #endif // (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
int main(int argc, char** argv) { int main(int argc, char** argv) {
#if !(defined NDEBUG) || !defined(OS_WIN) #if (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
rocksdb::port::InstallStackTraceHandler(); rocksdb::port::InstallStackTraceHandler();
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();

@ -9,7 +9,7 @@
#include "db/db_test_util.h" #include "db/db_test_util.h"
#include "port/stack_trace.h" #include "port/stack_trace.h"
#if !(defined NDEBUG) || !defined(OS_WIN) #if (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
#include "util/sync_point.h" #include "util/sync_point.h"
namespace rocksdb { namespace rocksdb {
@ -1210,10 +1210,10 @@ INSTANTIATE_TEST_CASE_P(DBTestUniversalManualCompactionOutputPathId,
} // namespace rocksdb } // namespace rocksdb
#endif // !(defined NDEBUG) || !defined(OS_WIN) #endif // (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
int main(int argc, char** argv) { int main(int argc, char** argv) {
#if !(defined NDEBUG) || !defined(OS_WIN) #if (!(defined NDEBUG) || !defined(OS_WIN)) && !defined(ROCKSDB_LITE)
rocksdb::port::InstallStackTraceHandler(); rocksdb::port::InstallStackTraceHandler();
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();

@ -3,6 +3,8 @@
// LICENSE file in the root directory of this source tree. An additional grant // 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. // of patent rights can be found in the PATENTS file in the same directory.
// //
#ifndef ROCKSDB_LITE
#include "tools/ldb_cmd.h" #include "tools/ldb_cmd.h"
#include "util/testharness.h" #include "util/testharness.h"
@ -42,3 +44,12 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();
} }
#else
#include <stdio.h>
int main(int argc, char** argv) {
fprintf(stderr, "SKIPPED as LDBCommand is not supported in ROCKSDB_LITE\n");
return 0;
}
#endif // ROCKSDB_LITE

Loading…
Cancel
Save