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) 41 #include <libmesh/ignore_warnings.h> 43 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 45 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__) 46 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ > 5) 47 #pragma GCC diagnostic push 48 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 50 #endif // __GNUC__ && !__INTEL_COMPILER 84 #define LIBMESH_CPPUNIT_TEST_SUITE(ATestFixtureType) \ 86 std::string libmesh_suite_name = #ATestFixtureType; \ 87 CPPUNIT_TEST_SUITE(ATestFixtureType) 90 #define LOG_UNIT_TEST UnitPerfItem TOKENPASTE2(perf_item_, __LINE__)(__func__,this->libmesh_suite_name,*unitlog) 93 #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.