Skip to content

Commit

Permalink
--createRandomTest <options.json>
Browse files Browse the repository at this point in the history
now has an optional argument.
removed double initialization. help updated
  • Loading branch information
winsvega committed Nov 29, 2017
1 parent 6d548d5 commit cc74e38
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/tools/libtesteth/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void printHelp()
cout << setw(30) << "--fillchain" << setw(25) << "When filling the state tests, fill tests as blockchain instead\n";
cout << setw(30) << "--randomcode <MaxOpcodeNum>" << setw(25) << "Generate smart random EVM code\n";
cout << setw(30) << "--createRandomTest" << setw(25) << "Create random test and output it to the console\n";
cout << setw(30) << "--createRandomTest <PathToOptions.json>" << setw(25) << "Use following options file for random code generation\n";
cout << setw(30) << "--seed <uint>" << setw(25) << "Define a seed for random test\n";
cout << setw(30) << "--options <PathTo.json>" << setw(25) << "Use following options file for random code generation\n";
//cout << setw(30) << "--fulloutput" << setw(25) << "Disable address compression in the output field\n";
Expand Down Expand Up @@ -261,7 +262,26 @@ Options::Options(int argc, char** argv)
exit(0);
}
else if (arg == "--createRandomTest")
{
createRandomTest = true;
if (i + 1 < argc) // two params
{
auto options = std::string{argv[++i]};
if (options[0] == '-') // not param, another option
i--;
else
{
boost::filesystem::path file(options);
if (boost::filesystem::exists(file))
randomCodeOptionsPath = file;
else
{
std::cerr << "Options file not found! Default options at: tests/src/randomCodeOptions.json\n";
exit(0);
}
}
}
}
else if (arg == "--seed")
{
throwIfNoArgumentFollows();
Expand Down

0 comments on commit cc74e38

Please sign in to comment.