aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-04-27 17:35:29 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-04-27 23:47:39 +0800
commit3a93aec7687d435095b12ab87d489ec8a1e78a86 (patch)
tree6d183f066b73d5bf67cabf27e5b78a19dcb0bdaa /test
parent99dd28d63ec05e001f05d1e788541bf6cf16f881 (diff)
downloaddexon-solidity-3a93aec7687d435095b12ab87d489ec8a1e78a86.tar
dexon-solidity-3a93aec7687d435095b12ab87d489ec8a1e78a86.tar.gz
dexon-solidity-3a93aec7687d435095b12ab87d489ec8a1e78a86.tar.bz2
dexon-solidity-3a93aec7687d435095b12ab87d489ec8a1e78a86.tar.lz
dexon-solidity-3a93aec7687d435095b12ab87d489ec8a1e78a86.tar.xz
dexon-solidity-3a93aec7687d435095b12ab87d489ec8a1e78a86.tar.zst
dexon-solidity-3a93aec7687d435095b12ab87d489ec8a1e78a86.zip
Make the fuzzer quiet
Diffstat (limited to 'test')
-rwxr-xr-xtest/cmdlineTests.sh2
-rw-r--r--test/fuzzer.cpp25
2 files changed, 17 insertions, 10 deletions
diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh
index caf09a91..6dc3f77f 100755
--- a/test/cmdlineTests.sh
+++ b/test/cmdlineTests.sh
@@ -79,7 +79,7 @@ TMPDIR=$(mktemp -d)
"$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/test/
for f in *.sol
do
- "$REPO_ROOT"/build/test/solfuzzer < "$f"
+ "$REPO_ROOT"/build/test/solfuzzer --quiet < "$f"
done
)
rm -rf "$TMPDIR"
diff --git a/test/fuzzer.cpp b/test/fuzzer.cpp
index 59090271..dbfec2c1 100644
--- a/test/fuzzer.cpp
+++ b/test/fuzzer.cpp
@@ -38,6 +38,8 @@ extern "C"
extern char const* compileJSON(char const* _input, bool _optimize);
}
+bool quiet = false;
+
string contains(string const& _haystack, vector<string> const& _needles)
{
for (string const& needle: _needles)
@@ -48,7 +50,8 @@ string contains(string const& _haystack, vector<string> const& _needles)
void testConstantOptimizer()
{
- cout << "Testing constant optimizer" << endl;
+ if (!quiet)
+ cout << "Testing constant optimizer" << endl;
vector<u256> numbers;
while (!cin.eof())
{
@@ -56,12 +59,14 @@ void testConstantOptimizer()
cin.read(reinterpret_cast<char*>(data.data()), 32);
numbers.push_back(u256(data));
}
- cout << "Got " << numbers.size() << " inputs:" << endl;
+ if (!quiet)
+ cout << "Got " << numbers.size() << " inputs:" << endl;
Assembly assembly;
for (u256 const& n: numbers)
{
- cout << n << endl;
+ if (!quiet)
+ cout << n << endl;
assembly.append(n);
}
for (bool isCreation: {false, true})
@@ -80,7 +85,8 @@ void testConstantOptimizer()
void testCompiler()
{
- cout << "Testing compiler." << endl;
+ if (!quiet)
+ cout << "Testing compiler." << endl;
string input;
while (!cin.eof())
{
@@ -140,13 +146,11 @@ Allowed options)",
po::options_description::m_default_line_length,
po::options_description::m_default_line_length - 23);
options.add_options()
- (
- "help",
- "Show this help screen."
- )
+ ("help", "Show this help screen.")
+ ("quiet", "Only output errors.")
(
"const-opt",
- "Only run the constant optimizer. "
+ "Run the constant optimizer instead of compiling. "
"Expects a binary string of up to 32 bytes on stdin."
);
@@ -163,6 +167,9 @@ Allowed options)",
return false;
}
+ if (arguments.count("quiet"))
+ quiet = true;
+
if (arguments.count("help"))
cout << options;
else if (arguments.count("const-opt"))