Move AddFile() tests to external_sst_file_test.cc

Summary: Simply move the tests

Test Plan: make check -j64

Reviewers: andrewkr, lightmark, yiwu, yhchiang, kradhakrishnan, sdong

Reviewed By: sdong

Subscribers: andrewkr, dhruba

Differential Revision: https://reviews.facebook.net/D62529
This commit is contained in:
Islam AbdelRahman 2016-09-07 15:41:54 -07:00
parent 66a91e2607
commit 52ee07b021
7 changed files with 1259 additions and 1201 deletions

View File

@ -370,6 +370,7 @@ set(TESTS
db/db_flush_test.cc
db/db_iterator_test.cc
db/db_sst_test.cc
db/external_sst_file_test.cc
db/db_universal_compaction_test.cc
db/db_wal_test.cc
db/dbformat_test.cc

View File

@ -285,6 +285,7 @@ TESTS = \
db_iterator_test \
db_options_test \
db_sst_test \
external_sst_file_test \
db_tailing_iter_test \
db_universal_compaction_test \
db_wal_test \
@ -392,6 +393,7 @@ PARALLEL_TEST = \
db_compaction_filter_test \
db_compaction_test \
db_sst_test \
external_sst_file_test \
db_test \
db_universal_compaction_test \
fault_injection_test \
@ -961,6 +963,9 @@ db_options_test: db/db_options_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARN
db_sst_test: db/db_sst_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS)
$(AM_LINK)
external_sst_file_test: db/external_sst_file_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS)
$(AM_LINK)
db_tailing_iter_test: db/db_tailing_iter_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS)
$(AM_LINK)

File diff suppressed because it is too large Load Diff

1178
db/external_sst_file_test.cc Normal file

File diff suppressed because it is too large Load Diff

11
src.mk
View File

@ -221,18 +221,19 @@ MAIN_SOURCES = \
db/dbformat_test.cc \
db/db_iter_test.cc \
db/db_test.cc \
db/db_block_cache_test.cc \
db/db_block_cache_test.cc \
db/db_io_failure_test.cc \
db/db_bloom_filter_test.cc \
db/db_compaction_filter_test.cc \
db/db_compaction_test.cc \
db/db_dynamic_level_test.cc \
db/db_flush_test.cc \
db/db_flush_test.cc \
db/db_inplace_update_test.cc \
db/db_iterator_test.cc \
db/db_iterator_test.cc \
db/db_log_iter_test.cc \
db/db_options_test.cc \
db/db_sst_test.cc \
db/db_options_test.cc \
db/db_sst_test.cc \
db/external_sst_file_test.cc \
db/db_tailing_iter_test.cc \
db/db_universal_compaction_test.cc \
db/db_wal_test.cc \

View File

@ -359,5 +359,30 @@ void RandomInitCFOptions(ColumnFamilyOptions* cf_opt, Random* rnd) {
&cf_opt->compression_per_level, rnd);
}
Status DestroyDir(Env* env, const std::string& dir) {
Status s;
if (env->FileExists(dir).IsNotFound()) {
return s;
}
std::vector<std::string> files_in_dir;
s = env->GetChildren(dir, &files_in_dir);
if (s.ok()) {
for (auto& file_in_dir : files_in_dir) {
if (file_in_dir == "." || file_in_dir == "..") {
continue;
}
s = env->DeleteFile(dir + "/" + file_in_dir);
if (!s.ok()) {
break;
}
}
}
if (s.ok()) {
s = env->DeleteDir(dir);
}
return s;
}
} // namespace test
} // namespace rocksdb

View File

@ -691,5 +691,7 @@ TableFactory* RandomTableFactory(Random* rnd, int pre_defined = -1);
std::string RandomName(Random* rnd, const size_t len);
Status DestroyDir(Env* env, const std::string& dir);
} // namespace test
} // namespace rocksdb