Browse Source

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

LIB-11
heck 4 years ago
parent
commit
9c164c4329
  1. 55
      test/pitytest11/test/test_execmodes.cc

55
test/pitytest11/test/test_execmodes.cc

@ -32,37 +32,40 @@ int main(int argc, char* argv[])
TestUnit::debug_log_enabled = false; TestUnit::debug_log_enabled = false;
CTXExecmodes ctxe; CTXExecmodes ctxe;
ctxe.sleepmilis = 100; ctxe.sleepmilis = 100;
ctxe.rep_count = 100; ctxe.rep_count = 10;
// Utils::readKey();
// The RootNode is the
TestUnit root = TestUnit{ "Test Execution Model" };
// NEW API
{
// Subprocess 1 // Subprocess 1
TestUnit test1 = TestUnit{ "node1", do_some_work, &ctxe, TestUnit::ExecutionMode::PROCESS_PARALLEL }; TestUnit grp1 = TestUnit{ "grp1",
TestUnit test1_1 = TestUnit{ "test1.1", do_some_work }; do_some_work,
TestUnit test1_2 = TestUnit{ "test1.2", do_some_work }; &ctxe,
TestUnit::ExecutionMode::PROCESS_PARALLEL };
root.add(test1); grp1.addCopy(TestUnit("test1.1", do_some_work));
test1.add(test1_1); grp1.addCopy(TestUnit("test1.2", do_some_work));
test1.add(test1_2);
// Subprocess 2 // Subprocess 2
TestUnit test2 = TestUnit{ "node2", do_some_work, &ctxe, TestUnit::ExecutionMode::PROCESS_PARALLEL }; TestUnit grp2 = TestUnit{ "grp2",
TestUnit test2_1 = TestUnit{ "test2.1", do_some_work }; do_some_work,
TestUnit test2_2 = TestUnit{ "test2.2", do_some_work }; &ctxe,
root.add(test2); TestUnit::ExecutionMode::PROCESS_PARALLEL };
test2.add(test2_1); grp2.addCopy(TestUnit("unit_2.1", do_some_work));
test2.add(test2_2); grp2.addCopy(TestUnit("unit_2.2", do_some_work));
root.run();
/* // Suite
// The RootNode is the
TestUnit root = TestUnit{ "Test Execution Model" }; 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 // Subprocess 1
TestUnit test1 = TestUnit{ root, TestUnit test1 = TestUnit{ root_old,
"node1", "node1",
do_some_work, do_some_work,
&ctxe, &ctxe,
@ -73,7 +76,7 @@ int main(int argc, char* argv[])
TestUnit test1_2 = TestUnit{ test1, "test1.2", do_some_work }; TestUnit test1_2 = TestUnit{ test1, "test1.2", do_some_work };
// Subprocess 2 // Subprocess 2
TestUnit test2 = TestUnit{ root, TestUnit test2 = TestUnit{ root_old,
"node2", "node2",
do_some_work, do_some_work,
&ctxe, &ctxe,
@ -83,6 +86,6 @@ int main(int argc, char* argv[])
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