2 #ifndef LIBMESH_LIBMESH_CPPUNIT_H 3 #define LIBMESH_LIBMESH_CPPUNIT_H 6 #include <libmesh/ignore_warnings.h> 7 #include <cppunit/extensions/HelperMacros.h> 8 #include <cppunit/TestCase.h> 9 #include <libmesh/restore_warnings.h> 11 #include <libmesh/libmesh_logging.h> 13 #if defined(LIBMESH_DEFAULT_QUADRUPLE_PRECISION) || \ 14 defined(LIBMESH_DEFAULT_TRIPLE_PRECISION) 15 # define LIBMESH_ASSERT_FP_EQUAL(expected,actual,tolerance) \ 16 CPPUNIT_ASSERT_DOUBLES_EQUAL(double((expected)-(actual)),0,double(tolerance)) 18 # define LIBMESH_ASSERT_FP_EQUAL(expected,actual,tolerance) \ 19 CPPUNIT_ASSERT_DOUBLES_EQUAL(expected,actual,tolerance) 22 #ifdef LIBMESH_USE_COMPLEX_NUMBERS 23 # define LIBMESH_ASSERT_NUMBERS_EQUAL(expected,actual,tolerance) \ 25 LIBMESH_ASSERT_FP_EQUAL(libMesh::libmesh_real(expected),libMesh::libmesh_real(actual),tolerance); \ 26 LIBMESH_ASSERT_FP_EQUAL(libMesh::libmesh_imag(expected),libMesh::libmesh_imag(actual),tolerance); \ 29 # define LIBMESH_ASSERT_NUMBERS_EQUAL(expected,actual,tolerance) \ 30 LIBMESH_ASSERT_FP_EQUAL(expected,actual,tolerance) 34 #define LIBMESH_ASSERT_REALVEC_EQUAL(expected,actual,tolerance) \ 36 VectorValue<Real> expected_vec{expected}; \ 37 VectorValue<Real> actual_vec{actual}; \ 38 for (int realvec_d=0; realvec_d != LIBMESH_DIM; ++realvec_d) \ 39 LIBMESH_ASSERT_FP_EQUAL(expected_vec(realvec_d), actual_vec(realvec_d), tolerance); \ 50 #include <libmesh/ignore_warnings.h> 52 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 54 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__) 55 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ > 5) 56 #pragma GCC diagnostic push 57 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 59 #endif // __GNUC__ && !__INTEL_COMPILER 93 #define LIBMESH_CPPUNIT_TEST_SUITE(ATestFixtureType) \ 95 std::string libmesh_suite_name = #ATestFixtureType; \ 96 CPPUNIT_TEST_SUITE(ATestFixtureType) 99 #define LOG_UNIT_TEST UnitPerfItem TOKENPASTE2(perf_item_, __LINE__)(__func__,this->libmesh_suite_name,*unitlog) 102 #endif // LIBMESH_LIBMESH_CPPUNIT_H
void pop(const char *label, const char *header="")
Pop the event label off the stack, resuming any lower event.
libMesh::PerfLog * unitlog
UnitPerfItem(std::string label, std::string header, libMesh::PerfLog &my_perflog)
libMesh::PerfLog & _perflog
The PerfLog class allows monitoring of specific events.
const std::string _header
void push(const char *label, const char *header="")
Push the event label onto the stack, pausing any active event.