remove obsolete unittest code specific to handling the case of lammps exceptions disabled

This commit is contained in:
Axel Kohlmeyer
2023-04-16 12:34:47 -04:00
parent 98efb19e79
commit 5f4a80d41f
23 changed files with 14 additions and 89 deletions

View File

@ -32,21 +32,12 @@ using LAMMPS_NS::LAMMPSException;
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, ContainsRegex(errmsg)); \
} else { \
if (LAMMPS_NS::platform::mpi_vendor() != "Open MPI") { \
::testing::internal::CaptureStdout(); \
ASSERT_DEATH({__VA_ARGS__}, ""); \
auto mesg = ::testing::internal::GetCapturedStdout(); \
ASSERT_THAT(mesg, ContainsRegex(errmsg)); \
} else { \
std::cerr << "[ ] [ INFO ] Skipping death test (no exception support) \n"; \
} \
#define TEST_FAILURE(errmsg, ...) \
{ \
::testing::internal::CaptureStdout(); \
ASSERT_ANY_THROW({__VA_ARGS__}); \
auto mesg = ::testing::internal::GetCapturedStdout(); \
ASSERT_THAT(mesg, ContainsRegex(errmsg)); \
}
// whether to print verbose output (i.e. not capturing LAMMPS screen output).