mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix evmone filename for auto-discovery for windows and macos.
This commit is contained in:
parent
5063e53730
commit
733d40ddb5
@ -88,10 +88,11 @@ Solidity includes different types of tests, most of them bundled into the
|
||||
`Boost C++ Test Framework <https://www.boost.org/doc/libs/1_69_0/libs/test/doc/html/index.html>`_ application ``soltest``.
|
||||
Running ``build/test/soltest` or its wrapper ``scripts/soltest.sh`` is sufficient for most changes.
|
||||
|
||||
Some tests require the ``libevmone.so`` library, others require ``libz3``.
|
||||
Some tests require the ``evmone`` library, others require ``libz3``.
|
||||
|
||||
The test system will automatically try to discover the location of ``libevmone.so``
|
||||
starting from the current directory. If it does not find it, the relevant tests
|
||||
The test system will automatically try to discover the location of the ``evmone`` library
|
||||
starting from the current directory. The required file is called ``libevmone.so`` on Linux systems,
|
||||
``evmone.dll`` on Windows systems and ``libevmone.dylib`` on MacOS. If it is not found, the relevant tests
|
||||
are skipped. To run all tests, download the library from
|
||||
`Github <https://github.com/ethereum/evmone/releases/tag/v0.1.0>`_
|
||||
and either place it in the project root path or inside the ``deps`` folder.
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
|
||||
|
@ -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, "");
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user