aboutsummaryrefslogtreecommitdiffstats
path: root/TestHelper.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 /TestHelper.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 'TestHelper.cpp')
-rw-r--r--TestHelper.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index ddc929e4..72fecf59 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -551,6 +551,10 @@ Options::Options()
vmtrace = true;
else if (arg == "--filltests")
fillTests = true;
+ else if (arg == "--stats")
+ stats = true;
+ else if (arg == "--stats=full")
+ stats = statsFull = true;
else if (arg == "--performance")
performance = true;
else if (arg == "--quadratic")
@@ -578,6 +582,7 @@ Options const& Options::get()
return instance;
}
+
LastHashes lastHashes(u256 _currentBlockNumber)
{
LastHashes ret;
@@ -586,4 +591,27 @@ LastHashes lastHashes(u256 _currentBlockNumber)
return ret;
}
+
+namespace
+{
+ Listener* g_listener;
+}
+
+void Listener::registerListener(Listener& _listener)
+{
+ g_listener = &_listener;
+}
+
+void Listener::notifyTestStarted(std::string const& _name)
+{
+ if (g_listener)
+ g_listener->testStarted(_name);
+}
+
+void Listener::notifyTestFinished()
+{
+ if (g_listener)
+ g_listener->testFinished();
+}
+
} } // namespaces