Skip to content

Commit

Permalink
eof: Add EOF enabled predicate to BOOST tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodiazet committed Dec 19, 2024
1 parent b6486db commit 749f64c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,13 @@ bool isValidSemanticTestPath(boost::filesystem::path const& _testPath)
return true;
}

boost::unit_test::precondition::predicate_t nonEOF()
{
return [](boost::unit_test::test_unit_id) {
return !solidity::test::CommonOptions::get().eofVersion().has_value();
};
}

boost::unit_test::precondition::predicate_t minEVMVersionCheck(langutil::EVMVersion _minEVMVersion)
{
return [_minEVMVersion](boost::unit_test::test_unit_id) {
Expand Down
4 changes: 4 additions & 0 deletions test/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ bool isValidSemanticTestPath(boost::filesystem::path const& _testPath);
/// @return A predicate (function) that can be passed into @a boost::unit_test::precondition().
boost::unit_test::precondition::predicate_t minEVMVersionCheck(langutil::EVMVersion _minEVMVersion);

/// Helper that can be used to skip tests when the EOF is not supported by the test case.
/// @return A predicate (function) that can be passed into @a boost::unit_test::precondition().
boost::unit_test::precondition::predicate_t nonEOF();

bool loadVMs(CommonOptions const& _options);

/**
Expand Down

0 comments on commit 749f64c

Please sign in to comment.