Remove mention of IPC.

This commit is contained in:
chriseth 2019-07-17 10:24:23 +02:00
parent ac43c3bd18
commit c4638cc5cb
8 changed files with 18 additions and 29 deletions

View File

@ -44,7 +44,7 @@ struct Testsuite
boost::filesystem::path const path; boost::filesystem::path const path;
boost::filesystem::path const subpath; boost::filesystem::path const subpath;
bool smt; bool smt;
bool ipc; bool needsVM;
TestCase::TestCaseCreator testCaseCreator; TestCase::TestCaseCreator testCaseCreator;
}; };
@ -52,7 +52,7 @@ struct Testsuite
/// Array of testsuits that can be run interactively as well as automatically /// Array of testsuits that can be run interactively as well as automatically
Testsuite const g_interactiveTestsuites[] = { Testsuite const g_interactiveTestsuites[] = {
/* /*
Title Path Subpath SMT IPC Creator function */ Title Path Subpath SMT NeedsVM Creator function */
{"Yul Optimizer", "libyul", "yulOptimizerTests", false, false, &yul::test::YulOptimizerTest::create}, {"Yul Optimizer", "libyul", "yulOptimizerTests", false, false, &yul::test::YulOptimizerTest::create},
{"Yul Interpreter", "libyul", "yulInterpreterTests", false, false, &yul::test::YulInterpreterTest::create}, {"Yul Interpreter", "libyul", "yulInterpreterTests", false, false, &yul::test::YulInterpreterTest::create},
{"Yul Object Compiler", "libyul", "objectCompiler", false, false, &yul::test::ObjectCompilerTest::create}, {"Yul Object Compiler", "libyul", "objectCompiler", false, false, &yul::test::ObjectCompilerTest::create},

View File

@ -44,7 +44,6 @@ public:
struct Config struct Config
{ {
std::string filename; std::string filename;
std::string ipcPath;
langutil::EVMVersion evmVersion; langutil::EVMVersion evmVersion;
}; };

View File

@ -75,13 +75,12 @@ int registerTests(
boost::unit_test::test_suite& _suite, boost::unit_test::test_suite& _suite,
boost::filesystem::path const& _basepath, boost::filesystem::path const& _basepath,
boost::filesystem::path const& _path, boost::filesystem::path const& _path,
std::string const& _ipcPath,
TestCase::TestCaseCreator _testCaseCreator TestCase::TestCaseCreator _testCaseCreator
) )
{ {
int numTestsAdded = 0; int numTestsAdded = 0;
fs::path fullpath = _basepath / _path; fs::path fullpath = _basepath / _path;
TestCase::Config config{fullpath.string(), _ipcPath, dev::test::Options::get().evmVersion()}; TestCase::Config config{fullpath.string(), dev::test::Options::get().evmVersion()};
if (fs::is_directory(fullpath)) if (fs::is_directory(fullpath))
{ {
test_suite* sub_suite = BOOST_TEST_SUITE(_path.filename().string()); test_suite* sub_suite = BOOST_TEST_SUITE(_path.filename().string());
@ -90,7 +89,7 @@ int registerTests(
fs::directory_iterator() fs::directory_iterator()
)) ))
if (fs::is_directory(entry.path()) || TestCase::isTestFilename(entry.path().filename())) if (fs::is_directory(entry.path()) || TestCase::isTestFilename(entry.path().filename()))
numTestsAdded += registerTests(*sub_suite, _basepath, _path / entry.path().filename(), _ipcPath, _testCaseCreator); numTestsAdded += registerTests(*sub_suite, _basepath, _path / entry.path().filename(), _testCaseCreator);
_suite.add(sub_suite); _suite.add(sub_suite);
} }
else else
@ -141,8 +140,8 @@ test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] )
master.p_name.value = "SolidityTests"; master.p_name.value = "SolidityTests";
dev::test::Options::get().validate(); dev::test::Options::get().validate();
bool disableIPC = !dev::test::EVMHost::getVM(dev::test::Options::get().evmonePath.string()); bool disableSemantics = !dev::test::EVMHost::getVM(dev::test::Options::get().evmonePath.string());
if (disableIPC) if (disableSemantics)
{ {
cout << "Unable to find libevmone.so. Please provide the path using -- --evmonepath <path>." << endl; cout << "Unable to find libevmone.so. Please provide the path using -- --evmonepath <path>." << endl;
cout << "You can download it at" << endl; cout << "You can download it at" << endl;
@ -157,19 +156,18 @@ test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] )
if (ts.smt && options.disableSMT) if (ts.smt && options.disableSMT)
continue; continue;
if (ts.ipc && disableIPC) if (ts.needsVM && disableSemantics)
continue; continue;
solAssert(registerTests( solAssert(registerTests(
master, master,
options.testPath / ts.path, options.testPath / ts.path,
ts.subpath, ts.subpath,
options.evmonePath.string(),
ts.testCaseCreator ts.testCaseCreator
) > 0, std::string("no ") + ts.title + " tests found"); ) > 0, std::string("no ") + ts.title + " tests found");
} }
if (disableIPC) if (disableSemantics)
{ {
for (auto suite: { for (auto suite: {
"ABIDecoderTest", "ABIDecoderTest",

View File

@ -36,8 +36,8 @@ using namespace boost::unit_test;
namespace fs = boost::filesystem; namespace fs = boost::filesystem;
SemanticTest::SemanticTest(string const& _filename, string const& _ipcPath, langutil::EVMVersion _evmVersion): SemanticTest::SemanticTest(string const& _filename, langutil::EVMVersion _evmVersion):
SolidityExecutionFramework(_ipcPath, _evmVersion) SolidityExecutionFramework(_evmVersion)
{ {
ifstream file(_filename); ifstream file(_filename);
soltestAssert(file, "Cannot open test contract: \"" + _filename + "\"."); soltestAssert(file, "Cannot open test contract: \"" + _filename + "\".");

View File

@ -44,9 +44,9 @@ class SemanticTest: public SolidityExecutionFramework, public EVMVersionRestrict
{ {
public: public:
static std::unique_ptr<TestCase> create(Config const& _options) static std::unique_ptr<TestCase> create(Config const& _options)
{ return std::make_unique<SemanticTest>(_options.filename, _options.ipcPath, _options.evmVersion); } { return std::make_unique<SemanticTest>(_options.filename, _options.evmVersion); }
explicit SemanticTest(std::string const& _filename, std::string const& _ipcPath, langutil::EVMVersion _evmVersion); explicit SemanticTest(std::string const& _filename, langutil::EVMVersion _evmVersion);
TestResult run(std::ostream& _stream, std::string const& _linePrefix = "", bool _formatted = false) override; TestResult run(std::ostream& _stream, std::string const& _linePrefix = "", bool _formatted = false) override;
void printSource(std::ostream &_stream, std::string const& _linePrefix = "", bool _formatted = false) const override; void printSource(std::ostream &_stream, std::string const& _linePrefix = "", bool _formatted = false) const override;

View File

@ -30,16 +30,6 @@ using namespace dev::solidity;
using namespace dev::solidity::test; using namespace dev::solidity::test;
using namespace std; using namespace std;
SolidityExecutionFramework::SolidityExecutionFramework():
ExecutionFramework()
{
}
SolidityExecutionFramework::SolidityExecutionFramework(std::string const&, langutil::EVMVersion _evmVersion):
ExecutionFramework(_evmVersion)
{
}
bytes SolidityExecutionFramework::compileContract( bytes SolidityExecutionFramework::compileContract(
string const& _sourceCode, string const& _sourceCode,
string const& _contractName, string const& _contractName,

View File

@ -45,8 +45,10 @@ class SolidityExecutionFramework: public dev::test::ExecutionFramework
{ {
public: public:
SolidityExecutionFramework(); SolidityExecutionFramework() {}
SolidityExecutionFramework(std::string const& _ipcPath, langutil::EVMVersion _evmVersion); explicit SolidityExecutionFramework(langutil::EVMVersion _evmVersion):
ExecutionFramework(_evmVersion)
{}
virtual bytes const& compileAndRunWithoutCheck( virtual bytes const& compileAndRunWithoutCheck(
std::string const& _sourceCode, std::string const& _sourceCode,

View File

@ -157,7 +157,7 @@ TestTool::Result TestTool::process()
{ {
(AnsiColorized(cout, formatted, {BOLD}) << m_name << ": ").flush(); (AnsiColorized(cout, formatted, {BOLD}) << m_name << ": ").flush();
m_test = m_testCaseCreator(TestCase::Config{m_path.string(), m_options.evmonePath.string(), m_options.evmVersion()}); m_test = m_testCaseCreator(TestCase::Config{m_path.string(), m_options.evmVersion()});
if (m_test->validateSettings(m_options.evmVersion())) if (m_test->validateSettings(m_options.evmVersion()))
switch (TestCase::TestResult result = m_test->run(outputMessages, " ", formatted)) switch (TestCase::TestResult result = m_test->run(outputMessages, " ", formatted))
{ {
@ -430,7 +430,7 @@ int main(int argc, char const *argv[])
// Interactive tests are added in InteractiveTests.h // Interactive tests are added in InteractiveTests.h
for (auto const& ts: g_interactiveTestsuites) for (auto const& ts: g_interactiveTestsuites)
{ {
if (ts.ipc && disableSemantics) if (ts.needsVM && disableSemantics)
continue; continue;
if (ts.smt && options.disableSMT) if (ts.smt && options.disableSMT)