MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / TestingSetup

Method TestingSetup

src/tests/test_coin.cpp:22–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21struct TestingSetup {
22 TestingSetup() {
23 int argc = 2;
24 string param1("coind.exe");
25 string param2("");
26
27 bool bSetDataDir(false);
28 for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i) {
29 string strArgv = boost::unit_test::framework::master_test_suite().argv[i];
30 if (string::npos != strArgv.find("-datadir=")) {
31 param1 = boost::unit_test::framework::master_test_suite().argv[0];
32 param2 = strArgv.c_str();
33 bSetDataDir = true;
34 break;
35 }
36 }
37 if (!bSetDataDir) {
38 string strCurDir = GetDefaultDataDir().string();
39#ifdef WIN32
40 strCurDir += "\\coin_test";
41 param2 = "-datadir=";
42 param2 += strCurDir;
43
44#else
45 strCurDir += "/coin_test";
46 boost::filesystem::create_directories(strCurDir);
47 param2 = "-datadir=";
48 param2 += strCurDir;
49#endif
50 }
51 const char* argv[] = {param1.c_str(), param2.c_str()};
52 SysTestBase::StartServer(argc, argv);
53 }
54 ~TestingSetup() { SysTestBase::StopServer(); }
55
56 // boost::filesystem::remove_all(pathTemp);

Callers

nothing calls this directly

Calls 2

GetDefaultDataDirFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected