diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-17 18:54:02 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-26 22:17:07 +0800 |
commit | 30012db396793efad5dba9a2bbb64d34994709ce (patch) | |
tree | 6270037929123b5a95038a6bd7f3b6a305d516ac /test | |
parent | 6848199b66d9cadae901f71dcf944fe9aa927eeb (diff) | |
download | dexon-solidity-30012db396793efad5dba9a2bbb64d34994709ce.tar.gz dexon-solidity-30012db396793efad5dba9a2bbb64d34994709ce.tar.zst dexon-solidity-30012db396793efad5dba9a2bbb64d34994709ce.zip |
Add CompilerStack::setOptimiserSettings
Diffstat (limited to 'test')
-rw-r--r-- | test/contracts/AuctionRegistrar.cpp | 3 | ||||
-rw-r--r-- | test/contracts/FixedFeeRegistrar.cpp | 3 | ||||
-rw-r--r-- | test/contracts/Wallet.cpp | 3 | ||||
-rw-r--r-- | test/libsolidity/GasMeter.cpp | 3 | ||||
-rw-r--r-- | test/libsolidity/Metadata.cpp | 3 | ||||
-rw-r--r-- | test/libsolidity/SolidityExecutionFramework.h | 3 |
6 files changed, 12 insertions, 6 deletions
diff --git a/test/contracts/AuctionRegistrar.cpp b/test/contracts/AuctionRegistrar.cpp index fb8c1c68..773b14b9 100644 --- a/test/contracts/AuctionRegistrar.cpp +++ b/test/contracts/AuctionRegistrar.cpp @@ -223,7 +223,8 @@ protected: { m_compiler.reset(false); m_compiler.addSource("", registrarCode); - ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), "Compiling contract failed"); + m_compiler.setOptimiserSettings(m_optimize, m_optimizeRuns); + ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(), "Compiling contract failed"); s_compiledRegistrar.reset(new bytes(m_compiler.object("GlobalRegistrar").bytecode)); } sendMessage(*s_compiledRegistrar, true); diff --git a/test/contracts/FixedFeeRegistrar.cpp b/test/contracts/FixedFeeRegistrar.cpp index d2904b5f..967d60b6 100644 --- a/test/contracts/FixedFeeRegistrar.cpp +++ b/test/contracts/FixedFeeRegistrar.cpp @@ -135,7 +135,8 @@ protected: { m_compiler.reset(false); m_compiler.addSource("", registrarCode); - ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), "Compiling contract failed"); + m_compiler.setOptimiserSettings(m_optimize, m_optimizeRuns); + ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(), "Compiling contract failed"); s_compiledRegistrar.reset(new bytes(m_compiler.object("FixedFeeRegistrar").bytecode)); } sendMessage(*s_compiledRegistrar, true); diff --git a/test/contracts/Wallet.cpp b/test/contracts/Wallet.cpp index ef345d86..d12b7493 100644 --- a/test/contracts/Wallet.cpp +++ b/test/contracts/Wallet.cpp @@ -450,7 +450,8 @@ protected: { m_compiler.reset(false); m_compiler.addSource("", walletCode); - ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), "Compiling contract failed"); + m_compiler.setOptimiserSettings(m_optimize, m_optimizeRuns); + ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(), "Compiling contract failed"); s_compiledWallet.reset(new bytes(m_compiler.object("Wallet").bytecode)); } bytes args = encodeArgs(u256(0x60), _required, _dailyLimit, u256(_owners.size()), _owners); diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index 8b41e1db..df9afaae 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -49,7 +49,8 @@ public: { m_compiler.reset(false); m_compiler.addSource("", "pragma solidity >=0.0;\n" + _sourceCode); - ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(dev::test::Options::get().optimize), "Compiling contract failed"); + m_compiler.setOptimiserSettings(dev::test::Options::get().optimize); + ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(), "Compiling contract failed"); AssemblyItems const* items = m_compiler.runtimeAssemblyItems(""); ASTNode const& sourceUnit = m_compiler.ast(); diff --git a/test/libsolidity/Metadata.cpp b/test/libsolidity/Metadata.cpp index ce1a7b18..e4820ad2 100644 --- a/test/libsolidity/Metadata.cpp +++ b/test/libsolidity/Metadata.cpp @@ -44,7 +44,8 @@ BOOST_AUTO_TEST_CASE(metadata_stamp) )"; CompilerStack compilerStack; compilerStack.addSource("", std::string(sourceCode)); - ETH_TEST_REQUIRE_NO_THROW(compilerStack.compile(dev::test::Options::get().optimize), "Compiling contract failed"); + compilerStack.setOptimiserSettings(dev::test::Options::get().optimize); + ETH_TEST_REQUIRE_NO_THROW(compilerStack.compile(), "Compiling contract failed"); bytes const& bytecode = compilerStack.runtimeObject("test").bytecode; std::string const& metadata = compilerStack.metadata("test"); BOOST_CHECK(dev::test::isValidMetadata(metadata)); diff --git a/test/libsolidity/SolidityExecutionFramework.h b/test/libsolidity/SolidityExecutionFramework.h index 6a13423b..a8e58c25 100644 --- a/test/libsolidity/SolidityExecutionFramework.h +++ b/test/libsolidity/SolidityExecutionFramework.h @@ -57,7 +57,8 @@ public: m_compiler.reset(false); m_compiler.addSource("", sourceCode); m_compiler.setLibraries(_libraryAddresses); - if (!m_compiler.compile(m_optimize, m_optimizeRuns)) + m_compiler.setOptimiserSettings(m_optimize, m_optimizeRuns); + if (!m_compiler.compile()) { for (auto const& error: m_compiler.errors()) SourceReferenceFormatter::printExceptionInformation( |