Commit 1bc5dd9d authored by Robert Quitt's avatar Robert Quitt Committed by Facebook GitHub Bot

Clean up old googletest conditional compilations

Summary:
Remove all the conditional compilations that were used for the googletest upgrade. We're set on Googletest 1.10.x now, so no need to keep the old code lying around.

TODO in the future, is to deprecate some of the other fb-only patches, and to switch over fbcode to use fbsource/third-party

Reviewed By: yfeldblum, igorsugak

Differential Revision: D28860854

fbshipit-source-id: 8ffbaf860fca8897f6691218bc0154723ec954d4
parent 59d01631
......@@ -32,40 +32,7 @@
* Note that you cannot use ASSERT macros in coro tests. See below for
* CO_ASSERT_*.
*/
#define CO_TEST_MASTER_(test_case_name, test_name, parent_class, parent_id) \
class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
: public parent_class { \
public: \
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
\
private: \
void TestBody() override; \
folly::coro::Task<void> co_TestBody(); \
static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_; \
GTEST_DISALLOW_COPY_AND_ASSIGN_( \
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
}; \
\
::testing::TestInfo* const GTEST_TEST_CLASS_NAME_( \
test_case_name, test_name)::test_info_ = \
::testing::internal::MakeAndRegisterTestInfo( \
GTEST_STRINGIFY_TOKEN_(test_case_name), \
GTEST_STRINGIFY_TOKEN_(test_name), \
NULL, \
NULL, \
::testing::internal::CodeLocation(__FILE__, __LINE__), \
(parent_id), \
parent_class::SetUpTestCase, \
parent_class::TearDownTestCase, \
new ::testing::internal::TestFactoryImpl<GTEST_TEST_CLASS_NAME_( \
test_case_name, test_name)>); \
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() { \
folly::coro::blockingWait(co_TestBody()); \
} \
folly::coro::Task<void> GTEST_TEST_CLASS_NAME_( \
test_case_name, test_name)::co_TestBody()
#define CO_TEST_20201023_(test_suite_name, test_name, parent_class, parent_id) \
#define CO_TEST_(test_suite_name, test_name, parent_class, parent_id) \
static_assert( \
sizeof(GTEST_STRINGIFY_(test_suite_name)) > 1, \
"test_suite_name must not be empty"); \
......@@ -108,12 +75,6 @@
folly::coro::Task<void> GTEST_TEST_CLASS_NAME_( \
test_suite_name, test_name)::co_TestBody()
#if defined(TYPED_TEST_SUITE)
#define CO_TEST_ CO_TEST_20201023_
#else
#define CO_TEST_ CO_TEST_MASTER_
#endif
/**
* TEST() for coro tests.
*/
......
......@@ -24,21 +24,13 @@ namespace folly {
namespace detail {
template <typename T>
class JsonEqMatcher : public ::testing::MatcherInterface<T> {
private:
#if defined(MOCK_METHOD)
using Arg = T;
#else
// TODO(sugak): T69712535 remove deprecated googletest API.
using Arg = T const&;
#endif
public:
explicit JsonEqMatcher(std::string expected, std::string prefixBeforeJson)
: expected_(std::move(expected)),
prefixBeforeJson_(std::move(prefixBeforeJson)) {}
virtual bool MatchAndExplain(
Arg actual, ::testing::MatchResultListener* /*listener*/) const override {
T actual, ::testing::MatchResultListener* /*listener*/) const override {
StringPiece sp{actual};
if (!sp.startsWith(prefixBeforeJson_)) {
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment