diff --git a/docs/contributing.rst b/docs/contributing.rst index 561f3f43e..a78d2e5d7 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -88,10 +88,11 @@ Solidity includes different types of tests, most of them bundled into the `Boost C++ Test Framework `_ 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 `_ and either place it in the project root path or inside the ``deps`` folder. diff --git a/test/Common.cpp b/test/Common.cpp index a6dd23e0b..bb6f63e7a 100644 --- a/test/Common.cpp +++ b/test/Common.cpp @@ -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(&this->testPath)->default_value(dev::test::testPath()), "path to test files") - ("evmonepath", po::value(&evmonePath)->default_value(EVMOneEnvOrDefaultPath()), "path to libevmone.so") + ("evmonepath", po::value(&evmonePath)->default_value(EVMOneEnvOrDefaultPath()), "path to " EVMONE_FILENAME) ("no-smt", po::bool_switch(&disableSMT), "disable SMT checker"); } diff --git a/test/Common.h b/test/Common.h index 6daf17675..4588ac28b 100644 --- a/test/Common.h +++ b/test/Common.h @@ -24,6 +24,17 @@ #include #include +#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 { diff --git a/test/EVMHost.cpp b/test/EVMHost.cpp index 5122f3846..19d8f6f77 100644 --- a/test/EVMHost.cpp +++ b/test/EVMHost.cpp @@ -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, ""); } diff --git a/test/boostTest.cpp b/test/boostTest.cpp index 87cc07525..b6a7fb8b5 100644 --- a/test/boostTest.cpp +++ b/test/boostTest.cpp @@ -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 ." << endl; + cout << "Unable to find " EVMONE_FILENAME ". Please provide the path using -- --evmonepath ." << 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 diff --git a/test/tools/isoltest.cpp b/test/tools/isoltest.cpp index aa3877695..9a6c1e9d5 100644 --- a/test/tools/isoltest.cpp +++ b/test/tools/isoltest.cpp @@ -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 ." << endl; + cout << "Unable to find " EVMONE_FILENAME ". Please provide the path using --evmonepath ." << 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; }