On Windows the Regex matcher for '.' does not match '\n'
Thus we have to use ContainsRegex instead of MatchesRegex
This commit is contained in:
@ -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"; \
|
||||
} \
|
||||
|
||||
Reference in New Issue
Block a user