Merge pull request #2588 from ethereum/test-optimiser

Run metadata and gas meter tests when optimiser is on too
This commit is contained in:
Yoichi Hirai 2017-07-19 11:35:26 +02:00 committed by GitHub
commit 1a7b61ad05
2 changed files with 2 additions and 4 deletions

View File

@ -49,8 +49,7 @@ public:
{
m_compiler.reset(false);
m_compiler.addSource("", "pragma solidity >=0.0;\n" + _sourceCode);
/// NOTE: compiles without optimisations
ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(), "Compiling contract failed");
ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(dev::test::Options::get().optimize), "Compiling contract failed");
AssemblyItems const* items = m_compiler.runtimeAssemblyItems("");
ASTNode const& sourceUnit = m_compiler.ast();

View File

@ -44,8 +44,7 @@ BOOST_AUTO_TEST_CASE(metadata_stamp)
)";
CompilerStack compilerStack;
compilerStack.addSource("", std::string(sourceCode));
/// NOTE: compiles without optimisations
ETH_TEST_REQUIRE_NO_THROW(compilerStack.compile(), "Compiling contract failed");
ETH_TEST_REQUIRE_NO_THROW(compilerStack.compile(dev::test::Options::get().optimize), "Compiling contract failed");
bytes const& bytecode = compilerStack.runtimeObject("test").bytecode;
std::string const& metadata = compilerStack.onChainMetadata("test");
BOOST_CHECK(dev::test::isValidMetadata(metadata));