Fix evmone filename for auto-discovery for windows and macos.

This commit is contained in:
Flash Sheridan
2019-09-11 12:28:05 +02:00
committed by Daniel Kirchner
parent 5063e53730
commit 733d40ddb5
6 changed files with 23 additions and 11 deletions
+2 -2
View File
@@ -76,7 +76,7 @@ std::string EVMOneEnvOrDefaultPath()
};
for (auto const& basePath: searchPath)
{
fs::path p = basePath / "libevmone.so";
fs::path p = basePath / EVMONE_FILENAME;
if (fs::exists(p))
return p.string();
}
@@ -92,7 +92,7 @@ CommonOptions::CommonOptions(std::string _caption):
options.add_options()
("evm-version", po::value(&evmVersionString), "which evm version to use")
("testpath", po::value<fs::path>(&this->testPath)->default_value(dev::test::testPath()), "path to test files")
("evmonepath", po::value<fs::path>(&evmonePath)->default_value(EVMOneEnvOrDefaultPath()), "path to libevmone.so")
("evmonepath", po::value<fs::path>(&evmonePath)->default_value(EVMOneEnvOrDefaultPath()), "path to " EVMONE_FILENAME)
("no-smt", po::bool_switch(&disableSMT), "disable SMT checker");
}
+11
View File
@@ -24,6 +24,17 @@
#include <boost/program_options.hpp>
#include <boost/noncopyable.hpp>
#ifdef _WIN32
#define EVMONE_FILENAME "evmone.dll"
#define EVMONE_DOWNLOADLINK "https://github.com/ethereum/evmone/releases/download/v0.1.0/evmone-0.1.0-windows-amd64.zip"
#elif defined(__APPLE__)
#define EVMONE_FILENAME "libevmone.dylib"
#define EVMONE_DOWNLOADLINK "https://github.com/ethereum/evmone/releases/download/v0.1.0/evmone-0.1.0-darwin-x86_64.tar.gz"
#else
#define EVMONE_FILENAME "libevmone.so"
#define EVMONE_DOWNLOADLINK "https://github.com/ethereum/evmone/releases/download/v0.1.0/evmone-0.1.0-linux-x86_64.tar.gz"
#endif
namespace dev
{
+1 -1
View File
@@ -61,7 +61,7 @@ EVMHost::EVMHost(langutil::EVMVersion _evmVersion, evmc::vm* _vm):
{
if (!m_vm)
{
cerr << "Unable to find library libevmone.so" << endl;
cerr << "Unable to find evmone library" << endl;
assertThrow(false, Exception, "");
}
+2 -2
View File
@@ -143,9 +143,9 @@ test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] )
bool disableSemantics = !dev::test::EVMHost::getVM(dev::test::Options::get().evmonePath.string());
if (disableSemantics)
{
cout << "Unable to find libevmone.so. Please provide the path using -- --evmonepath <path>." << endl;
cout << "Unable to find " EVMONE_FILENAME ". Please provide the path using -- --evmonepath <path>." << endl;
cout << "You can download it at" << endl;
cout << "https://github.com/ethereum/evmone/releases/download/v0.1.0/evmone-0.1.0-linux-x86_64.tar.gz" << endl;
cout << EVMONE_DOWNLOADLINK << endl;
cout << endl << "--- SKIPPING ALL SEMANTICS TESTS ---" << endl << endl;
}
// Include the interactive tests in the automatic tests as well
+3 -3
View File
@@ -417,9 +417,9 @@ int main(int argc, char const *argv[])
bool disableSemantics = !dev::test::EVMHost::getVM(options.evmonePath.string());
if (disableSemantics)
{
cout << "Unable to find libevmone.so. Please provide the path using --evmonepath <path>." << endl;
cout << "Unable to find " EVMONE_FILENAME ". Please provide the path using --evmonepath <path>." << endl;
cout << "You can download it at" << endl;
cout << "https://github.com/ethereum/evmone/releases/download/v0.1.0/evmone-0.1.0-linux-x86_64.tar.gz" << endl;
cout << EVMONE_DOWNLOADLINK << endl;
cout << endl << "--- SKIPPING ALL SEMANTICS TESTS ---" << endl << endl;
}
@@ -462,7 +462,7 @@ int main(int argc, char const *argv[])
cout << "." << endl;
if (disableSemantics)
cout << "\nNOTE: Skipped semantics tests because libevmone.so could not be found.\n" << endl;
cout << "\nNOTE: Skipped semantics tests because " EVMONE_FILENAME " could not be found.\n" << endl;
return global_stats ? 0 : 1;
}