Browse Source

tests: Print STORM_LOG_ERRORs

tempestpy_adaptions
Tim Quatmann 5 years ago
parent
commit
8bb9ad3b64
  1. 27
      src/test/storm_gtest.h

27
src/test/storm_gtest.h

@ -32,20 +32,31 @@ namespace storm {
namespace test { namespace test {
inline void initialize() { inline void initialize() {
storm::utility::initializeLogger(); storm::utility::initializeLogger();
// Only enable error output by default.
storm::utility::setLogLevel(l3pp::LogLevel::ERR);
} }
inline void enableLogOutput(bool const& value = true) {
storm::utility::setLogLevel(value ? l3pp::LogLevel::WARN : l3pp::LogLevel::OFF);
inline void enableErrorOutput() {
// Only decrease the log level
if (storm::utility::getLogLevel() > l3pp::LogLevel::ERR) {
storm::utility::setLogLevel(l3pp::LogLevel::ERR);
}
}
inline void disableOutput() {
storm::utility::setLogLevel(l3pp::LogLevel::OFF);
} }
} }
} }
#define STORM_SILENT_ASSERT_THROW(statement, expected_exception) \
storm::test::disableOutput(); \
ASSERT_THROW(statement, expected_exception); \
storm::test::enableErrorOutput()
#define STORM_SILENT_EXPECT_THROW(statement, expected_exception) \ #define STORM_SILENT_EXPECT_THROW(statement, expected_exception) \
storm::test::enableLogOutput(false); \
storm::test::disableOutput(); \
EXPECT_THROW(statement, expected_exception); \ EXPECT_THROW(statement, expected_exception); \
storm::test::enableLogOutput(true)
storm::test::enableErrorOutput()
#define STORM_SILENT_ASSERT_THROW(statement, expected_exception) \
storm::test::enableLogOutput(false); \
ASSERT_THROW(statement, expected_exception); \
storm::test::enableLogOutput(true)
Loading…
Cancel
Save