SimpleKernel 1.17.0
Loading...
Searching...
No Matches
task_test_harness.hpp
Go to the documentation of this file.
1
5#ifndef SIMPLEKERNEL_TESTS_UNIT_TEST_TASK_FIXTURES_TASK_TEST_HARNESS_HPP_
6#define SIMPLEKERNEL_TESTS_UNIT_TEST_TASK_FIXTURES_TASK_TEST_HARNESS_HPP_
7
8#include <gtest/gtest.h>
9
10#include <cstddef>
11
13
19class TaskTestHarness : public ::testing::Test {
20 protected:
21 void SetUp() override;
22 void TearDown() override;
23
27 void SetNumCores(size_t num_cores) { num_cores_ = num_cores; }
28
35
36 size_t num_cores_ = 1; // 默认单核
37 test_env::TestEnvironmentState env_state_; // 每个测试独立的环境
38};
39
40#endif /* SIMPLEKERNEL_TESTS_UNIT_TEST_TASK_FIXTURES_TASK_TEST_HARNESS_HPP_ */
Task 模块单元测试的基类 Fixture.
void TearDown() override
void SetNumCores(size_t num_cores)
设置测试使用的核心数量(在 SetUp 前调用)
void SetUp() override
auto GetEnvironmentState() -> test_env::TestEnvironmentState &
获取环境层状态
test_env::TestEnvironmentState env_state_