Add Yul optimizer test framework.

This commit is contained in:
chriseth
2018-10-11 16:59:57 +02:00
parent 6859ec0434
commit 4607118d2e
6 changed files with 266 additions and 2 deletions
+1 -1
View File
@@ -3,5 +3,5 @@ target_link_libraries(solfuzzer PRIVATE libsolc evmasm ${Boost_PROGRAM_OPTIONS_L
add_executable(isoltest isoltest.cpp ../Options.cpp ../Common.cpp ../libsolidity/TestCase.cpp ../libsolidity/SyntaxTest.cpp
../libsolidity/AnalysisFramework.cpp ../libsolidity/SolidityExecutionFramework.cpp ../ExecutionFramework.cpp
../RPCSession.cpp ../libsolidity/ASTJSONTest.cpp)
../RPCSession.cpp ../libsolidity/ASTJSONTest.cpp ../libjulia/YulOptimizerTest.cpp)
target_link_libraries(isoltest PRIVATE libsolc solidity evmasm ${Boost_PROGRAM_OPTIONS_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES})
+14
View File
@@ -21,6 +21,7 @@
#include <test/libsolidity/AnalysisFramework.h>
#include <test/libsolidity/SyntaxTest.h>
#include <test/libsolidity/ASTJSONTest.h>
#include <test/libjulia/YulOptimizerTest.h>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/replace.hpp>
@@ -371,6 +372,8 @@ Allowed options)",
TestStats global_stats{0, 0};
// Actually run the tests.
// If you add new tests here, you also have to add them in boostTest.cpp
if (auto stats = runTestSuite("Syntax", testPath / "libsolidity", "syntaxTests", SyntaxTest::create, formatted))
global_stats += *stats;
else
@@ -381,6 +384,17 @@ Allowed options)",
else
return 1;
if (auto stats = runTestSuite(
"Yul Optimizer",
testPath / "libjulia",
"yulOptimizerTests",
julia::test::YulOptimizerTest::create,
formatted
))
global_stats += *stats;
else
return 1;
cout << endl << "Summary: ";
FormattedScope(cout, formatted, {BOLD, global_stats ? GREEN : RED}) <<
global_stats.successCount << "/" << global_stats.testCount;