425 {
426 klog::Info(
"===== Clone System Test Start =====");
427
428 g_tests_completed = 0;
429 g_tests_failed = 0;
430
431 auto& task_mgr = TaskManagerSingleton::instance();
432
433 auto test1 = kstd::make_unique<TaskControlBlock>("TestCloneProcess", 10,
434 test_clone_process, nullptr);
435 task_mgr.AddTask(std::move(test1));
436
437 auto test2 = kstd::make_unique<TaskControlBlock>("TestCloneThread", 10,
438 test_clone_thread, nullptr);
439 task_mgr.AddTask(std::move(test2));
440
441 auto test3 = kstd::make_unique<TaskControlBlock>(
442 "TestCloneParentFlag", 10, test_clone_parent_flag, nullptr);
443 task_mgr.AddTask(std::move(test3));
444
445 auto test4 = kstd::make_unique<TaskControlBlock>(
446 "TestCloneFlagsAutoCompletion", 10, test_clone_flags_auto_completion,
447 nullptr);
448 task_mgr.AddTask(std::move(test4));
449
450 int timeout = 200;
451 while (timeout > 0) {
453 if (g_tests_completed >= 4) {
454 break;
455 }
456 timeout--;
457 }
458
459 EXPECT_EQ(g_tests_completed, 4,
"tests completed");
460 EXPECT_EQ(g_tests_failed, 0,
"tests failed");
461
462 klog::Info(
"Clone System Test Suite: COMPLETED");
463 return true;
464}
auto Info(etl::format_string< Args... > fmt, Args &&... args) -> void
以 INFO 级别记录日志
auto sys_sleep(uint64_t ms) -> int
休眠指定毫秒数
#define EXPECT_EQ(val1, val2, msg)