diff --git a/test/test_processdirs.cc b/test/test_processdirs.cc index a51908c..f193860 100644 --- a/test/test_processdirs.cc +++ b/test/test_processdirs.cc @@ -24,16 +24,22 @@ int main(int argc, char* argv[]) // Suite TestUnit suite = TestUnit{ "test_processdirs" }; + + std::string base = TestUnit::getGlobalRootDir() + "test_processdirs/"; // 1 suite .addNew( "node 1", - [](TestUnit& pity, TestContext* ctx) { - PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/", "node 1"); + [=](TestUnit& pity, TestContext* ctx) { + PITYASSERT( + pity.getProcessDir() == TestUnit::getGlobalRootDir() + "test_processdirs/", + pity.getProcessDir()); return 0; }) - ->addNew("node 1.1", [](TestUnit& pity, TestContext* ctx) { - PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/", "node 1.1"); + ->addNew("node 1.1", [=](TestUnit& pity, TestContext* ctx) { + PITYASSERT( + pity.getProcessDir() == TestUnit::getGlobalRootDir() + "test_processdirs/", + pity.getProcessDir()); return 0; }); @@ -41,30 +47,40 @@ int main(int argc, char* argv[]) suite .addNew( "node 2", - [](TestUnit& pity, TestContext* ctx) { - PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/", "node 2"); + [=](TestUnit& pity, TestContext* ctx) { + PITYASSERT( + pity.getProcessDir() == TestUnit::getGlobalRootDir() + "test_processdirs/", + pity.getProcessDir()); return 0; }) ->addNew( "node 2.1", - [](TestUnit& pity, TestContext* ctx) { - PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_2_1/", ""); + [=](TestUnit& pity, TestContext* ctx) { + PITYASSERT( + pity.getProcessDir() == + TestUnit::getGlobalRootDir() + "test_processdirs_node_2_node_2_1/", + pity.getProcessDir()); return 0; }, nullptr, PityUnit<>::ExecutionMode::PROCESS_PARALLEL) - ->addNew("node 2.1.1", [](TestUnit& pity, TestContext* ctx) { - PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_2_1/", ""); + ->addNew("node 2.1.1", [=](TestUnit& pity, TestContext* ctx) { + PITYASSERT( + pity.getProcessDir() == + TestUnit::getGlobalRootDir() + "test_processdirs_node_2_node_2_1/", + pity.getProcessDir()); return 0; }); - // 3 + //3 suite .addNew( "node 3", - [](TestUnit& pity, TestContext* ctx) { - PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_3/", ""); + [=](TestUnit& pity, TestContext* ctx) { + PITYASSERT( + pity.getProcessDir() == TestUnit::getGlobalRootDir() + "test_processdirs_node_3/", + pity.getProcessDir()); return 0; }, nullptr, @@ -72,25 +88,33 @@ int main(int argc, char* argv[]) ->addNew( "node 3.1", [](TestUnit& pity, TestContext* ctx) { - PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_3/", ""); + PITYASSERT( + pity.getProcessDir() == TestUnit::getGlobalRootDir() + "test_processdirs_node_3/", + pity.getProcessDir()); return 0; }) ->addNew( "node 3.1.1", [](TestUnit& pity, TestContext* ctx) { - PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_3/", ""); + PITYASSERT( + pity.getProcessDir() == TestUnit::getGlobalRootDir() + "test_processdirs_node_3/", + pity.getProcessDir()); return 0; }) ->addNew( - "node 3.1.1", + "node 3.1.1.1", [](TestUnit& pity, TestContext* ctx) { - PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_3_1_1/", ""); + PITYASSERT( + pity.getProcessDir() == TestUnit::getGlobalRootDir() + "test_processdirs_node_3_node_3_1_node_3_1_1_node_3_1_1_1/", + pity.getProcessDir()); return 0; }, nullptr, PityUnit<>::ExecutionMode::PROCESS_PARALLEL) - ->addNew("node 3.1.1.1", [](TestUnit& pity, TestContext* ctx) { - PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_3_1_1/", ""); + ->addNew("node 3.1.1.1.1", [](TestUnit& pity, TestContext* ctx) { + PITYASSERT( + pity.getProcessDir() == TestUnit::getGlobalRootDir() + "test_processdirs_node_3_node_3_1_node_3_1_1_node_3_1_1_1/", + pity.getProcessDir()); return 0; });