22 #define BOOST_TEST_MODULE EthereumTests 23 #pragma GCC diagnostic push 24 #pragma GCC diagnostic ignored "-Wunused-parameter" 26 #define BOOST_TEST_NO_MAIN 30 #pragma warning(disable:4535) // calling _set_se_translator requires /EHa 32 #include <boost/test/included/unit_test.hpp> 37 #pragma GCC diagnostic pop 42 #include <boost/version.hpp> 47 static std::ostringstream strCout;
70 throw framework::internal_error(
"Create Random Test Error!");
75 std::cout <<
"correct" << std::endl;
80 static std::atomic_bool stopTravisOut;
84 while (!stopTravisOut)
86 std::this_thread::sleep_for(std::chrono::seconds(1));
88 if (tickCounter % 10 == 0)
89 std::cout <<
"." << std::endl;
109 if (!std::setlocale(LC_ALL,
""))
111 setenv(
"LC_ALL",
"C", 1);
117 int main(
int argc,
char* argv[] )
128 std::cout.rdbuf(strCout.rdbuf());
129 std::cerr.rdbuf(strCout.rdbuf());
131 for (
int i = 0; i < argc; i++)
133 std::string arg = std::string{argv[i]};
136 if (arg ==
"-t" && i+1 < argc)
137 argv[i+1] = (
char*)std::string(
"RandomTestCreationSuite").c_str();
140 if (arg ==
"--checktest")
148 test_suite* ts1 = BOOST_TEST_SUITE(
"RandomTestCreationSuite");
150 framework::master_test_suite().add(ts1);
153 for (
int i = 0; i < argc; i++)
156 stopTravisOut =
false;
157 std::future<int> ret = std::async(unit_test_main,
fake_init_func, argc, argv);
159 int result = ret.get();
160 stopTravisOut =
true;
static Options const & get(int argc=0, char **argv=0)
Get reference to options The first time used, options are parsed with argc, argv. ...
std::streambuf * oldCerrStreamBuf
static void printTestExecStats()
bool createRandomTest
Generate random test.
int main(int argc, char *argv[])
void setDefaultOrCLocale()
test_suite * fake_init_func(int argc, char *argv[])
std::streambuf * oldCoutStreamBuf
std::vector< char * > parameters
int createRandomTest(std::vector< char * > const &_parameters)
Helper functions to work with json::spirit and test files.