2016-08-02 16:32:03 +00:00
|
|
|
/*
|
2016-11-18 23:13:20 +00:00
|
|
|
This file is part of solidity.
|
2016-08-02 16:32:03 +00:00
|
|
|
|
2016-11-18 23:13:20 +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.
|
|
|
|
|
2016-11-18 23:13:20 +00:00
|
|
|
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
|
2016-11-18 23:13:20 +00:00
|
|
|
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-11-23 14:14:25 +00:00
|
|
|
else if (string(suite.argv[i]) == "--optimize")
|
|
|
|
optimize = true;
|
2016-12-06 17:38:59 +00:00
|
|
|
else if (string(suite.argv[i]) == "--show-messages")
|
|
|
|
showMessages = true;
|
2017-04-26 09:53:44 +00:00
|
|
|
else if (string(suite.argv[i]) == "--no-ipc")
|
|
|
|
disableIPC = true;
|
2017-09-28 08:28:41 +00:00
|
|
|
else if (string(suite.argv[i]) == "--no-smt")
|
|
|
|
disableSMT = true;
|
2016-11-23 14:14:25 +00:00
|
|
|
|
2017-04-26 09:53:44 +00:00
|
|
|
if (!disableIPC && ipcPath.empty())
|
2016-08-06 09:37:52 +00:00
|
|
|
if (auto path = getenv("ETH_TEST_IPC"))
|
|
|
|
ipcPath = path;
|
2016-08-02 16:32:03 +00:00
|
|
|
}
|