Browse Source

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

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

95
test/pitytest11/test/test_execmodes.cc

@ -32,57 +32,60 @@ 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();
// NEW API
// The RootNode is the {
TestUnit root = TestUnit{ "Test Execution Model" }; // Subprocess 1
TestUnit grp1 = TestUnit{ "grp1",
// Subprocess 1 do_some_work,
TestUnit test1 = TestUnit{ "node1", do_some_work, &ctxe, TestUnit::ExecutionMode::PROCESS_PARALLEL }; &ctxe,
TestUnit test1_1 = TestUnit{ "test1.1", do_some_work }; TestUnit::ExecutionMode::PROCESS_PARALLEL };
TestUnit test1_2 = TestUnit{ "test1.2", do_some_work }; grp1.addCopy(TestUnit("test1.1", do_some_work));
grp1.addCopy(TestUnit("test1.2", do_some_work));
root.add(test1);
test1.add(test1_1); // Subprocess 2
test1.add(test1_2); TestUnit grp2 = TestUnit{ "grp2",
do_some_work,
// Subprocess 2 &ctxe,
TestUnit test2 = TestUnit{ "node2", do_some_work, &ctxe, TestUnit::ExecutionMode::PROCESS_PARALLEL }; TestUnit::ExecutionMode::PROCESS_PARALLEL };
TestUnit test2_1 = TestUnit{ "test2.1", do_some_work }; grp2.addCopy(TestUnit("unit_2.1", do_some_work));
TestUnit test2_2 = TestUnit{ "test2.2", do_some_work }; grp2.addCopy(TestUnit("unit_2.2", do_some_work));
root.add(test2);
test2.add(test2_1); // Suite
test2.add(test2_2); TestUnit root = TestUnit{ "Test Execution Model" };
root.addRef(grp1);
root.run(); root.addRef(grp2);
/* root.run();
// The RootNode is the }
TestUnit root = TestUnit{ "Test Execution Model" }; // 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,
TestUnit::ExecutionMode::PROCESS_PARALLEL }; 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 // Subprocess 2
TestUnit test2 = TestUnit{ root, TestUnit test2 = TestUnit{ root_old,
"node2", "node2",
do_some_work, do_some_work,
&ctxe, &ctxe,
TestUnit::ExecutionMode::PROCESS_PARALLEL }; 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