sapling/eden/fs/store/test/RocksDbLocalStoreTest.cpp
Anna Kukliansky 8da39ce0ae supress deprecated error for INSTANTIATE_TEST_CASE_P
Summary:
suppress the deprecated errors.
found something similar in here: https://stackoverflow.com/questions/1902021/suppressing-is-deprecated-when-using-respondstoselector

example failure:
https://www.internalfb.com/intern/buck/build/a3b550b8-4099-4f27-8975-5bfffd6447e5/

```
eden/fs/inodes/test/OverlayTest.cpp:730:1: error:
'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Werror,-Wdeprecated-declarations]
INSTANTIATE_TEST_CASE_P(
/Users/kuki/fbsource/third-party/googletest/googletest/include/gtest/gtest-param-test.h:507:38:
 note:  expanded from macro 'INSTANTIATE_TEST_CASE_P'
  static_assert(::testing::internal::InstantiateTestCase_P_IsDeprecated(), \
/Users/kuki/fbsource/third-party/googletest/googletest/include/gtest/internal/gtest-internal.h:1209:1:  note: 'InstantiateTestCase_P_IsDeprecated' has been explicitly marked deprecated here
GTEST_INTERNAL_DEPRECATED(
/Users/kuki/fbsource/third-party/googletest/googletest/include/gtest/internal/gtest-port.h:2215:59:
note: expanded from macro 'GTEST_INTERNAL_DEPRECATED'
#define GTEST_INTERNAL_DEPRECATED(message) __attribute__((deprecated(message)))
```

Reviewed By: mzlee

Differential Revision: D27037957

fbshipit-source-id: b12cc500441c9ed4ed72825475c57047fb0c2076
2021-03-15 15:29:12 -07:00

34 lines
942 B
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#include "eden/fs/store/RocksDbLocalStore.h"
#include "eden/fs/store/test/LocalStoreTest.h"
#include "eden/fs/telemetry/NullStructuredLogger.h"
namespace {
using namespace facebook::eden;
LocalStoreImplResult makeRocksDbLocalStore(FaultInjector* faultInjector) {
auto tempDir = makeTempDir();
auto store = std::make_unique<RocksDbLocalStore>(
AbsolutePathPiece{tempDir.path().string()},
std::make_shared<NullStructuredLogger>(),
faultInjector);
return {std::move(tempDir), std::move(store)};
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
INSTANTIATE_TEST_CASE_P(
RocksDB,
LocalStoreTest,
::testing::Values(makeRocksDbLocalStore));
#pragma clang diagnostic pop
} // namespace