Error class for failures during test execution. */
| 78 | |
| 79 | /** Error class for failures during test execution. */ |
| 80 | class TestError : public std::runtime_error |
| 81 | { |
| 82 | public: |
| 83 | using std::runtime_error::runtime_error; |
| 84 | |
| 85 | /** Construct error with severity. |
| 86 | * |
| 87 | * @param[in] msg Error message. |
| 88 | * @param[in] level Severity level. |
| 89 | * @param[in] context Context. |
| 90 | */ |
| 91 | TestError(const std::string &msg, LogLevel level, std::string context = ""); |
| 92 | |
| 93 | /** Severity of the error. |
| 94 | * |
| 95 | * @return Severity. |
| 96 | */ |
| 97 | LogLevel level() const; |
| 98 | |
| 99 | /** Get the error message. |
| 100 | * |
| 101 | * @return error message. |
| 102 | */ |
| 103 | const char *what() const noexcept override; |
| 104 | |
| 105 | private: |
| 106 | LogLevel _level{LogLevel::ERRORS}; |
| 107 | std::string _msg{}; |
| 108 | std::string _context{}; |
| 109 | std::string _combined{}; |
| 110 | }; |
| 111 | } // namespace framework |
| 112 | } // namespace test |
| 113 | } // namespace arm_compute |