MCPcopy Create free account
hub / github.com/argotorg/solidity / run

Method run

test/libsolidity/ASTJSONTest.cpp:195–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195TestCase::TestResult ASTJSONTest::run(std::ostream& _stream, std::string const& _linePrefix, bool const _formatted)
196{
197 CompilerStack c;
198
199 StringMap sources;
200 std::map<std::string, unsigned> sourceIndices;
201 for (size_t i = 0; i < m_sources.size(); i++)
202 {
203 sources[m_sources[i].first] = m_sources[i].second;
204 sourceIndices[m_sources[i].first] = static_cast<unsigned>(i + 1);
205 }
206
207 bool resultsMatch = true;
208
209 for (TestVariant& variant: m_variants)
210 {
211 c.reset();
212 c.setSources(sources);
213 c.setEVMVersion(solidity::test::CommonOptions::get().evmVersion());
214
215 if (!c.parseAndAnalyze(variant.stopAfter))
216 {
217 if (!m_expectedFailAfter.has_value() || m_expectedFailAfter.value() + 1 != c.state())
218 {
219 SourceReferenceFormatter formatter(_stream, c, _formatted, false);
220 formatter.printErrorInformation(c.errors());
221 return TestResult::FatalError;
222 }
223 }
224
225 resultsMatch = resultsMatch && runTest(
226 variant,
227 sourceIndices,
228 c,
229 _stream,
230 _linePrefix,
231 _formatted
232 );
233 }
234
235 return resultsMatch ? TestResult::Success : TestResult::Failure;
236}
237
238bool ASTJSONTest::runTest(
239 TestVariant& _variant,

Callers

nothing calls this directly

Calls 10

getFunction · 0.85
setSourcesMethod · 0.80
setEVMVersionMethod · 0.80
printErrorInformationMethod · 0.80
sizeMethod · 0.45
resetMethod · 0.45
evmVersionMethod · 0.45
parseAndAnalyzeMethod · 0.45
valueMethod · 0.45
stateMethod · 0.45

Tested by

no test coverage detected