mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use env variable to get IPC path for isoltest
This commit is contained in:
parent
27d936cf44
commit
f4110b295b
@ -26,8 +26,11 @@ namespace dev
|
||||
namespace test
|
||||
{
|
||||
|
||||
boost::filesystem::path discoverTestPath()
|
||||
boost::filesystem::path getTestPath()
|
||||
{
|
||||
if (auto path = getenv("ETH_TEST_PATH"))
|
||||
return path;
|
||||
|
||||
auto const searchPath =
|
||||
{
|
||||
fs::current_path() / ".." / ".." / ".." / "test",
|
||||
|
@ -24,12 +24,13 @@ namespace dev
|
||||
namespace test
|
||||
{
|
||||
|
||||
/// Tries to find a path that contains the directories "libsolidity/syntaxTests"
|
||||
/// First checks the environment variable ETH_TEST_PATH. If empty,
|
||||
/// tries to find a path that contains the directories "libsolidity/syntaxTests"
|
||||
/// and returns it if found.
|
||||
/// The routine searches in the current directory, and inside the "test" directory
|
||||
/// starting from the current directory and up to three levels up.
|
||||
/// @returns the path of the first match or an empty path if not found.
|
||||
boost::filesystem::path discoverTestPath();
|
||||
boost::filesystem::path getTestPath();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -74,11 +74,7 @@ Options::Options()
|
||||
ipcPath = path;
|
||||
|
||||
if (testPath.empty())
|
||||
if (auto path = getenv("ETH_TEST_PATH"))
|
||||
testPath = path;
|
||||
|
||||
if (testPath.empty())
|
||||
testPath = discoverTestPath();
|
||||
testPath = getTestPath();
|
||||
}
|
||||
|
||||
void Options::validate() const
|
||||
|
@ -336,6 +336,7 @@ int main(int argc, char *argv[])
|
||||
bool disableIPC = false;
|
||||
bool disableSMT = false;
|
||||
bool formatted = true;
|
||||
|
||||
po::options_description options(
|
||||
R"(isoltest, tool for interactively managing test contracts.
|
||||
Usage: isoltest [Options] --ipcpath ipcpath
|
||||
@ -344,6 +345,7 @@ Interactively validates test contracts.
|
||||
Allowed options)",
|
||||
po::options_description::m_default_line_length,
|
||||
po::options_description::m_default_line_length - 23);
|
||||
|
||||
options.add_options()
|
||||
("help", "Show this help screen.")
|
||||
("testpath", po::value<fs::path>(&testPath), "path to test files")
|
||||
@ -396,7 +398,7 @@ Allowed options)",
|
||||
}
|
||||
|
||||
if (testPath.empty())
|
||||
testPath = dev::test::discoverTestPath();
|
||||
testPath = dev::test::getTestPath();
|
||||
|
||||
TestStats global_stats{0, 0};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user