Commit e1334196 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Support DCHECK-death-tests in official builds too

This is required by win-asan which has the following GN config:
dcheck_is_configurable = true
is_chrome_branded = true
is_debug = false
is_official_build = true
target_cpu = "x86"

R=thakis@chromium.org

Bug: 1057995
Change-Id: I337e214f2194d3533ea329c22fd240dddae50e5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090136
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748849}
parent f477ad52
......@@ -27,8 +27,15 @@
// is part of the error message), but intentionally do not expose the gtest
// death test's full |regex| parameter to avoid users having to verify the exact
// syntax of the error message produced by the DCHECK.
// Official builds will eat stream parameters, so don't check the error message.
#if defined(OFFICIAL_BUILD) && defined(NDEBUG)
#define EXPECT_DCHECK_DEATH(statement) EXPECT_DEATH(statement, "")
#define ASSERT_DCHECK_DEATH(statement) ASSERT_DEATH(statement, "")
#else
#define EXPECT_DCHECK_DEATH(statement) EXPECT_DEATH(statement, "Check failed")
#define ASSERT_DCHECK_DEATH(statement) ASSERT_DEATH(statement, "Check failed")
#endif // defined(OFFICIAL_BUILD) && defined(NDEBUG)
#else
// DCHECK_IS_ON() && defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID)
......@@ -44,7 +51,7 @@
// As above, but for CHECK().
#if defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID)
// Official builds will CHECK, but also eat stream parameters. So match "".
// Official builds will eat stream parameters, so don't check the error message.
#if defined(OFFICIAL_BUILD) && defined(NDEBUG)
#define EXPECT_CHECK_DEATH(statement) EXPECT_DEATH(statement, "")
#define ASSERT_CHECK_DEATH(statement) ASSERT_DEATH(statement, "")
......
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