Browse Source

Test: PityTest - test_processdirs updated (Old/New API)

LIB-11
heck 11 months ago
parent
commit
9c164c4329
1 changed files with 49 additions and 46 deletions
  1. +49
    -46
      test/pitytest11/test/test_execmodes.cc

+ 49
- 46
test/pitytest11/test/test_execmodes.cc View File

@ -32,57 +32,60 @@ int main(int argc, char* argv[])
TestUnit::debug_log_enabled = false;
CTXExecmodes ctxe;
ctxe.sleepmilis = 100;
ctxe.rep_count = 100;
// Utils::readKey();
// The RootNode is the
TestUnit root = TestUnit{ "Test Execution Model" };
// Subprocess 1
TestUnit test1 = TestUnit{ "node1", do_some_work, &ctxe, TestUnit::ExecutionMode::PROCESS_PARALLEL };
TestUnit test1_1 = TestUnit{ "test1.1", do_some_work };
TestUnit test1_2 = TestUnit{ "test1.2", do_some_work };
root.add(test1);
test1.add(test1_1);
test1.add(test1_2);
// Subprocess 2
TestUnit test2 = TestUnit{ "node2", do_some_work, &ctxe, TestUnit::ExecutionMode::PROCESS_PARALLEL };
TestUnit test2_1 = TestUnit{ "test2.1", do_some_work };
TestUnit test2_2 = TestUnit{ "test2.2", do_some_work };
root.add(test2);
test2.add(test2_1);
test2.add(test2_2);
root.run();
/*
// The RootNode is the
TestUnit root = TestUnit{ "Test Execution Model" };
ctxe.rep_count = 10;
// NEW API
{
// Subprocess 1
TestUnit grp1 = TestUnit{ "grp1",
do_some_work,
&ctxe,
TestUnit::ExecutionMode::PROCESS_PARALLEL };
grp1.addCopy(TestUnit("test1.1", do_some_work));
grp1.addCopy(TestUnit("test1.2", do_some_work));
// Subprocess 2
TestUnit grp2 = TestUnit{ "grp2",
do_some_work,
&ctxe,
TestUnit::ExecutionMode::PROCESS_PARALLEL };
grp2.addCopy(TestUnit("unit_2.1", do_some_work));
grp2.addCopy(TestUnit("unit_2.2", do_some_work));
// Suite
TestUnit root = TestUnit{ "Test Execution Model" };
root.addRef(grp1);
root.addRef(grp2);
root.run();
}
// Old API
{
// The RootNode is the
TestUnit root_old = TestUnit{ "Test Execution Model" };
// Subprocess 1
TestUnit test1 = TestUnit{ root,
"node1",
do_some_work,
&ctxe,
TestUnit::ExecutionMode::PROCESS_PARALLEL };
// Subprocess 1
TestUnit test1 = TestUnit{ root_old,
"node1",
do_some_work,
&ctxe,
TestUnit::ExecutionMode::PROCESS_PARALLEL };
TestUnit test1_1 = TestUnit{ test1, "test1.1", do_some_work };
TestUnit test1_1 = TestUnit{ test1, "test1.1", do_some_work };
TestUnit test1_2 = TestUnit{ test1, "test1.2", do_some_work };
TestUnit test1_2 = TestUnit{ test1, "test1.2", do_some_work };
// Subprocess 2
TestUnit test2 = TestUnit{ root,
"node2",
do_some_work,
&ctxe,
TestUnit::ExecutionMode::PROCESS_PARALLEL };
// Subprocess 2
TestUnit test2 = TestUnit{ root_old,
"node2",
do_some_work,
&ctxe,
TestUnit::ExecutionMode::PROCESS_PARALLEL };
TestUnit test2_1 = TestUnit{ test2, "test2.1", do_some_work };
TestUnit test2_1 = TestUnit{ test2, "test2.1", do_some_work };
TestUnit test2_2 = TestUnit{ test2, "test2.2", do_some_work };
TestUnit test2_2 = TestUnit{ test2, "test2.2", do_some_work };
root.run();
*/
root_old.run();
}
}

Loading…
Cancel
Save