Running gas tests only on tests having expectations.

This commit is contained in:
Djordje Mijovic 2021-01-29 10:40:03 +01:00
parent 6d51dfb617
commit 5ea97a5d43

View File

@ -324,10 +324,12 @@ bool SemanticTest::checkGasCostExpectation(TestFunctionCall& io_test, bool _comp
string setting =
(_compileViaYul ? "ir"s : "legacy"s) +
(m_optimiserSettings == OptimiserSettings::full() ? "Optimized" : "");
if (io_test.call().expectations.gasUsed.count(setting) == 0)
return true;
io_test.setGasCost(setting, m_gasUsed);
return
io_test.call().expectations.gasUsed.count(setting) > 0 &&
m_gasUsed == io_test.call().expectations.gasUsed.at(setting);
return m_gasUsed == io_test.call().expectations.gasUsed.at(setting);
}
void SemanticTest::printSource(ostream& _stream, string const& _linePrefix, bool _formatted) const