aboutsummaryrefslogtreecommitdiffstats
path: root/TestHelper.cpp
diff options
context:
space:
mode:
authorPaweł Bylica <pawel.bylica@imapp.pl>2014-11-14 22:30:08 +0800
committerPaweł Bylica <pawel.bylica@imapp.pl>2014-11-14 22:30:08 +0800
commit0eecd126f459920ab1f9c914688f28cfaf2bc533 (patch)
tree4abe9d564ead9c07a379199128836fad7693303b /TestHelper.cpp
parent0e187175b8ec741c0a98a653faec0ed13cb68e65 (diff)
parent7e7204ec18bdeb0c6cf3f550cfb6d33b3c2ba45e (diff)
downloaddexon-solidity-0eecd126f459920ab1f9c914688f28cfaf2bc533.tar
dexon-solidity-0eecd126f459920ab1f9c914688f28cfaf2bc533.tar.gz
dexon-solidity-0eecd126f459920ab1f9c914688f28cfaf2bc533.tar.bz2
dexon-solidity-0eecd126f459920ab1f9c914688f28cfaf2bc533.tar.lz
dexon-solidity-0eecd126f459920ab1f9c914688f28cfaf2bc533.tar.xz
dexon-solidity-0eecd126f459920ab1f9c914688f28cfaf2bc533.tar.zst
dexon-solidity-0eecd126f459920ab1f9c914688f28cfaf2bc533.zip
Merge branch 'develop' into develop-evmcc
Conflicts: windows/LibEthereum.vcxproj
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r--TestHelper.cpp47
1 files changed, 25 insertions, 22 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index be05ef7f..7f8c519f 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -27,8 +27,6 @@
#include <libethereum/Client.h>
#include <liblll/Compiler.h>
-//#define FILL_TESTS
-
using namespace std;
using namespace dev::eth;
@@ -357,28 +355,33 @@ void executeTests(const string& _name, const string& _testPathAppendix, std::fun
string testPath = getTestPath();
testPath += _testPathAppendix;
-#ifdef FILL_TESTS
- try
- {
- cnote << "Populating tests...";
- json_spirit::mValue v;
- boost::filesystem::path p(__FILE__);
- boost::filesystem::path dir = p.parent_path();
- string s = asString(dev::contents(dir.string() + "/" + _name + "Filler.json"));
- BOOST_REQUIRE_MESSAGE(s.length() > 0, "Contents of " + dir.string() + "/" + _name + "Filler.json is empty.");
- json_spirit::read_string(s, v);
- doTests(v, true);
- writeFile(testPath + "/" + _name + ".json", asBytes(json_spirit::write_string(v, true)));
- }
- catch (Exception const& _e)
- {
- BOOST_ERROR("Failed test with Exception: " << diagnostic_information(_e));
- }
- catch (std::exception const& _e)
+ for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i)
{
- BOOST_ERROR("Failed test with Exception: " << _e.what());
+ string arg = boost::unit_test::framework::master_test_suite().argv[i];
+ if (arg == "--filltests")
+ {
+ try
+ {
+ cnote << "Populating tests...";
+ json_spirit::mValue v;
+ boost::filesystem::path p(__FILE__);
+ boost::filesystem::path dir = p.parent_path();
+ string s = asString(dev::contents(dir.string() + "/" + _name + "Filler.json"));
+ BOOST_REQUIRE_MESSAGE(s.length() > 0, "Contents of " + dir.string() + "/" + _name + "Filler.json is empty.");
+ json_spirit::read_string(s, v);
+ doTests(v, true);
+ writeFile(testPath + "/" + _name + ".json", asBytes(json_spirit::write_string(v, true)));
+ }
+ 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());
+ }
+ }
}
-#endif
try
{