aboutsummaryrefslogtreecommitdiffstats
path: root/state.cpp
diff options
context:
space:
mode:
authorPaweł Bylica <pawel.bylica@imapp.pl>2015-03-13 18:19:26 +0800
committerPaweł Bylica <chfast@gmail.com>2015-03-14 07:18:52 +0800
commit31db4fbde86ede91b3af9336d7632e4c700960d6 (patch)
tree9eed19c85fde75a779d2895137fc54b4c60a5f0a /state.cpp
parentf15e1ef250dc9c2c32a2857d36920369ac5e62ce (diff)
downloaddexon-solidity-31db4fbde86ede91b3af9336d7632e4c700960d6.tar
dexon-solidity-31db4fbde86ede91b3af9336d7632e4c700960d6.tar.gz
dexon-solidity-31db4fbde86ede91b3af9336d7632e4c700960d6.tar.bz2
dexon-solidity-31db4fbde86ede91b3af9336d7632e4c700960d6.tar.lz
dexon-solidity-31db4fbde86ede91b3af9336d7632e4c700960d6.tar.xz
dexon-solidity-31db4fbde86ede91b3af9336d7632e4c700960d6.tar.zst
dexon-solidity-31db4fbde86ede91b3af9336d7632e4c700960d6.zip
Stats for testeth
Simple listener support added to testeth. Stats class implements the Listener interface and collects tests execution times. Try options: --stats or --stats=full. Closes ethereum/cpp-ethereum#1285
Diffstat (limited to 'state.cpp')
-rw-r--r--state.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/state.cpp b/state.cpp
index d6790029..8c191aa7 100644
--- a/state.cpp
+++ b/state.cpp
@@ -31,6 +31,7 @@
#include <libethereum/Defaults.h>
#include <libevm/VM.h>
#include "TestHelper.h"
+#include "Stats.h"
using namespace std;
using namespace json_spirit;
@@ -41,7 +42,8 @@ namespace dev { namespace test {
void doStateTests(json_spirit::mValue& v, bool _fillin)
{
- Options::get(); // process command line options
+ if (Options::get().stats)
+ Listener::registerListener(Stats::get());
for (auto& i: v.get_obj())
{
@@ -60,6 +62,7 @@ void doStateTests(json_spirit::mValue& v, bool _fillin)
try
{
+ Listener::ExecTimeGuard guard{i.first};
theState.execute(lastHashes(importer.m_environment.currentBlock.number), tx, &output);
}
catch (Exception const& _e)
@@ -178,29 +181,13 @@ BOOST_AUTO_TEST_CASE(stBlockHashTest)
BOOST_AUTO_TEST_CASE(stQuadraticComplexityTest)
{
if (test::Options::get().quadratic)
- {
- auto start = chrono::steady_clock::now();
-
dev::test::executeTests("stQuadraticComplexityTest", "/StateTests", dev::test::doStateTests);
-
- auto end = chrono::steady_clock::now();
- auto duration(chrono::duration_cast<chrono::milliseconds>(end - start));
- cnote << "test duration: " << duration.count() << " milliseconds.\n";
- }
}
BOOST_AUTO_TEST_CASE(stMemoryStressTest)
{
if (test::Options::get().memory)
- {
- auto start = chrono::steady_clock::now();
-
dev::test::executeTests("stMemoryStressTest", "/StateTests", dev::test::doStateTests);
-
- auto end = chrono::steady_clock::now();
- auto duration(chrono::duration_cast<chrono::milliseconds>(end - start));
- cnote << "test duration: " << duration.count() << " milliseconds.\n";
- }
}
BOOST_AUTO_TEST_CASE(stSolidityTest)