solidity/test/TestHelper.cpp

46 lines
1.2 KiB
C++
Raw Normal View History

2016-08-02 16:32:03 +00:00
/*
This file is part of solidity.
2016-08-02 16:32:03 +00:00
solidity is free software: you can redistribute it and/or modify
2016-08-02 16:32:03 +00:00
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
solidity is distributed in the hope that it will be useful,
2016-08-02 16:32:03 +00:00
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with solidity. If not, see <http://www.gnu.org/licenses/>.
2016-08-02 16:32:03 +00:00
*/
/** @file TestHelper.h
* @author Marko Simovic <markobarko@gmail.com>
* @date 2014
*/
#include <boost/test/framework.hpp>
#include "TestHelper.h"
using namespace std;
using namespace dev::test;
2016-08-06 09:37:52 +00:00
Options const& Options::get()
2016-08-02 16:32:03 +00:00
{
2016-08-06 09:37:52 +00:00
static Options instance;
return instance;
}
Options::Options()
{
auto const& suite = boost::unit_test::framework::master_test_suite();
for (auto i = 0; i < suite.argc; i++)
2016-08-29 12:21:49 +00:00
if (string(suite.argv[i]) == "--ipcpath" && i + 1 < suite.argc)
2016-08-02 16:32:03 +00:00
{
2016-08-06 09:37:52 +00:00
ipcPath = suite.argv[i + 1];
2016-08-02 16:32:03 +00:00
i++;
}
2016-08-06 09:37:52 +00:00
if (ipcPath.empty())
if (auto path = getenv("ETH_TEST_IPC"))
ipcPath = path;
2016-08-02 16:32:03 +00:00
}