summaryrefslogtreecommitdiff
path: root/src/mongo/unittest/death_test.cpp
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2020-02-24 19:34:40 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-25 01:03:52 +0000
commit60f8edf788f75ac1a32bf702aae882b409767448 (patch)
tree8349abc7fce731c8f85e5ac2ed6894e900ba1763 /src/mongo/unittest/death_test.cpp
parent383d7183532929620cf31d7f89a0a37daaea8b8e (diff)
downloadmongo-60f8edf788f75ac1a32bf702aae882b409767448.tar.gz
SERVER-46219 Unit Tests should log with json
Diffstat (limited to 'src/mongo/unittest/death_test.cpp')
-rw-r--r--src/mongo/unittest/death_test.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/unittest/death_test.cpp b/src/mongo/unittest/death_test.cpp
index b584ec78591..c15055e1cf5 100644
--- a/src/mongo/unittest/death_test.cpp
+++ b/src/mongo/unittest/death_test.cpp
@@ -102,9 +102,12 @@ void DeathTestBase::_doTest() {
}
}
if (WIFSIGNALED(stat) || (WIFEXITED(stat) && WEXITSTATUS(stat) != 0)) {
- // Exited with a signal or non-zero code. Should check the pattern, here,
- // but haven't figured out how, so just return.
- ASSERT_STRING_CONTAINS(os.str(), _doGetPattern());
+ // Exited with a signal or non-zero code. Validate the expected message.
+ if (_isRegex()) {
+ ASSERT_STRING_SEARCH_REGEX(os.str(), _doGetPattern());
+ } else {
+ ASSERT_STRING_CONTAINS(os.str(), _doGetPattern());
+ }
return;
} else {
invariant(!WIFSTOPPED(stat));