Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm_gtest.h
Go to the documentation of this file.
1#pragma once
2#if defined(__clang__)
3#pragma clang diagnostic push
4#pragma clang diagnostic ignored "-Wundef"
5#elif defined(__GNUC__)
6#pragma GCC diagnostic push
7#if __GNUC__ > 8
8
9#endif
10#endif
11
12#include "gtest/gtest.h"
13
14#if defined(__clang__)
15#pragma clang diagnostic pop
16#elif defined(__GNUC__)
17#pragma GCC diagnostic pop
18#endif
19
20#include <boost/optional/optional_io.hpp>
21
25
26#define STORM_SILENT_ASSERT_THROW(statement, expected_exception) \
27 storm::test::disableOutput(); \
28 ASSERT_THROW(statement, expected_exception); \
29 storm::test::enableErrorOutput()
30
31#define STORM_SILENT_EXPECT_THROW(statement, expected_exception) \
32 storm::test::disableOutput(); \
33 EXPECT_THROW(statement, expected_exception); \
34 storm::test::enableErrorOutput()
35
36namespace testing {
37namespace internal {
38
39GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1, const char* expr2, const char* abs_error_expr, storm::RationalNumber val1,
40 storm::RationalNumber val2, storm::RationalNumber abs_error);
41} // namespace internal
42} // namespace testing
43
44namespace storm {
45namespace test {
46extern bool noGurobi;
47
48void initialize(int* argc, char** argv);
49
50inline void enableErrorOutput() {
51 // Only decrease the log level
52 if (storm::utility::getLogLevel() > l3pp::LogLevel::ERR) {
53 storm::utility::setLogLevel(l3pp::LogLevel::ERR);
54 }
55}
56
57inline void disableOutput() {
58 storm::utility::setLogLevel(l3pp::LogLevel::OFF);
59}
60
61// Check for valid Gurobi license
63
64// Some tests have to be skipped for specific z3 versions because of a bug that was present in z3.
65#ifdef STORM_HAVE_Z3
66bool z3AtLeastVersion(unsigned expectedMajor, unsigned expectedMinor, unsigned expectedBuildNumber);
67#endif
68} // namespace test
69} // namespace storm
bool testGurobiLicense()
void disableOutput()
Definition storm_gtest.h:57
void enableErrorOutput()
Definition storm_gtest.h:50
void initialize(int *argc, char **argv)
void setLogLevel(l3pp::LogLevel level)
Set the global log level.
l3pp::LogLevel getLogLevel()
Gets the global log level.
GTEST_API_ AssertionResult DoubleNearPredFormat(const char *expr1, const char *expr2, const char *abs_error_expr, storm::RationalNumber val1, storm::RationalNumber val2, storm::RationalNumber abs_error)