Index: sandbox/linux/tests/unit_tests.h |
diff --git a/sandbox/linux/tests/unit_tests.h b/sandbox/linux/tests/unit_tests.h |
index 3f6092e1443e8ad5b76164cea9faaa1f985c6119..0cb682b0615731fcea69f5b201e7639a896e94a8 100644 |
--- a/sandbox/linux/tests/unit_tests.h |
+++ b/sandbox/linux/tests/unit_tests.h |
@@ -40,6 +40,8 @@ bool IsRunningOnValgrind(); |
// gtests's ASSERT_XXX() macros instead of SANDBOX_ASSERT(). See |
// unit_tests.cc for examples. |
#define DEATH_SUCCESS() sandbox::UnitTests::DeathSuccess, NULL |
+#define DEATH_SUCCESS_ALLOW_NOISE() \ |
+ sandbox::UnitTests::DeathSuccessAllowNoise, NULL |
#define DEATH_MESSAGE(msg) \ |
sandbox::UnitTests::DeathMessage, \ |
static_cast<const void*>(static_cast<const char*>(msg)) |
@@ -68,6 +70,11 @@ bool IsRunningOnValgrind(); |
#define SANDBOX_TEST(test_case_name, test_name) \ |
SANDBOX_DEATH_TEST(test_case_name, test_name, DEATH_SUCCESS()) |
+// SANDBOX_TEST_ALLOW_NOISE is just like SANDBOX_TEST, except it does not |
+// consider log error messages printed by the test to be test failures. |
+#define SANDBOX_TEST_ALLOW_NOISE(test_case_name, test_name) \ |
+ SANDBOX_DEATH_TEST(test_case_name, test_name, DEATH_SUCCESS_ALLOW_NOISE()) |
+ |
// Simple assertion macro that is compatible with running inside of a death |
// test. We unfortunately cannot use any of the GTest macros. |
#define SANDBOX_STR(x) #x |
@@ -109,6 +116,12 @@ class UnitTests { |
// of this DeathCheck is unused (and thus unnamed) |
static void DeathSuccess(int status, const std::string& msg, const void*); |
+ // A DeathCheck method that verifies that the test completed succcessfully |
+ // allowing for log error messages. |
+ static void DeathSuccessAllowNoise(int status, |
+ const std::string& msg, |
+ const void*); |
+ |
// A DeathCheck method that verifies that the test completed with error |
// code "1" and printed a message containing a particular substring. The |
// "aux" pointer should point to a C-string containing the expected error |