diff options
author | Paweł Bylica <pawel.bylica@imapp.pl> | 2015-03-12 18:55:00 +0800 |
---|---|---|
committer | Paweł Bylica <pawel.bylica@imapp.pl> | 2015-03-12 19:01:12 +0800 |
commit | e18c7b99cb440639adc0063c33c26566ba9589a1 (patch) | |
tree | 196e46e4a6f3672cbbd528b863195f3e954ec233 /state.cpp | |
parent | 7a769c4a00bdfeca9073be0c5083587c4438cd05 (diff) | |
download | dexon-solidity-e18c7b99cb440639adc0063c33c26566ba9589a1.tar dexon-solidity-e18c7b99cb440639adc0063c33c26566ba9589a1.tar.gz dexon-solidity-e18c7b99cb440639adc0063c33c26566ba9589a1.tar.bz2 dexon-solidity-e18c7b99cb440639adc0063c33c26566ba9589a1.tar.lz dexon-solidity-e18c7b99cb440639adc0063c33c26566ba9589a1.tar.xz dexon-solidity-e18c7b99cb440639adc0063c33c26566ba9589a1.tar.zst dexon-solidity-e18c7b99cb440639adc0063c33c26566ba9589a1.zip |
testeth: optional VM tracing (--vmtrace), command line options refactoring.
Closes ethereum/cpp-ethereum#1280
Diffstat (limited to 'state.cpp')
-rw-r--r-- | state.cpp | 60 |
1 files changed, 26 insertions, 34 deletions
@@ -41,7 +41,7 @@ namespace dev { namespace test { void doStateTests(json_spirit::mValue& v, bool _fillin) { - processCommandLineOptions(); + Options::get(); // process command line options for (auto& i: v.get_obj()) { @@ -172,48 +172,40 @@ BOOST_AUTO_TEST_CASE(stBlockHashTest) BOOST_AUTO_TEST_CASE(stQuadraticComplexityTest) { - for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i) - { - string arg = boost::unit_test::framework::master_test_suite().argv[i]; - if (arg == "--quadratic" || arg == "--all") - { - 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"; - } - } + 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) { - for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i) - { - string arg = boost::unit_test::framework::master_test_suite().argv[i]; - if (arg == "--memory" || arg == "--all") - { - 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"; - } - } + 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) - { - dev::test::executeTests("stSolidityTest", "/StateTests", dev::test::doStateTests); - } +BOOST_AUTO_TEST_CASE(stSolidityTest) +{ + dev::test::executeTests("stSolidityTest", "/StateTests", dev::test::doStateTests); +} BOOST_AUTO_TEST_CASE(stMemoryTest) { - dev::test::executeTests("stMemoryTest", "/StateTests", dev::test::doStateTests); + dev::test::executeTests("stMemoryTest", "/StateTests", dev::test::doStateTests); } |