Commit 3b3c7d92 authored by Piotr Tworek's avatar Piotr Tworek Committed by V8 LUCI CQ

Fix v8 unittests broken on official builds by recent crash logging changes

Commit 26d85ace "Use IMMEDIATE_CRASH on
official build FATAL errors." has changed how FATAL macro behaves on
such builds. Unfortunately this affects logging and
random number generator v8 unittests which use ASSERT_DEATH_IF_SUPPORTED
macro. After the change we no longer get any v8 CHECK crash messages on
official builds thus failing those tests.

Fix this by adjusting failing test expectations to reflect the new,
expected results v8 now has on official builds.

Change-Id: Ice9718c5e887b42a0cfd583340256f7d2591add4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2991238Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75547}
parent 22bee2c9
......@@ -85,20 +85,26 @@ std::string SanitizeRegexp(std::string msg) {
return msg;
}
std::string FailureMessage(const char* msg, const char* lhs, const char* rhs) {
#ifdef DEBUG
return SanitizeRegexp(
std::string{msg}.append(" (").append(lhs).append(" vs. ").append(rhs));
#elif defined(OFFICIAL_BUILD)
std::string FailureMessage(std::string msg) {
#if !defined(DEBUG) && defined(OFFICIAL_BUILD)
// Official release builds strip all fatal messages for saving binary size,
// see src/base/logging.h.
USE(SanitizeRegexp);
return "ignored";
return "";
#else
return SanitizeRegexp(msg);
#endif
}
std::string FailureMessage(const char* msg, const char* lhs, const char* rhs) {
#ifdef DEBUG
return SanitizeRegexp(
std::string{msg}.append(" (").append(lhs).append(" vs. ").append(rhs));
#else
return FailureMessage(msg);
#endif
}
std::string LongFailureMessage(const char* msg, const char* lhs,
const char* rhs) {
#ifdef DEBUG
......@@ -273,7 +279,8 @@ TEST(LoggingDeathTest, OutputLongValues) {
}
TEST(LoggingDeathTest, FatalKills) {
ASSERT_DEATH_IF_SUPPORTED(FATAL("Dread pirate"), "Dread pirate");
ASSERT_DEATH_IF_SUPPORTED(FATAL("Dread pirate"),
FailureMessage("Dread pirate"));
}
TEST(LoggingDeathTest, DcheckIsOnlyFatalInDebug) {
......
......@@ -77,7 +77,7 @@ TEST_P(RandomNumberGeneratorTest, NextDoubleReturnsValueBetween0And1) {
#if !defined(DEBUG) && defined(OFFICIAL_BUILD)
// Official release builds strip all fatal messages for saving binary size,
// see src/base/logging.h.
#define FATAL_MSG(msg) "ignored"
#define FATAL_MSG(msg) ""
#else
#define FATAL_MSG(msg) "Check failed: " msg
#endif
......
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