Browse Source

Tests: update test_processdirs

master
heck 4 years ago
parent
commit
f469f2fcd5
  1. 62
      test/test_processdirs.cc

62
test/test_processdirs.cc

@ -24,16 +24,22 @@ int main(int argc, char* argv[])
// Suite // Suite
TestUnit suite = TestUnit{ "test_processdirs" }; TestUnit suite = TestUnit{ "test_processdirs" };
std::string base = TestUnit::getGlobalRootDir() + "test_processdirs/";
// 1 // 1
suite suite
.addNew<TestUnit>( .addNew<TestUnit>(
"node 1", "node 1",
[](TestUnit& pity, TestContext* ctx) { [=](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/", "node 1"); PITYASSERT(
pity.getProcessDir() == TestUnit::getGlobalRootDir() + "test_processdirs/",
pity.getProcessDir());
return 0; return 0;
}) })
->addNew<TestUnit>("node 1.1", [](TestUnit& pity, TestContext* ctx) { ->addNew<TestUnit>("node 1.1", [=](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/", "node 1.1"); PITYASSERT(
pity.getProcessDir() == TestUnit::getGlobalRootDir() + "test_processdirs/",
pity.getProcessDir());
return 0; return 0;
}); });
@ -41,30 +47,40 @@ int main(int argc, char* argv[])
suite suite
.addNew<TestUnit>( .addNew<TestUnit>(
"node 2", "node 2",
[](TestUnit& pity, TestContext* ctx) { [=](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/", "node 2"); PITYASSERT(
pity.getProcessDir() == TestUnit::getGlobalRootDir() + "test_processdirs/",
pity.getProcessDir());
return 0; return 0;
}) })
->addNew<TestUnit>( ->addNew<TestUnit>(
"node 2.1", "node 2.1",
[](TestUnit& pity, TestContext* ctx) { [=](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_2_1/", ""); PITYASSERT(
pity.getProcessDir() ==
TestUnit::getGlobalRootDir() + "test_processdirs_node_2_node_2_1/",
pity.getProcessDir());
return 0; return 0;
}, },
nullptr, nullptr,
PityUnit<>::ExecutionMode::PROCESS_PARALLEL) PityUnit<>::ExecutionMode::PROCESS_PARALLEL)
->addNew<TestUnit>("node 2.1.1", [](TestUnit& pity, TestContext* ctx) { ->addNew<TestUnit>("node 2.1.1", [=](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_2_1/", ""); PITYASSERT(
pity.getProcessDir() ==
TestUnit::getGlobalRootDir() + "test_processdirs_node_2_node_2_1/",
pity.getProcessDir());
return 0; return 0;
}); });
// 3 //3
suite suite
.addNew<TestUnit>( .addNew<TestUnit>(
"node 3", "node 3",
[](TestUnit& pity, TestContext* ctx) { [=](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; return 0;
}, },
nullptr, nullptr,
@ -72,25 +88,33 @@ int main(int argc, char* argv[])
->addNew<TestUnit>( ->addNew<TestUnit>(
"node 3.1", "node 3.1",
[](TestUnit& pity, TestContext* ctx) { [](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; return 0;
}) })
->addNew<TestUnit>( ->addNew<TestUnit>(
"node 3.1.1", "node 3.1.1",
[](TestUnit& pity, TestContext* ctx) { [](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; return 0;
}) })
->addNew<TestUnit>( ->addNew<TestUnit>(
"node 3.1.1", "node 3.1.1.1",
[](TestUnit& pity, TestContext* ctx) { [](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; return 0;
}, },
nullptr, nullptr,
PityUnit<>::ExecutionMode::PROCESS_PARALLEL) PityUnit<>::ExecutionMode::PROCESS_PARALLEL)
->addNew<TestUnit>("node 3.1.1.1", [](TestUnit& pity, TestContext* ctx) { ->addNew<TestUnit>("node 3.1.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; return 0;
}); });

Loading…
Cancel
Save