From f1fdf5205bb9bf53e58f3c5dc71001e9e894e321 Mon Sep 17 00:00:00 2001 From: Venkatesh Radhakrishnan Date: Mon, 12 Oct 2015 13:05:42 -0700 Subject: [PATCH] Clean up dependency: Move db_test_util.* to db directory Summary: As part of tech debt week, we are cleaning up dependencies. This diff moves db_test_util.[h,cc] from util to db directory. Test Plan: make check Reviewers: igor, sdong Reviewed By: sdong Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D48543 --- CMakeLists.txt | 2 +- Makefile | 20 ++++++++++---------- db/db_compaction_filter_test.cc | 2 +- db/db_compaction_test.cc | 2 +- db/db_dynamic_level_test.cc | 2 +- db/db_inplace_update_test.cc | 2 +- db/db_log_iter_test.cc | 2 +- db/db_tailing_iter_test.cc | 2 +- db/db_test.cc | 2 +- {util => db}/db_test_util.cc | 2 +- {util => db}/db_test_util.h | 2 +- db/db_universal_compaction_test.cc | 2 +- db/db_wal_test.cc | 2 +- src.mk | 2 +- 14 files changed, 23 insertions(+), 23 deletions(-) rename {util => db}/db_test_util.cc (99%) rename {util => db}/db_test_util.h (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 446d481bf..15eb1817a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,6 +100,7 @@ set(SOURCES db/db_impl_experimental.cc db/db_impl_readonly.cc db/db_iter.cc + db/db_test_util.cc db/event_helpers.cc db/experimental.cc db/filename.cc @@ -175,7 +176,6 @@ set(SOURCES util/crc32c.cc util/db_info_dumper.cc util/delete_scheduler_impl.cc - util/db_test_util.cc util/dynamic_bloom.cc util/env.cc util/env_hdfs.cc diff --git a/Makefile b/Makefile index 13c063fed..d9ad6572e 100644 --- a/Makefile +++ b/Makefile @@ -609,7 +609,7 @@ unity.a: unity.o $(AM_V_at)$(AR) $(ARFLAGS) $@ unity.o # try compiling db_test with unity -unity_test: db/db_test.o util/db_test_util.o $(TESTHARNESS) unity.a +unity_test: db/db_test.o db/db_test_util.o $(TESTHARNESS) unity.a $(AM_LINK) ./unity_test @@ -709,34 +709,34 @@ crc32c_test: util/crc32c_test.o $(LIBOBJECTS) $(TESTHARNESS) slice_transform_test: util/slice_transform_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -db_test: db/db_test.o util/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) +db_test: db/db_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -db_log_iter_test: db/db_log_iter_test.o util/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) +db_log_iter_test: db/db_log_iter_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -db_compaction_filter_test: db/db_compaction_filter_test.o util/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) +db_compaction_filter_test: db/db_compaction_filter_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -db_compaction_test: db/db_compaction_test.o util/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) +db_compaction_test: db/db_compaction_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -db_dynamic_level_test: db/db_dynamic_level_test.o util/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) +db_dynamic_level_test: db/db_dynamic_level_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -db_inplace_update_test: db/db_inplace_update_test.o util/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) +db_inplace_update_test: db/db_inplace_update_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -db_tailing_iter_test: db/db_tailing_iter_test.o util/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) +db_tailing_iter_test: db/db_tailing_iter_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) db_iter_test: db/db_iter_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -db_universal_compaction_test: db/db_universal_compaction_test.o util/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) +db_universal_compaction_test: db/db_universal_compaction_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -db_wal_test: db/db_wal_test.o util/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) +db_wal_test: db/db_wal_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) log_write_bench: util/log_write_bench.o $(LIBOBJECTS) $(TESTHARNESS) diff --git a/db/db_compaction_filter_test.cc b/db/db_compaction_filter_test.cc index 7b10f8fa4..a48c86516 100644 --- a/db/db_compaction_filter_test.cc +++ b/db/db_compaction_filter_test.cc @@ -7,8 +7,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. +#include "db/db_test_util.h" #include "port/stack_trace.h" -#include "util/db_test_util.h" namespace rocksdb { diff --git a/db/db_compaction_test.cc b/db/db_compaction_test.cc index e052fc7e1..8f8633e83 100644 --- a/db/db_compaction_test.cc +++ b/db/db_compaction_test.cc @@ -7,9 +7,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. +#include "db/db_test_util.h" #include "port/stack_trace.h" #include "rocksdb/experimental.h" -#include "util/db_test_util.h" #include "util/sync_point.h" namespace rocksdb { diff --git a/db/db_dynamic_level_test.cc b/db/db_dynamic_level_test.cc index f4d2b8199..0a37c7002 100644 --- a/db/db_dynamic_level_test.cc +++ b/db/db_dynamic_level_test.cc @@ -12,8 +12,8 @@ // which is a pity, it is a good test #if !(defined NDEBUG) || !defined(OS_WIN) +#include "db/db_test_util.h" #include "port/stack_trace.h" -#include "util/db_test_util.h" namespace rocksdb { class DBTestDynamicLevel : public DBTestBase { diff --git a/db/db_inplace_update_test.cc b/db/db_inplace_update_test.cc index a04c2f50c..046ddead4 100644 --- a/db/db_inplace_update_test.cc +++ b/db/db_inplace_update_test.cc @@ -6,8 +6,8 @@ // Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. +#include "db/db_test_util.h" #include "port/stack_trace.h" -#include "util/db_test_util.h" namespace rocksdb { diff --git a/db/db_log_iter_test.cc b/db/db_log_iter_test.cc index a1e8d2012..e42dbcb44 100644 --- a/db/db_log_iter_test.cc +++ b/db/db_log_iter_test.cc @@ -12,8 +12,8 @@ // which is a pity, it is a good test #if !(defined NDEBUG) || !defined(OS_WIN) +#include "db/db_test_util.h" #include "port/stack_trace.h" -#include "util/db_test_util.h" namespace rocksdb { diff --git a/db/db_tailing_iter_test.cc b/db/db_tailing_iter_test.cc index 4ca5e9018..914b25774 100644 --- a/db/db_tailing_iter_test.cc +++ b/db/db_tailing_iter_test.cc @@ -12,9 +12,9 @@ // which is a pity, it is a good test #if !(defined NDEBUG) || !defined(OS_WIN) +#include "db/db_test_util.h" #include "db/forward_iterator.h" #include "port/stack_trace.h" -#include "util/db_test_util.h" namespace rocksdb { diff --git a/db/db_test.cc b/db/db_test.cc index ea455196f..e232a5665 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -26,6 +26,7 @@ #include "db/filename.h" #include "db/dbformat.h" #include "db/db_impl.h" +#include "db/db_test_util.h" #include "db/job_context.h" #include "db/version_set.h" #include "db/write_batch_internal.h" @@ -53,7 +54,6 @@ #include "table/block_based_table_factory.h" #include "table/mock_table.h" #include "table/plain_table_factory.h" -#include "util/db_test_util.h" #include "util/file_reader_writer.h" #include "util/hash.h" #include "util/hash_linklist_rep.h" diff --git a/util/db_test_util.cc b/db/db_test_util.cc similarity index 99% rename from util/db_test_util.cc rename to db/db_test_util.cc index 6b494eaec..b545f2104 100644 --- a/util/db_test_util.cc +++ b/db/db_test_util.cc @@ -7,7 +7,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#include "util/db_test_util.h" +#include "db/db_test_util.h" namespace rocksdb { diff --git a/util/db_test_util.h b/db/db_test_util.h similarity index 99% rename from util/db_test_util.h rename to db/db_test_util.h index 774cce874..3a079b2da 100644 --- a/util/db_test_util.h +++ b/db/db_test_util.h @@ -27,6 +27,7 @@ #include #include "db/db_impl.h" +#include "db/db_test_util.h" #include "db/dbformat.h" #include "db/filename.h" #include "rocksdb/cache.h" @@ -43,7 +44,6 @@ #include "table/mock_table.h" #include "table/plain_table_factory.h" #include "util/compression.h" -#include "util/db_test_util.h" #include "util/hash_linklist_rep.h" #include "util/mock_env.h" #include "util/mutexlock.h" diff --git a/db/db_universal_compaction_test.cc b/db/db_universal_compaction_test.cc index 8e18699c2..236f5df1f 100644 --- a/db/db_universal_compaction_test.cc +++ b/db/db_universal_compaction_test.cc @@ -7,8 +7,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. +#include "db/db_test_util.h" #include "port/stack_trace.h" -#include "util/db_test_util.h" #if !(defined NDEBUG) || !defined(OS_WIN) #include "util/sync_point.h" diff --git a/db/db_wal_test.cc b/db/db_wal_test.cc index 531021ec4..7cbaacd61 100644 --- a/db/db_wal_test.cc +++ b/db/db_wal_test.cc @@ -7,8 +7,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. +#include "db/db_test_util.h" #include "port/stack_trace.h" -#include "util/db_test_util.h" #if !(defined NDEBUG) || !defined(OS_WIN) #include "util/sync_point.h" #endif diff --git a/src.mk b/src.mk index 5e9ed1644..39f9c1fa7 100644 --- a/src.mk +++ b/src.mk @@ -205,6 +205,7 @@ TEST_BENCH_SOURCES = \ db/prefix_test.cc \ db/skiplist_test.cc \ db/table_properties_collector_test.cc \ + db/db_test_util.cc \ db/version_builder_test.cc \ db/version_edit_test.cc \ db/version_set_test.cc \ @@ -233,7 +234,6 @@ TEST_BENCH_SOURCES = \ util/cache_test.cc \ util/coding_test.cc \ util/crc32c_test.cc \ - util/db_test_util.cc \ util/dynamic_bloom_test.cc \ util/env_test.cc \ util/filelock_test.cc \