| 159 | } |
| 160 | |
| 161 | void ASTJSONTest::validateTestConfiguration() const |
| 162 | { |
| 163 | if (m_variants.empty()) |
| 164 | BOOST_THROW_EXCEPTION(std::runtime_error("No file with expected result found.")); |
| 165 | |
| 166 | if (m_expectedFailAfter.has_value()) |
| 167 | { |
| 168 | auto unexpectedTestVariant = std::find_if( |
| 169 | m_variants.begin(), m_variants.end(), |
| 170 | [failAfter = m_expectedFailAfter](TestVariant v) { return v.stopAfter > failAfter; } |
| 171 | ); |
| 172 | |
| 173 | if (unexpectedTestVariant != m_variants.end()) |
| 174 | BOOST_THROW_EXCEPTION( |
| 175 | std::runtime_error( |
| 176 | std::string("Unexpected JSON file: ") + unexpectedTestVariant->astFilename() + |
| 177 | " in \"failAfter: " + |
| 178 | compilerStateToString(m_expectedFailAfter.value()) + "\" scenario." |
| 179 | ) |
| 180 | ); |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | ASTJSONTest::ASTJSONTest(std::string const& _filename): |
| 185 | EVMVersionRestrictedTestCase(_filename) |
nothing calls this directly
no test coverage detected