From b5fed832739adbd12cdaacd915f340b461238427 Mon Sep 17 00:00:00 2001 From: rodiazet Date: Mon, 16 Dec 2024 19:59:01 +0100 Subject: [PATCH] eof: Disable C++ tests which won't work for EOF. --- test/libevmasm/Assembler.cpp | 9 ++++++--- test/libevmasm/Optimiser.cpp | 8 +++++--- test/libsolidity/InlineAssembly.cpp | 8 +++++--- test/libsolidity/SolidityCompiler.cpp | 4 +++- test/libsolidity/ViewPureChecker.cpp | 3 ++- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/test/libevmasm/Assembler.cpp b/test/libevmasm/Assembler.cpp index b1222b49d1ae..3a6383002dc3 100644 --- a/test/libevmasm/Assembler.cpp +++ b/test/libevmasm/Assembler.cpp @@ -37,6 +37,7 @@ using namespace solidity::langutil; using namespace solidity::evmasm; +using namespace solidity::test; using namespace std::string_literals; namespace solidity::frontend::test @@ -54,7 +55,7 @@ namespace BOOST_AUTO_TEST_SUITE(Assembler) -BOOST_AUTO_TEST_CASE(all_assembly_items) +BOOST_AUTO_TEST_CASE(all_assembly_items, *boost::unit_test::precondition(nonEOF())) { std::map indices = { { "root.asm", 0 }, @@ -216,7 +217,8 @@ BOOST_AUTO_TEST_CASE(all_assembly_items) BOOST_CHECK_EQUAL(util::jsonCompactPrint(_assembly.assemblyJSON(indices)), util::jsonCompactPrint(jsonValue)); } -BOOST_AUTO_TEST_CASE(immutables_and_its_source_maps) +// TODO: Implement EOF counterpart +BOOST_AUTO_TEST_CASE(immutables_and_its_source_maps, *boost::unit_test::precondition(nonEOF())) { EVMVersion evmVersion = solidity::test::CommonOptions::get().evmVersion(); // Tests for 1, 2, 3 number of immutables. @@ -301,7 +303,8 @@ BOOST_AUTO_TEST_CASE(immutables_and_its_source_maps) } } -BOOST_AUTO_TEST_CASE(immutable) +// TODO: Implement EOF counterpart +BOOST_AUTO_TEST_CASE(immutable, *boost::unit_test::precondition(nonEOF())) { std::map indices = { { "root.asm", 0 }, diff --git a/test/libevmasm/Optimiser.cpp b/test/libevmasm/Optimiser.cpp index 8ed413cfe199..a8e9afeaf2de 100644 --- a/test/libevmasm/Optimiser.cpp +++ b/test/libevmasm/Optimiser.cpp @@ -41,6 +41,7 @@ using namespace solidity::langutil; using namespace solidity::evmasm; +using namespace solidity::test; namespace solidity::frontend::test { @@ -1329,13 +1330,14 @@ BOOST_AUTO_TEST_CASE(jumpdest_removal) ); } -BOOST_AUTO_TEST_CASE(jumpdest_removal_subassemblies) +BOOST_AUTO_TEST_CASE(jumpdest_removal_subassemblies, *boost::unit_test::precondition(nonEOF())) { // This tests that tags from subassemblies are not removed // if they are referenced by a super-assembly. Furthermore, // tag unifications (due to block deduplication) is also // visible at the super-assembly. + solAssert(!solidity::test::CommonOptions::get().eofVersion().has_value()); Assembly::OptimiserSettings settings; settings.runInliner = false; settings.runJumpdestRemover = true; @@ -1346,8 +1348,8 @@ BOOST_AUTO_TEST_CASE(jumpdest_removal_subassemblies) settings.evmVersion = solidity::test::CommonOptions::get().evmVersion(); settings.expectedExecutionsPerDeployment = OptimiserSettings{}.expectedExecutionsPerDeployment; - Assembly main{settings.evmVersion, false, solidity::test::CommonOptions::get().eofVersion(), {}}; - AssemblyPointer sub = std::make_shared(settings.evmVersion, true, solidity::test::CommonOptions::get().eofVersion(), std::string{}); + Assembly main{settings.evmVersion, false, std::nullopt, {}}; + AssemblyPointer sub = std::make_shared(settings.evmVersion, true, std::nullopt, std::string{}); sub->append(u256(1)); auto t1 = sub->newTag(); diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp index b3993e39f3df..fb08c667ce54 100644 --- a/test/libsolidity/InlineAssembly.cpp +++ b/test/libsolidity/InlineAssembly.cpp @@ -44,6 +44,7 @@ using namespace solidity::langutil; using namespace solidity::yul; +using namespace solidity::test; namespace solidity::frontend::test { @@ -294,7 +295,8 @@ BOOST_AUTO_TEST_CASE(designated_invalid_instruction) BOOST_CHECK(successAssemble("{ invalid() }")); } -BOOST_AUTO_TEST_CASE(inline_assembly_shadowed_instruction_declaration) +// TODO: Implement EOF counterpart +BOOST_AUTO_TEST_CASE(inline_assembly_shadowed_instruction_declaration, *boost::unit_test::precondition(nonEOF())) { CHECK_ASSEMBLE_ERROR("{ let gas := 1 }", ParserError, "Cannot use builtin"); } @@ -333,14 +335,14 @@ BOOST_AUTO_TEST_CASE(returndatacopy) BOOST_CHECK(successAssemble("{ returndatacopy(0, 32, 64) }")); } -BOOST_AUTO_TEST_CASE(staticcall) +BOOST_AUTO_TEST_CASE(staticcall, *boost::unit_test::precondition(nonEOF())) { if (!solidity::test::CommonOptions::get().evmVersion().hasStaticCall()) return; BOOST_CHECK(successAssemble("{ pop(staticcall(10000, 0x123, 64, 0x10, 128, 0x10)) }")); } -BOOST_AUTO_TEST_CASE(create2) +BOOST_AUTO_TEST_CASE(create2, *boost::unit_test::precondition(nonEOF())) { if (!solidity::test::CommonOptions::get().evmVersion().hasCreate2()) return; diff --git a/test/libsolidity/SolidityCompiler.cpp b/test/libsolidity/SolidityCompiler.cpp index 7cb95a99d0bc..79d838349af9 100644 --- a/test/libsolidity/SolidityCompiler.cpp +++ b/test/libsolidity/SolidityCompiler.cpp @@ -24,6 +24,7 @@ #include +using namespace solidity::test; namespace solidity::frontend::test { @@ -42,7 +43,8 @@ class SolidityCompilerFixture: protected AnalysisFramework BOOST_FIXTURE_TEST_SUITE(SolidityCompiler, SolidityCompilerFixture) -BOOST_AUTO_TEST_CASE(does_not_include_creation_time_only_internal_functions) +// TODO: Implement EOF counterpart +BOOST_AUTO_TEST_CASE(does_not_include_creation_time_only_internal_functions, *boost::unit_test::precondition(nonEOF())) { char const* sourceCode = R"( contract C { diff --git a/test/libsolidity/ViewPureChecker.cpp b/test/libsolidity/ViewPureChecker.cpp index 3d0e024da83b..ac220283a8e6 100644 --- a/test/libsolidity/ViewPureChecker.cpp +++ b/test/libsolidity/ViewPureChecker.cpp @@ -28,6 +28,7 @@ #include using namespace solidity::langutil; +using namespace solidity::test; namespace solidity::frontend::test { @@ -133,7 +134,7 @@ BOOST_AUTO_TEST_CASE(address_staticcall) } -BOOST_AUTO_TEST_CASE(assembly_staticcall) +BOOST_AUTO_TEST_CASE(assembly_staticcall, *boost::unit_test::precondition(nonEOF())) { std::string text = R"( contract C {