On Windows the Regex matcher for '.' does not match '\n'

Thus we have to use ContainsRegex instead of MatchesRegex
This commit is contained in:
Axel Kohlmeyer
2022-01-29 16:35:30 -05:00
parent d62e25decc
commit 845ab2dd71
13 changed files with 52 additions and 57 deletions

View File

@ -28,20 +28,20 @@
using namespace LAMMPS_NS;
using ::testing::MatchesRegex;
using ::testing::ContainsRegex;
#define TEST_FAILURE(errmsg, ...) \
if (Info::has_exceptions()) { \
::testing::internal::CaptureStdout(); \
ASSERT_ANY_THROW({__VA_ARGS__}); \
auto mesg = ::testing::internal::GetCapturedStdout(); \
ASSERT_THAT(mesg, MatchesRegex(errmsg)); \
ASSERT_THAT(mesg, ContainsRegex(errmsg)); \
} else { \
if (platform::mpi_vendor() != "Open MPI") { \
::testing::internal::CaptureStdout(); \
ASSERT_DEATH({__VA_ARGS__}, ""); \
auto mesg = ::testing::internal::GetCapturedStdout(); \
ASSERT_THAT(mesg, MatchesRegex(errmsg)); \
ASSERT_THAT(mesg, ContainsRegex(errmsg)); \
} else { \
std::cerr << "[ ] [ INFO ] Skipping death test (no exception support) \n"; \
} \