diff options
author | chriseth <c@ethdev.com> | 2016-11-23 22:14:25 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-11-23 23:48:13 +0800 |
commit | c9293f2f2370e16af239f711b56245cf70c29970 (patch) | |
tree | b854ae0a8d0586f6acc8a15e9cb77378c77858f6 | |
parent | a7c2509adfe57f106cb87ed024925751732b5412 (diff) | |
download | dexon-solidity-c9293f2f2370e16af239f711b56245cf70c29970.tar.gz dexon-solidity-c9293f2f2370e16af239f711b56245cf70c29970.tar.zst dexon-solidity-c9293f2f2370e16af239f711b56245cf70c29970.zip |
Enable the optimizer for test runs.
-rwxr-xr-x | scripts/tests.sh | 9 | ||||
-rw-r--r-- | test/TestHelper.cpp | 3 | ||||
-rw-r--r-- | test/TestHelper.h | 1 | ||||
-rw-r--r-- | test/contracts/AuctionRegistrar.cpp | 1 | ||||
-rw-r--r-- | test/contracts/FixedFeeRegistrar.cpp | 1 | ||||
-rw-r--r-- | test/contracts/Wallet.cpp | 1 | ||||
-rw-r--r-- | test/libsolidity/SolidityExecutionFramework.cpp | 1 |
7 files changed, 12 insertions, 5 deletions
diff --git a/scripts/tests.sh b/scripts/tests.sh index 5da427d4..dfbda734 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -65,9 +65,14 @@ $ETH_PATH --test -d /tmp/test & # The node needs to get a little way into its startup sequence before the IPC # is available and is ready for the unit-tests to start talking to it. while [ ! -S /tmp/test/geth.ipc ]; do sleep 2; done +echo "--> IPC available." -# And then run the Solidity unit-tests, pointing to that IPC endpoint. -"$REPO_ROOT"/build/test/soltest -- --ipcpath /tmp/test/geth.ipc +# And then run the Solidity unit-tests (once without optimization, once with), +# pointing to that IPC endpoint. +echo "--> Running tests without optimizer..." + "$REPO_ROOT"/build/test/soltest -- --ipcpath /tmp/test/geth.ipc && \ + echo "--> Running tests WITH optimizer..." && \ + "$REPO_ROOT"/build/test/soltest -- --optimize --ipcpath /tmp/test/geth.ipc ERROR_CODE=$? pkill eth || true sleep 4 diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp index 0b6904bf..d670ebff 100644 --- a/test/TestHelper.cpp +++ b/test/TestHelper.cpp @@ -39,6 +39,9 @@ Options::Options() ipcPath = suite.argv[i + 1]; i++; } + else if (string(suite.argv[i]) == "--optimize") + optimize = true; + if (ipcPath.empty()) if (auto path = getenv("ETH_TEST_IPC")) ipcPath = path; diff --git a/test/TestHelper.h b/test/TestHelper.h index 78a107fd..afe4a68f 100644 --- a/test/TestHelper.h +++ b/test/TestHelper.h @@ -106,6 +106,7 @@ namespace test struct Options: boost::noncopyable { std::string ipcPath; + bool optimize = false; static Options const& get(); diff --git a/test/contracts/AuctionRegistrar.cpp b/test/contracts/AuctionRegistrar.cpp index caa8e9e0..0b573bca 100644 --- a/test/contracts/AuctionRegistrar.cpp +++ b/test/contracts/AuctionRegistrar.cpp @@ -220,7 +220,6 @@ protected: { if (!s_compiledRegistrar) { - m_optimize = true; m_compiler.reset(false); m_compiler.addSource("", registrarCode); ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), "Compiling contract failed"); diff --git a/test/contracts/FixedFeeRegistrar.cpp b/test/contracts/FixedFeeRegistrar.cpp index 8ed34924..8aabdac2 100644 --- a/test/contracts/FixedFeeRegistrar.cpp +++ b/test/contracts/FixedFeeRegistrar.cpp @@ -132,7 +132,6 @@ protected: { if (!s_compiledRegistrar) { - m_optimize = true; m_compiler.reset(false); m_compiler.addSource("", registrarCode); ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), "Compiling contract failed"); diff --git a/test/contracts/Wallet.cpp b/test/contracts/Wallet.cpp index 234387d6..935baf5b 100644 --- a/test/contracts/Wallet.cpp +++ b/test/contracts/Wallet.cpp @@ -447,7 +447,6 @@ protected: { if (!s_compiledWallet) { - m_optimize = true; m_compiler.reset(false); m_compiler.addSource("", walletCode); ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), "Compiling contract failed"); diff --git a/test/libsolidity/SolidityExecutionFramework.cpp b/test/libsolidity/SolidityExecutionFramework.cpp index 421fab7f..00943367 100644 --- a/test/libsolidity/SolidityExecutionFramework.cpp +++ b/test/libsolidity/SolidityExecutionFramework.cpp @@ -46,6 +46,7 @@ string getIPCSocketPath() ExecutionFramework::ExecutionFramework() : m_rpc(RPCSession::instance(getIPCSocketPath())), + m_optimize(dev::test::Options::get().optimize), m_sender(m_rpc.account(0)) { m_rpc.test_rewindToBlock(0); |