diff options
author | CJentzsch <jentzsch.software@gmail.com> | 2015-03-12 18:01:06 +0800 |
---|---|---|
committer | CJentzsch <jentzsch.software@gmail.com> | 2015-03-12 18:01:06 +0800 |
commit | 437e5c222b70f1971d3f8183caa623bc1b4e92d9 (patch) | |
tree | d93ef172b36542849a0455c17c25af4911fc75bb /state.cpp | |
parent | cf5f86e384889e21ff6af17ae9dbb222bb047787 (diff) | |
download | dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.tar dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.tar.gz dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.tar.bz2 dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.tar.lz dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.tar.xz dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.tar.zst dexon-solidity-437e5c222b70f1971d3f8183caa623bc1b4e92d9.zip |
add check random state test for jit
Diffstat (limited to 'state.cpp')
-rw-r--r-- | state.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -251,6 +251,39 @@ BOOST_AUTO_TEST_CASE(stCreateTest) } } +BOOST_AUTO_TEST_CASE(stRandom) +{ + string testPath = dev::test::getTestPath(); + testPath += "/StateTests/RandomTests"; + + vector<boost::filesystem::path> testFiles; + boost::filesystem::directory_iterator iterator(testPath); + for(; iterator != boost::filesystem::directory_iterator(); ++iterator) + if (boost::filesystem::is_regular_file(iterator->path()) && iterator->path().extension() == ".json") + testFiles.push_back(iterator->path()); + + for (auto& path: testFiles) + { + try + { + cnote << "Testing ..." << path.filename(); + json_spirit::mValue v; + string s = asString(dev::contents(path.string())); + BOOST_REQUIRE_MESSAGE(s.length() > 0, "Content of " + path.string() + " is empty. Have you cloned the 'tests' repo branch develop and set ETHEREUM_TEST_PATH to its path?"); + json_spirit::read_string(s, v); + dev::test::doStateTests(v, false); + } + catch (Exception const& _e) + { + BOOST_ERROR("Failed test with Exception: " << diagnostic_information(_e)); + } + catch (std::exception const& _e) + { + BOOST_ERROR("Failed test with Exception: " << _e.what()); + } + } +} + BOOST_AUTO_TEST_CASE(userDefinedFileState) { dev::test::userDefinedTest("--singletest", dev::test::doStateTests); |