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
|
namespace test
|
||||||
{
|
{
|
||||||
|
|
||||||
boost::filesystem::path discoverTestPath()
|
boost::filesystem::path getTestPath()
|
||||||
{
|
{
|
||||||
|
if (auto path = getenv("ETH_TEST_PATH"))
|
||||||
|
return path;
|
||||||
|
|
||||||
auto const searchPath =
|
auto const searchPath =
|
||||||
{
|
{
|
||||||
fs::current_path() / ".." / ".." / ".." / "test",
|
fs::current_path() / ".." / ".." / ".." / "test",
|
||||||
|
@ -24,12 +24,13 @@ namespace dev
|
|||||||
namespace test
|
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.
|
/// and returns it if found.
|
||||||
/// The routine searches in the current directory, and inside the "test" directory
|
/// The routine searches in the current directory, and inside the "test" directory
|
||||||
/// starting from the current directory and up to three levels up.
|
/// 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.
|
/// @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;
|
ipcPath = path;
|
||||||
|
|
||||||
if (testPath.empty())
|
if (testPath.empty())
|
||||||
if (auto path = getenv("ETH_TEST_PATH"))
|
testPath = getTestPath();
|
||||||
testPath = path;
|
|
||||||
|
|
||||||
if (testPath.empty())
|
|
||||||
testPath = discoverTestPath();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Options::validate() const
|
void Options::validate() const
|
||||||
|
@ -336,6 +336,7 @@ int main(int argc, char *argv[])
|
|||||||
bool disableIPC = false;
|
bool disableIPC = false;
|
||||||
bool disableSMT = false;
|
bool disableSMT = false;
|
||||||
bool formatted = true;
|
bool formatted = true;
|
||||||
|
|
||||||
po::options_description options(
|
po::options_description options(
|
||||||
R"(isoltest, tool for interactively managing test contracts.
|
R"(isoltest, tool for interactively managing test contracts.
|
||||||
Usage: isoltest [Options] --ipcpath ipcpath
|
Usage: isoltest [Options] --ipcpath ipcpath
|
||||||
@ -344,6 +345,7 @@ Interactively validates test contracts.
|
|||||||
Allowed options)",
|
Allowed options)",
|
||||||
po::options_description::m_default_line_length,
|
po::options_description::m_default_line_length,
|
||||||
po::options_description::m_default_line_length - 23);
|
po::options_description::m_default_line_length - 23);
|
||||||
|
|
||||||
options.add_options()
|
options.add_options()
|
||||||
("help", "Show this help screen.")
|
("help", "Show this help screen.")
|
||||||
("testpath", po::value<fs::path>(&testPath), "path to test files")
|
("testpath", po::value<fs::path>(&testPath), "path to test files")
|
||||||
@ -396,7 +398,7 @@ Allowed options)",
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (testPath.empty())
|
if (testPath.empty())
|
||||||
testPath = dev::test::discoverTestPath();
|
testPath = dev::test::getTestPath();
|
||||||
|
|
||||||
TestStats global_stats{0, 0};
|
TestStats global_stats{0, 0};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user