Commit 846587f4 authored by Chad Austin's avatar Chad Austin Committed by Facebook Github Bot

Revert D15073229: [folly] detect at runtime whether SKIP should fail

Differential Revision:
D15073229

Original commit changeset: 417a1f4e42d0

fbshipit-source-id: 689b010627482e9a05f3dd34e89baae485875025
parent e8c7b488
...@@ -45,20 +45,17 @@ ...@@ -45,20 +45,17 @@
// the test due to runtime issues or behavior that do not necessarily indicate // the test due to runtime issues or behavior that do not necessarily indicate
// a problem with the code. // a problem with the code.
// //
// googletest does not have a built-in mechanism to report tests as // googletest does not have a built-in mechanism to report tests as skipped a
// skipped a run time. We either report the test as successful or // run time. We either report the test as successful or failure based on the
// failure based on whether the TEST_PILOT environment variable is // FOLLY_SKIP_AS_FAILURE configuration setting. The default is to report the
// set. The default is to report the test as successful. Enabling // test as successful. Enabling FOLLY_SKIP_AS_FAILURE can be useful with a
// FOLLY_SKIP_AS_FAILURE can be useful with a test harness that can // test harness that can identify the "Test skipped by client" in the failure
// identify the "Test skipped by client" in the failure message and // message and convert this into a skipped test result.
// convert this into a skipped test result. #if FOLLY_SKIP_AS_FAILURE
#define SKIP() \ #define SKIP() GTEST_FATAL_FAILURE_("Test skipped by client")
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ #else
return GTEST_MESSAGE_( \ #define SKIP() return GTEST_SUCCESS_("Test skipped by client")
"Test skipped by client", \ #endif
::folly::test::detail::skipIsFailure() \
? ::testing::TestPartResult::kFatalFailure \
: ::testing::TestPartResult::kSuccess)
// Encapsulate conditional-skip, since it's nontrivial to get right. // Encapsulate conditional-skip, since it's nontrivial to get right.
#define SKIP_IF(expr) \ #define SKIP_IF(expr) \
...@@ -146,11 +143,6 @@ AreWithinSecs(T1 val1, T2 val2, std::chrono::seconds acceptableDeltaSecs) { ...@@ -146,11 +143,6 @@ AreWithinSecs(T1 val1, T2 val2, std::chrono::seconds acceptableDeltaSecs) {
namespace detail { namespace detail {
inline bool skipIsFailure() {
const char* p = getenv("FOLLY_SKIP_AS_FAILURE");
return p && *p;
}
/** /**
* Helper class for implementing test macros * Helper class for implementing test macros
*/ */
......
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