Skip to content

Commit

Permalink
Revert "Update googletest from 1.8.1 to 1.10.0 (facebook#6808)" (face…
Browse files Browse the repository at this point in the history
…book#6923)

Summary:
This reverts commit 8d87e9c.

Based on offline discussions, it's too early to upgrade to gtest 1.10, as it prevents some developers from using an older version of gtest to integrate to some other systems. Revert it for now.
Pull Request resolved: facebook#6923

Reviewed By: pdillinger

Differential Revision: D21864799

fbshipit-source-id: d0726b1ff649fc911b9378f1763316200bd363fc
  • Loading branch information
siying authored and facebook-github-bot committed Jun 3, 2020
1 parent 0f85d16 commit afa3518
Show file tree
Hide file tree
Showing 49 changed files with 17,252 additions and 10,382 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ endif()

include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/gtest-1.10.0/fused-src)
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/gtest-1.8.1/fused-src)
if(WITH_FOLLY_DISTRIBUTED_MUTEX)
include_directories(${PROJECT_SOURCE_DIR}/third-party/folly)
endif()
Expand Down Expand Up @@ -969,7 +969,7 @@ endif()
CMAKE_DEPENDENT_OPTION(WITH_TESTS "build with tests" ON
"CMAKE_BUILD_TYPE STREQUAL Debug" OFF)
if(WITH_TESTS)
add_subdirectory(third-party/gtest-1.10.0/fused-src/gtest)
add_subdirectory(third-party/gtest-1.8.1/fused-src/gtest)
add_library(testharness STATIC
test_util/testharness.cc)
target_link_libraries(testharness gtest)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ endif

export GTEST_THROW_ON_FAILURE=1
export GTEST_HAS_EXCEPTIONS=1
GTEST_DIR = third-party/gtest-1.10.0/fused-src
GTEST_DIR = third-party/gtest-1.8.1/fused-src
# AIX: pre-defined system headers are surrounded by an extern "C" block
ifeq ($(PLATFORM), OS_AIX)
PLATFORM_CCFLAGS += -I$(GTEST_DIR)
Expand Down
6 changes: 3 additions & 3 deletions TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ ROCKSDB_PREPROCESSOR_FLAGS = [
# Directories with files for #include
"-I" + REPO_PATH + "include/",
"-I" + REPO_PATH,
"-I" + REPO_PATH + "third-party/gtest-1.10.0/fused-src/",
"-I" + REPO_PATH + "third-party/gtest-1.8.1/fused-src/",
]

