243 {
244 klog::Info(
"=== Thread Group System Test Suite ===");
245
246 g_tests_completed = 0;
247 g_tests_failed = 0;
248
249
250 auto test1 = kstd::make_unique<TaskControlBlock>(
251 "TestThreadGroupBasic", 10, test_thread_group_basic, nullptr);
252 TaskManagerSingleton::instance().AddTask(std::move(test1));
253
254
255 auto test2 = kstd::make_unique<TaskControlBlock>(
256 "TestThreadGroupDynamic", 10, test_thread_group_dynamic, nullptr);
257 TaskManagerSingleton::instance().AddTask(std::move(test2));
258
259
260 auto test3 = kstd::make_unique<TaskControlBlock>(
261 "TestThreadGroupConcurrentExit", 10, test_thread_group_concurrent_exit,
262 nullptr);
263 TaskManagerSingleton::instance().AddTask(std::move(test3));
264
265
266 constexpr int kExpectedTests = 3;
267 int timeout = 400;
268 while (timeout > 0) {
270 if (g_tests_completed >= kExpectedTests) {
271 break;
272 }
273 timeout--;
274 }
275
276 EXPECT_EQ(g_tests_completed.load(), kExpectedTests,
277 "All thread group tests should complete");
278 EXPECT_EQ(g_tests_failed.load(), 0,
"No thread group tests should fail");
279
280 klog::Info(
"Thread Group System Test Suite: COMPLETED");
281 return true;
282}
auto Info(etl::format_string< Args... > fmt, Args &&... args) -> void
以 INFO 级别记录日志
auto sys_sleep(uint64_t ms) -> int
休眠指定毫秒数
#define EXPECT_EQ(val1, val2, msg)