Browse Source

Test: PityTest - test_processdirs updated

LIB-11
heck 11 months ago
parent
commit
3735aaf896
1 changed files with 69 additions and 85 deletions
  1. +69
    -85
      test/pitytest11/test/test_processdirs.cc

+ 69
- 85
test/pitytest11/test/test_processdirs.cc View File

@ -5,7 +5,12 @@
using namespace std;
using namespace pEp::PityTest11;
void printHomeDir(PityUnit<>& myself)
using TestContext = void;
using TestUnit = PityUnit<>;
//TODO: Add HOME testing
void printHomeDir(TestUnit& myself)
{
// TESTLOG(string(myself.getFQName() + " - PID: " + to_string(getpid())));
// cout << "[" << to_string(getpid()) << "/" << myself.getFQName() << "] - " << endl;
@ -16,98 +21,77 @@ void printHomeDir(PityUnit<>& myself)
int main(int argc, char* argv[])
{
PityUnit<>::debug_log_enabled = false;
PityUnit<> root = PityUnit<>{ "test_processdirs" };
TestUnit suite = TestUnit{ "test_processdirs" };
// 1
PityUnit<> test1 = PityUnit<>{ root, "node 1", [](PityUnit<>& mynode, void* ctx) {
PITYASSERT(
mynode.processDir() == "./pitytest_data/test_processdirs/",
"");
return 0;
} };
PityUnit<> test1_1 = PityUnit<>{ test1, "node 1.1", [](PityUnit<>& mynode, void* ctx) {
PITYASSERT(
mynode.processDir() == "./pitytest_data/test_processdirs/",
"");
return 0;
} };
suite
.addCopy(TestUnit(
"node 1",
[](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/", "node 1");
return 0;
}))
.addCopy(TestUnit("node 1.1", [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/", "node 1.1");
return 0;
}));
// 2
PityUnit<> test2 = PityUnit<>{ root, "node 2", [](PityUnit<>& mynode, void* ctx) {
PITYASSERT(
mynode.processDir() == "./pitytest_data/test_processdirs/",
"");
return 0;
} };
PityUnit<> test2_1 = PityUnit<>{
test2,
"node 2.1",
[](PityUnit<>& mynode, void* ctx) {
PITYASSERT(mynode.processDir() == "./pitytest_data/test_processdirs/node_2_1/", "");
suite
.addCopy(TestUnit(
"node 2",
[](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/", "node 2");
return 0;
}))
.addCopy(TestUnit(
"node 2.1",
[](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_2_1/", "");
return 0;
},
nullptr,
PityUnit<>::ExecutionMode::PROCESS_PARALLEL))
.addCopy(TestUnit("node 2.1.1", [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_2_1/", "");
return 0;
},
nullptr,
pEp::PityTest11::PityUnit<>::ExecutionMode::PROCESS_PARALLEL
};
PityUnit<> test2_1_1 = PityUnit<>{ test2_1, "node 2.1.1", [](PityUnit<> mynode, void* ctx) {
PITYASSERT(
mynode.processDir() ==
"./pitytest_data/test_processdirs/node_2_1/",
"");
return 0;
} };
}));
// 3
PityUnit<> test3 = PityUnit<>{
root,
"node 3",
[](PityUnit<>& mynode, void* ctx) {
PITYASSERT(mynode.processDir() == "./pitytest_data/test_processdirs/node_3/", "");
return 0;
},
nullptr,
PityUnit<>::ExecutionMode::PROCESS_PARALLEL
};
PityUnit<> test3_1 = PityUnit<>{ test3, "node 3.1", [](PityUnit<>& mynode, void* ctx) {
PITYASSERT(
mynode.processDir() ==
"./pitytest_data/test_processdirs/node_3/",
"");
return 0;
} };
PityUnit<> test3_1_1 = PityUnit<>{ test3_1, "node 3.1.1", [](PityUnit<>& mynode, void* ctx) {
PITYASSERT(
mynode.processDir() ==
"./pitytest_data/test_processdirs/node_3/",
"");
return 0;
} };
PityUnit<> test3_1_1_1 = PityUnit<>{
test3_1_1,
"node 3.1.1",
[](PityUnit<>& mynode, void* ctx) {
PITYASSERT(mynode.processDir() == "./pitytest_data/test_processdirs/node_3_1_1/", "");
return 0;
},
nullptr,
PityUnit<>::ExecutionMode::PROCESS_PARALLEL
};
PityUnit<> test3_1_1_1_1 = PityUnit<>{
test3_1_1_1,
"node 3.1.1.1",
[](PityUnit<>& mynode, void* ctx) {
PITYASSERT(mynode.processDir() == "./pitytest_data/test_processdirs/node_3_1_1/", "");
suite
.addCopy(TestUnit(
"node 3",
[](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_3/", "");
return 0;
},
nullptr,
PityUnit<>::ExecutionMode::PROCESS_PARALLEL))
.addCopy(TestUnit(
"node 3.1",
[](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_3/", "");
return 0;
}))
.addCopy(TestUnit(
"node 3.1.1",
[](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_3/", "");
return 0;
}))
.addCopy(TestUnit(
"node 3.1.1",
[](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_3_1_1/", "");
return 0;
},
nullptr,
PityUnit<>::ExecutionMode::PROCESS_PARALLEL))
.addCopy(TestUnit("node 3.1.1.1", [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_3_1_1/", "");
return 0;
}
};
}));
root.run();
suite.run();
}

Loading…
Cancel
Save