aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-08-31 17:18:43 +0800
committerGitHub <noreply@github.com>2017-08-31 17:18:43 +0800
commit402d6e713e6d38a00616cdee87d752dd78ee91db (patch)
tree01d00b38e3267df4c754dfb45ffc82c970549370
parenta3f77527e9da0005e3c6d9cbd4c6a56c17c1089c (diff)
parentb7e8d305b330f899ad0d08a4dad7851596545203 (diff)
downloaddexon-solidity-402d6e713e6d38a00616cdee87d752dd78ee91db.tar.gz
dexon-solidity-402d6e713e6d38a00616cdee87d752dd78ee91db.tar.zst
dexon-solidity-402d6e713e6d38a00616cdee87d752dd78ee91db.zip
Merge pull request #2858 from ethereum/fuzzer-without-optimizer
Run fuzzer tests without optimizer too
-rwxr-xr-xtest/cmdlineTests.sh7
-rw-r--r--test/fuzzer.cpp11
2 files changed, 14 insertions, 4 deletions
diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh
index eb5c714d..f12a6686 100755
--- a/test/cmdlineTests.sh
+++ b/test/cmdlineTests.sh
@@ -147,6 +147,13 @@ TMPDIR=$(mktemp -d)
cat "$f"
exit 1
fi
+
+ "$REPO_ROOT"/build/test/solfuzzer --without-optimizer --quiet < "$f"
+ if [ $? -ne 0 ]; then
+ echo "Fuzzer (without optimizer) failed on:"
+ cat "$f"
+ exit 1
+ fi
set -e
done
)
diff --git a/test/fuzzer.cpp b/test/fuzzer.cpp
index 2c39dde2..53ba7201 100644
--- a/test/fuzzer.cpp
+++ b/test/fuzzer.cpp
@@ -121,13 +121,12 @@ void testStandardCompiler()
}
}
-void testCompiler()
+void testCompiler(bool optimize)
{
if (!quiet)
- cout << "Testing compiler." << endl;
+ cout << "Testing compiler " << (optimize ? "with" : "without") << " optimizer." << endl;
string input = readInput();
- bool optimize = true;
string outputString(compileJSON(input.c_str(), optimize));
Json::Value outputJson;
if (!Json::Reader().parse(outputString, outputJson))
@@ -191,6 +190,10 @@ Allowed options)",
"const-opt",
"Run the constant optimizer instead of compiling. "
"Expects a binary string of up to 32 bytes on stdin."
+ )
+ (
+ "without-optimizer",
+ "Run without optimizations. Cannot be used together with standard-json."
);
po::variables_map arguments;
@@ -216,7 +219,7 @@ Allowed options)",
else if (arguments.count("standard-json"))
testStandardCompiler();
else
- testCompiler();
+ testCompiler(!arguments.count("without-optimizer"));
return 0;
}