aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityExecutionFramework.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/SolidityExecutionFramework.cpp')
-rw-r--r--test/libsolidity/SolidityExecutionFramework.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/test/libsolidity/SolidityExecutionFramework.cpp b/test/libsolidity/SolidityExecutionFramework.cpp
index 7ea81888..8c026ffd 100644
--- a/test/libsolidity/SolidityExecutionFramework.cpp
+++ b/test/libsolidity/SolidityExecutionFramework.cpp
@@ -20,40 +20,39 @@
* Framework for executing Solidity contracts and testing them against C++ implementation.
*/
+#include <cstdlib>
#include <boost/test/framework.hpp>
#include <test/libsolidity/SolidityExecutionFramework.h>
-
using namespace std;
using namespace dev;
using namespace dev::solidity;
using namespace dev::solidity::test;
-ExecutionFramework::boostArg::boostArg()
+string getIPCSocketPath()
{
+ string ipcPath;
+
size_t argc = boost::unit_test::framework::master_test_suite().argc;
char** argv = boost::unit_test::framework::master_test_suite().argv;
for (size_t i = 0; i < argc; i++)
{
string arg = argv[i];
- if (arg == "--ipc" && i+1 < argc)
+ if (arg == "--ipc" && i + 1 < argc)
{
- ipcPath = argv[i+1];
+ ipcPath = argv[i + 1];
i++;
}
}
if (ipcPath.empty())
+ ipcPath = getenv("ETH_TEST_IPC");
+ if (ipcPath.empty())
BOOST_FAIL("ERROR: ipcPath not set! (use --ipc <path>)");
-}
-
-ExecutionFramework::boostArg const& ExecutionFramework::getArgs()
-{
- static boostArg boostArgs;
- return boostArgs;
+ return ipcPath;
}
ExecutionFramework::ExecutionFramework() :
- m_rpc(RPCSession::instance(getArgs().ipcPath)),
+ m_rpc(RPCSession::instance(getIPCSocketPath())),
m_sender(m_rpc.account(0))
{
if (g_logVerbosity != -1)