mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add more debuggin in the fuzzer
This commit is contained in:
parent
fa2bb01da3
commit
c537321309
@ -22,9 +22,13 @@ using namespace std;
|
|||||||
using namespace dev;
|
using namespace dev;
|
||||||
using namespace dev::eth;
|
using namespace dev::eth;
|
||||||
|
|
||||||
void FuzzerUtil::runCompiler(string _input)
|
void FuzzerUtil::runCompiler(string _input, bool _quiet)
|
||||||
{
|
{
|
||||||
|
if (!_quiet)
|
||||||
|
cout << "Input JSON: " << _input << endl;
|
||||||
string outputString(solidity_compile(_input.c_str(), nullptr));
|
string outputString(solidity_compile(_input.c_str(), nullptr));
|
||||||
|
if (!_quiet)
|
||||||
|
cout << "Output JSON: " << outputString << endl;
|
||||||
Json::Value output;
|
Json::Value output;
|
||||||
if (!jsonParseStrict(outputString, output))
|
if (!jsonParseStrict(outputString, output))
|
||||||
{
|
{
|
||||||
@ -66,7 +70,7 @@ void FuzzerUtil::testCompiler(string const& _input, bool _optimize, bool _quiet)
|
|||||||
// Enable all Contract-level outputs.
|
// Enable all Contract-level outputs.
|
||||||
config["settings"]["outputSelection"]["*"]["*"][0] = "*";
|
config["settings"]["outputSelection"]["*"]["*"][0] = "*";
|
||||||
|
|
||||||
runCompiler(jsonCompactPrint(config));
|
runCompiler(jsonCompactPrint(config), _quiet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FuzzerUtil::testConstantOptimizer(string const& _input, bool _quiet)
|
void FuzzerUtil::testConstantOptimizer(string const& _input, bool _quiet)
|
||||||
@ -112,5 +116,5 @@ void FuzzerUtil::testStandardCompiler(string const& _input, bool _quiet)
|
|||||||
if (!_quiet)
|
if (!_quiet)
|
||||||
cout << "Testing compiler via JSON interface." << endl;
|
cout << "Testing compiler via JSON interface." << endl;
|
||||||
|
|
||||||
runCompiler(_input);
|
runCompiler(_input, _quiet);
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
|
|
||||||
struct FuzzerUtil
|
struct FuzzerUtil
|
||||||
{
|
{
|
||||||
static void runCompiler(std::string _input);
|
static void runCompiler(std::string _input, bool _quiet);
|
||||||
static void testCompiler(std::string const& _input, bool _optimize, bool quiet);
|
static void testCompiler(std::string const& _input, bool _optimize, bool _quiet);
|
||||||
static void testConstantOptimizer(std::string const& _input, bool _quiet);
|
static void testConstantOptimizer(std::string const& _input, bool _quiet);
|
||||||
static void testStandardCompiler(std::string const& _input, bool _quiet);
|
static void testStandardCompiler(std::string const& _input, bool _quiet);
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user