Skip to content

Commit

Permalink
Merge pull request #15666 from ipsilon/eof-enable-eof-testing
Browse files Browse the repository at this point in the history
eof: Enable compilation to EOF for all `EVMVersionRestrictedTestCase` tests by default
  • Loading branch information
cameel authored Feb 3, 2025
2 parents afaed2b + 0555618 commit eb3b721
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/TestCase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void EVMVersionRestrictedTestCase::processBytecodeFormatSetting()
// EOF only available since Prague
solAssert(!eofVersion.has_value() ||solidity::test::CommonOptions::get().evmVersion() >= langutil::EVMVersion::prague());

std::string bytecodeFormatString = m_reader.stringSetting("bytecodeFormat", "legacy");
std::string bytecodeFormatString = m_reader.stringSetting("bytecodeFormat", "legacy,>=EOFv1");
if (bytecodeFormatString == "legacy,>=EOFv1" || bytecodeFormatString == ">=EOFv1,legacy")
return;

Expand Down
7 changes: 6 additions & 1 deletion test/libsolidity/SemanticTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ SemanticTest::SemanticTest(
if (m_runWithABIEncoderV1Only && !solidity::test::CommonOptions::get().useABIEncoderV1)
m_shouldRun = false;

std::string compileViaYul = m_reader.stringSetting("compileViaYul", "also");
auto const eofEnabled = solidity::test::CommonOptions::get().eofVersion().has_value();
std::string compileViaYul = m_reader.stringSetting("compileViaYul", eofEnabled ? "true" : "also");

if (compileViaYul == "false" && eofEnabled)
m_shouldRun = false;

if (m_runWithABIEncoderV1Only && compileViaYul != "false")
BOOST_THROW_EXCEPTION(std::runtime_error(
"ABIEncoderV1Only tests cannot be run via yul, "
Expand Down
4 changes: 4 additions & 0 deletions test/libsolidity/SyntaxTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ SyntaxTest::SyntaxTest(
m_compileViaYul = m_reader.stringSetting("compileViaYul", eofEnabled ? "true" : "false");
if (!util::contains(compileViaYulAllowedValues, m_compileViaYul))
BOOST_THROW_EXCEPTION(std::runtime_error("Invalid compileViaYul value: " + m_compileViaYul + "."));

if (m_compileViaYul == "false" && eofEnabled)
m_shouldRun = false;

m_optimiseYul = m_reader.boolSetting("optimize-yul", true);

static std::map<std::string, PipelineStage> const pipelineStages = {
Expand Down

0 comments on commit eb3b721

Please sign in to comment.