23 #include <boost/filesystem.hpp> 38 const char* ptestPath = getenv(
"ETHEREUM_TEST_PATH");
40 if (ptestPath == NULL)
42 ctest <<
" could not find environment variable ETHEREUM_TEST_PATH \n";
43 testPath =
"../../../tests";
53 static std::mt19937 randomGenerator(
utcTime());
54 randomGenerator.seed(std::random_device()());
55 return std::uniform_int_distribution<int>(1)(randomGenerator);
64 ctest <<
"Contents of " + _path +
" is empty. Have you cloned the 'tests' repo branch develop and set ETHEREUM_TEST_PATH to its path?";
66 ctest <<
"FIXTURE: loaded test from file: " << _path;
68 reader.parse(s, result);
79 return boost::filesystem::path(_file).parent_path().string();
84 std::stringstream stream;
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Json::Value loadJsonFromFile(std::string const &_path)
uint64_t utcTime()
Get the current time in seconds since the epoch in UTC.
std::hash for asio::adress
std::string contentsString(std::string const &_file)
Retrieve and returns the contents of the given file as a std::string.
std::string getDataDir(std::string _prefix="ethereum")
std::string getRandomPath()
std::string getFolder(std::string const &_file)
std::string getTestPath()
std::string toTestFilePath(std::string const &_filename)