ROCKSDB_ARCH_PREPROCESSOR_FLAGS = {
Expand Down Expand Up @@ -451,8 +451,8 @@ cpp_library(

cpp_library(
name = "rocksdb_third_party_gtest",
srcs = ["third-party/gtest-1.10.0/fused-src/gtest/gtest-all.cc"],
headers = ["third-party/gtest-1.10.0/fused-src/gtest/gtest.h"],
srcs = ["third-party/gtest-1.8.1/fused-src/gtest/gtest-all.cc"],
headers = ["third-party/gtest-1.8.1/fused-src/gtest/gtest.h"],
arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS,
compiler_flags = ROCKSDB_COMPILER_FLAGS,
os_deps = ROCKSDB_OS_DEPS,
Expand Down
9 changes: 4 additions & 5 deletions cache/cache_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -758,13 +758,12 @@ TEST_P(CacheTest, GetCharge) {
#ifdef SUPPORT_CLOCK_CACHE
std::shared_ptr<Cache> (*new_clock_cache_func)(
size_t, int, bool, CacheMetadataChargePolicy) = NewClockCache;
INSTANTIATE_TEST_SUITE_P(CacheTestInstance, CacheTest,
testing::Values(kLRU, kClock));
INSTANTIATE_TEST_CASE_P(CacheTestInstance, CacheTest,
testing::Values(kLRU, kClock));
#else
INSTANTIATE_TEST_SUITE_P(CacheTestInstance, CacheTest, testing::Values(kLRU));
INSTANTIATE_TEST_CASE_P(CacheTestInstance, CacheTest, testing::Values(kLRU));
#endif // SUPPORT_CLOCK_CACHE
INSTANTIATE_TEST_SUITE_P(CacheTestInstance, LRUCacheTest,
testing::Values(kLRU));
INSTANTIATE_TEST_CASE_P(CacheTestInstance, LRUCacheTest, testing::Values(kLRU));

} // namespace ROCKSDB_NAMESPACE

Expand Down
12 changes: 6 additions & 6 deletions db/column_family_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,10 @@ class ColumnFamilyTest
ColumnFamilyTest() : ColumnFamilyTestBase(GetParam()) {}
};

INSTANTIATE_TEST_SUITE_P(FormatDef, ColumnFamilyTest,
testing::Values(test::kDefaultFormatVersion));
INSTANTIATE_TEST_SUITE_P(FormatLatest, ColumnFamilyTest,
testing::Values(test::kLatestFormatVersion));
INSTANTIATE_TEST_CASE_P(FormatDef, ColumnFamilyTest,
testing::Values(test::kDefaultFormatVersion));
INSTANTIATE_TEST_CASE_P(FormatLatest, ColumnFamilyTest,
testing::Values(test::kLatestFormatVersion));

TEST_P(ColumnFamilyTest, DontReuseColumnFamilyID) {
for (int iter = 0; iter < 3; ++iter) {
Expand Down Expand Up @@ -749,11 +749,11 @@ TEST_P(FlushEmptyCFTestWithParam, FlushEmptyCFTest2) {
db_options_.env = env_;
}

INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_CASE_P(
FormatDef, FlushEmptyCFTestWithParam,
testing::Values(std::make_tuple(test::kDefaultFormatVersion, true),
std::make_tuple(test::kDefaultFormatVersion, false)));
INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_CASE_P(
FormatLatest, FlushEmptyCFTestWithParam,
testing::Values(std::make_tuple(test::kLatestFormatVersion, true),
std::make_tuple(test::kLatestFormatVersion, false)));
Expand Down
4 changes: 2 additions & 2 deletions db/compaction/compaction_iterator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,8 @@ TEST_P(CompactionIteratorTest, RemoveSingleDeletionAtBottomLevel) {
nullptr /*compaction_filter*/, true /*bottommost_level*/);
}

INSTANTIATE_TEST_SUITE_P(CompactionIteratorTestInstance, CompactionIteratorTest,
testing::Values(true, false));
INSTANTIATE_TEST_CASE_P(CompactionIteratorTestInstance, CompactionIteratorTest,
testing::Values(true, false));

// Tests how CompactionIterator work together with SnapshotChecker.
class CompactionIteratorWithSnapshotCheckerTest
Expand Down
4 changes: 2 additions & 2 deletions db/compaction/compaction_job_stats_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,8 @@ TEST_P(CompactionJobStatsTest, UniversalCompactionTest) {
ASSERT_EQ(stats_checker->NumberOfUnverifiedStats(), 0U);
}

INSTANTIATE_TEST_SUITE_P(CompactionJobStatsTest, CompactionJobStatsTest,
::testing::Values(1, 4));
INSTANTIATE_TEST_CASE_P(CompactionJobStatsTest, CompactionJobStatsTest,
::testing::Values(1, 4));
} // namespace ROCKSDB_NAMESPACE

int main(int argc, char** argv) {
Expand Down
8 changes: 4 additions & 4 deletions db/comparator_db_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ class ComparatorDBTest
}
};

INSTANTIATE_TEST_SUITE_P(FormatDef, ComparatorDBTest,
testing::Values(test::kDefaultFormatVersion));
INSTANTIATE_TEST_SUITE_P(FormatLatest, ComparatorDBTest,
testing::Values(test::kLatestFormatVersion));
INSTANTIATE_TEST_CASE_P(FormatDef, ComparatorDBTest,
testing::Values(test::kDefaultFormatVersion));
INSTANTIATE_TEST_CASE_P(FormatLatest, ComparatorDBTest,
testing::Values(test::kLatestFormatVersion));

TEST_P(ComparatorDBTest, Bytewise) {
for (int rand_seed = 301; rand_seed < 306; rand_seed++) {
Expand Down
32 changes: 16 additions & 16 deletions db/db_basic_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1251,8 +1251,8 @@ TEST_P(DBMultiGetTestWithParam, MultiGetMultiCFSnapshot) {
}
}

INSTANTIATE_TEST_SUITE_P(DBMultiGetTestWithParam, DBMultiGetTestWithParam,
testing::Bool());
INSTANTIATE_TEST_CASE_P(DBMultiGetTestWithParam, DBMultiGetTestWithParam,
testing::Bool());

TEST_F(DBBasicTest, MultiGetBatchedSimpleUnsorted) {
do {
Expand Down Expand Up @@ -1773,8 +1773,8 @@ TEST_P(MultiGetPrefixExtractorTest, Batched) {
ASSERT_EQ(get_perf_context()->bloom_sst_hit_count, 4);
}

INSTANTIATE_TEST_SUITE_P(MultiGetPrefix, MultiGetPrefixExtractorTest,
::testing::Bool());
INSTANTIATE_TEST_CASE_P(MultiGetPrefix, MultiGetPrefixExtractorTest,
::testing::Bool());

#ifndef ROCKSDB_LITE
class DBMultiGetRowCacheTest : public DBBasicTest,
Expand Down Expand Up @@ -1865,8 +1865,8 @@ TEST_P(DBMultiGetRowCacheTest, MultiGetBatched) {
} while (ChangeCompactOptions());
}

INSTANTIATE_TEST_SUITE_P(DBMultiGetRowCacheTest, DBMultiGetRowCacheTest,
testing::Values(true, false));
INSTANTIATE_TEST_CASE_P(DBMultiGetRowCacheTest, DBMultiGetRowCacheTest,
testing::Values(true, false));

TEST_F(DBBasicTest, GetAllKeyVersions) {
Options options = CurrentOptions();
Expand Down Expand Up @@ -2630,16 +2630,16 @@ TEST_P(DBBasicTestWithParallelIO, MultiGetWithMissingFile) {
SyncPoint::GetInstance()->DisableProcessing();
}

INSTANTIATE_TEST_SUITE_P(
ParallelIO, DBBasicTestWithParallelIO,
// Params are as follows -
// Param 0 - Compressed cache enabled
// Param 1 - Uncompressed cache enabled
// Param 2 - Data compression enabled
// Param 3 - ReadOptions::fill_cache
// Param 4 - CompressionOptions::parallel_threads
::testing::Combine(::testing::Bool(), ::testing::Bool(), ::testing::Bool(),
::testing::Bool(), ::testing::Values(1, 4)));
INSTANTIATE_TEST_CASE_P(ParallelIO, DBBasicTestWithParallelIO,
// Params are as follows -
// Param 0 - Compressed cache enabled
// Param 1 - Uncompressed cache enabled
// Param 2 - Data compression enabled
// Param 3 - ReadOptions::fill_cache
// Param 4 - CompressionOptions::parallel_threads
::testing::Combine(::testing::Bool(), ::testing::Bool(),
::testing::Bool(), ::testing::Bool(),
::testing::Values(1, 4)));

// A test class for intercepting random reads and injecting artificial
// delays. Used for testing the deadline/timeout feature
Expand Down
29 changes: 16 additions & 13 deletions db/db_bloom_filter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -504,23 +504,23 @@ TEST_P(DBBloomFilterTestWithParam, BloomFilter) {
}

#ifndef ROCKSDB_VALGRIND_RUN
INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_CASE_P(
FormatDef, DBBloomFilterTestDefFormatVersion,
::testing::Values(
std::make_tuple(BFP::kDeprecatedBlock, false,
test::kDefaultFormatVersion),
std::make_tuple(BFP::kAuto, true, test::kDefaultFormatVersion),
std::make_tuple(BFP::kAuto, false, test::kDefaultFormatVersion)));

INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_CASE_P(
FormatDef, DBBloomFilterTestWithParam,
::testing::Values(
std::make_tuple(BFP::kDeprecatedBlock, false,
test::kDefaultFormatVersion),
std::make_tuple(BFP::kAuto, true, test::kDefaultFormatVersion),
std::make_tuple(BFP::kAuto, false, test::kDefaultFormatVersion)));

INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_CASE_P(
FormatLatest, DBBloomFilterTestWithParam,
::testing::Values(
std::make_tuple(BFP::kDeprecatedBlock, false,
Expand Down Expand Up @@ -1226,15 +1226,18 @@ TEST_P(DBBloomFilterTestVaryPrefixAndFormatVer, PartitionedMultiGet) {
EXPECT_TRUE(found_spanning >= 2);
}

INSTANTIATE_TEST_SUITE_P(
DBBloomFilterTestVaryPrefixAndFormatVer,
DBBloomFilterTestVaryPrefixAndFormatVer,
::testing::Values(
// (use_prefix, format_version)
std::make_tuple(false, 2), std::make_tuple(false, 3),
std::make_tuple(false, 4), std::make_tuple(false, 5),
std::make_tuple(true, 2), std::make_tuple(true, 3),
std::make_tuple(true, 4), std::make_tuple(true, 5)));
INSTANTIATE_TEST_CASE_P(DBBloomFilterTestVaryPrefixAndFormatVer,
DBBloomFilterTestVaryPrefixAndFormatVer,
::testing::Values(
// (use_prefix, format_version)
std::make_tuple(false, 2),
std::make_tuple(false, 3),
std::make_tuple(false, 4),
std::make_tuple(false, 5),
std::make_tuple(true, 2),
std::make_tuple(true, 3),
std::make_tuple(true, 4),
std::make_tuple(true, 5)));

#ifndef ROCKSDB_LITE
namespace {
Expand Down Expand Up @@ -1404,7 +1407,7 @@ TEST_P(BloomStatsTestWithParam, BloomStatsTestWithIter) {
ASSERT_EQ(expected_hits, get_perf_context()->bloom_sst_hit_count);
}

INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_CASE_P(
BloomStatsTestWithParam, BloomStatsTestWithParam,
::testing::Values(std::make_tuple(BFP::kDeprecatedBlock, false),
std::make_tuple(BFP::kLegacyBloom, false),
Expand Down
8 changes: 4 additions & 4 deletions db/db_compaction_filter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DBTestCompactionFilterWithCompactParam
};

#ifndef ROCKSDB_VALGRIND_RUN
INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_CASE_P(
CompactionFilterWithOption, DBTestCompactionFilterWithCompactParam,
::testing::Values(DBTestBase::OptionConfig::kDefault,
DBTestBase::OptionConfig::kUniversalCompaction,
Expand All @@ -55,9 +55,9 @@ INSTANTIATE_TEST_SUITE_P(
DBTestBase::OptionConfig::kUniversalSubcompactions));
#else
// Run fewer cases in valgrind
INSTANTIATE_TEST_SUITE_P(CompactionFilterWithOption,
DBTestCompactionFilterWithCompactParam,
::testing::Values(DBTestBase::OptionConfig::kDefault));
INSTANTIATE_TEST_CASE_P(CompactionFilterWithOption,
DBTestCompactionFilterWithCompactParam,
::testing::Values(DBTestBase::OptionConfig::kDefault));
#endif // ROCKSDB_VALGRIND_RUN

class KeepFilter : public CompactionFilter {
Expand Down
25 changes: 13 additions & 12 deletions db/db_compaction_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4690,11 +4690,11 @@ TEST_F(DBCompactionTest, CompactionLimiter) {
ASSERT_OK(dbfull()->TEST_WaitForCompact());
}

INSTANTIATE_TEST_SUITE_P(DBCompactionTestWithParam, DBCompactionTestWithParam,
testing::Values(std::make_tuple(1, true),
std::make_tuple(1, false),
std::make_tuple(4, true),
std::make_tuple(4, false)));
INSTANTIATE_TEST_CASE_P(DBCompactionTestWithParam, DBCompactionTestWithParam,
::testing::Values(std::make_tuple(1, true),
std::make_tuple(1, false),
std::make_tuple(4, true),
std::make_tuple(4, false)));

TEST_P(DBCompactionDirectIOTest, DirectIO) {
Options options = CurrentOptions();
Expand Down Expand Up @@ -4728,8 +4728,8 @@ TEST_P(DBCompactionDirectIOTest, DirectIO) {
delete options.env;
}

INSTANTIATE_TEST_SUITE_P(DBCompactionDirectIOTest, DBCompactionDirectIOTest,
testing::Bool());
INSTANTIATE_TEST_CASE_P(DBCompactionDirectIOTest, DBCompactionDirectIOTest,
testing::Bool());

class CompactionPriTest : public DBTestBase,
public testing::WithParamInterface<uint32_t> {
Expand Down Expand Up @@ -4774,11 +4774,12 @@ TEST_P(CompactionPriTest, Test) {
}
}

INSTANTIATE_TEST_SUITE_P(CompactionPriTest, CompactionPriTest,
testing::Values(CompactionPri::kByCompensatedSize,
CompactionPri::kOldestLargestSeqFirst,
CompactionPri::kOldestSmallestSeqFirst,
CompactionPri::kMinOverlappingRatio));
INSTANTIATE_TEST_CASE_P(
CompactionPriTest, CompactionPriTest,
::testing::Values(CompactionPri::kByCompensatedSize,
CompactionPri::kOldestLargestSeqFirst,
CompactionPri::kOldestSmallestSeqFirst,
CompactionPri::kMinOverlappingRatio));

class NoopMergeOperator : public MergeOperator {
public:
Expand Down
6 changes: 3 additions & 3 deletions db/db_flush_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -770,10 +770,10 @@ TEST_P(DBAtomicFlushTest, RollbackAfterFailToInstallResults) {
SyncPoint::GetInstance()->ClearAllCallBacks();
}

INSTANTIATE_TEST_SUITE_P(DBFlushDirectIOTest, DBFlushDirectIOTest,
testing::Bool());
INSTANTIATE_TEST_CASE_P(DBFlushDirectIOTest, DBFlushDirectIOTest,
testing::Bool());

INSTANTIATE_TEST_SUITE_P(DBAtomicFlushTest, DBAtomicFlushTest, testing::Bool());
INSTANTIATE_TEST_CASE_P(DBAtomicFlushTest, DBAtomicFlushTest, testing::Bool());

} // namespace ROCKSDB_NAMESPACE

Expand Down
4 changes: 2 additions & 2 deletions db/db_iterator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2881,8 +2881,8 @@ TEST_P(DBIteratorTest, IterateWithLowerBoundAcrossFileBoundary) {
ASSERT_OK(iter->status());
}

INSTANTIATE_TEST_SUITE_P(DBIteratorTestInstance, DBIteratorTest,
testing::Values(true, false));
INSTANTIATE_TEST_CASE_P(DBIteratorTestInstance, DBIteratorTest,
testing::Values(true, false));

// Tests how DBIter work with ReadCallback
class DBIteratorWithReadCallbackTest : public DBIteratorTest {};
Expand Down
6 changes: 3 additions & 3 deletions db/db_merge_operator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ class MergeOperatorPinningTest : public DBMergeOperatorTest,
bool disable_block_cache_;
};

INSTANTIATE_TEST_SUITE_P(MergeOperatorPinningTest, MergeOperatorPinningTest,
::testing::Bool());
INSTANTIATE_TEST_CASE_P(MergeOperatorPinningTest, MergeOperatorPinningTest,
::testing::Bool());

#ifndef ROCKSDB_LITE
TEST_P(MergeOperatorPinningTest, OperandsMultiBlocks) {
Expand Down Expand Up @@ -588,7 +588,7 @@ class PerConfigMergeOperatorPinningTest
bool disable_block_cache_;
};

INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_CASE_P(
MergeOperatorPinningTest, PerConfigMergeOperatorPinningTest,
::testing::Combine(::testing::Bool(),
::testing::Range(static_cast<int>(DBTestBase::kDefault),
Expand Down
6 changes: 3 additions & 3 deletions db/db_sst_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,9 @@ TEST_P(DBWALTestWithParam, WALTrashCleanupOnOpen) {
Close();
}

INSTANTIATE_TEST_SUITE_P(DBWALTestWithParam, DBWALTestWithParam,
::testing::Values(std::make_tuple("", true),
std::make_tuple("_wal_dir", false)));
INSTANTIATE_TEST_CASE_P(DBWALTestWithParam, DBWALTestWithParam,
::testing::Values(std::make_tuple("", true),
std::make_tuple("_wal_dir", false)));

TEST_F(DBSSTTest, OpenDBWithExistingTrash) {
Options options = CurrentOptions();
Expand Down
10 changes: 7 additions & 3 deletions db/db_table_properties_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,13 @@ TEST_P(DBTablePropertiesTest, DeletionTriggeredCompactionMarking) {
ASSERT_EQ(1, NumTableFilesAtLevel(0));
}

INSTANTIATE_TEST_SUITE_P(DBTablePropertiesTest, DBTablePropertiesTest,
::testing::Values("kCompactionStyleLevel",
"kCompactionStyleUniversal"));
INSTANTIATE_TEST_CASE_P(
DBTablePropertiesTest,
DBTablePropertiesTest,
::testing::Values(
"kCompactionStyleLevel",
"kCompactionStyleUniversal"
));

} // namespace ROCKSDB_NAMESPACE

Expand Down
Loading

0 comments on commit afa3518

Please sign in to comment.