mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Extract function.
This commit is contained in:
parent
51db4f5411
commit
9081f803c7
@ -256,6 +256,9 @@ TestStats TestTool::processPath(
|
||||
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
void setupTerminal()
|
||||
{
|
||||
#if defined(_WIN32) && defined(ENABLE_VIRTUAL_TERMINAL_PROCESSING)
|
||||
@ -276,6 +279,27 @@ void setupTerminal()
|
||||
#endif
|
||||
}
|
||||
|
||||
fs::path discoverTestPath()
|
||||
{
|
||||
auto const searchPath =
|
||||
{
|
||||
fs::current_path() / ".." / ".." / ".." / "test",
|
||||
fs::current_path() / ".." / ".." / "test",
|
||||
fs::current_path() / ".." / "test",
|
||||
fs::current_path() / "test",
|
||||
fs::current_path()
|
||||
};
|
||||
for (auto const& basePath: searchPath)
|
||||
{
|
||||
fs::path syntaxTestPath = basePath / "libsolidity" / "syntaxTests";
|
||||
if (fs::exists(syntaxTestPath) && fs::is_directory(syntaxTestPath))
|
||||
return basePath;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
setupTerminal();
|
||||
@ -326,25 +350,7 @@ Allowed options)",
|
||||
}
|
||||
|
||||
if (testPath.empty())
|
||||
{
|
||||
auto const searchPath =
|
||||
{
|
||||
fs::current_path() / ".." / ".." / ".." / "test",
|
||||
fs::current_path() / ".." / ".." / "test",
|
||||
fs::current_path() / ".." / "test",
|
||||
fs::current_path() / "test",
|
||||
fs::current_path()
|
||||
};
|
||||
for (auto const& basePath : searchPath)
|
||||
{
|
||||
fs::path syntaxTestPath = basePath / "libsolidity" / "syntaxTests";
|
||||
if (fs::exists(syntaxTestPath) && fs::is_directory(syntaxTestPath))
|
||||
{
|
||||
testPath = basePath;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
testPath = discoverTestPath();
|
||||
|
||||
TestStats global_stats { 0, 0 };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user