Skip to content

Commit f846ad0

Browse files
committed
fix: update test CMakeLists for role models
1. Added rolecombinemodel.h and rolecombinemodel.cpp source files to rolecombinemodel_tests target 2. Added rolegroupmodel.h and rolegroupmodel.cpp source files to rolegroupmodel_tests target 3. Added Qt${QT_VERSION_MAJOR}::Gui dependency to both test targets 4. Removed dock-taskmanager library dependency from rolecombinemodel_tests 5. Commented out dock-taskmanager library dependency from rolegroupmodel_tests These changes fix the test build configuration by including the actual source files directly in the test targets instead of linking against the dock-taskmanager library. This ensures the tests can properly compile and link the rolecombinemodel and rolegroupmodel implementations. The Qt Gui module was added as a dependency since these models likely require GUI components. Influence: 1. Verify that rolecombinemodel_tests and rolegroupmodel_tests can be built successfully 2. Test that all unit tests pass after the build configuration changes 3. Ensure no linking errors occur due to missing dependencies 4. Confirm that the test executables run without crashes fix: 更新角色模型的测试CMakeLists配置 1. 将rolecombinemodel.h和rolecombinemodel.cpp源文件添加到 rolecombinemodel_tests目标 2. 将rolegroupmodel.h和rolegroupmodel.cpp源文件添加到 rolegroupmodel_tests目标 3. 为两个测试目标添加Qt${QT_VERSION_MAJOR}::Gui依赖 4. 从rolecombinemodel_tests中移除dock-taskmanager库依赖 5. 从rolegroupmodel_tests中注释掉dock-taskmanager库依赖 这些更改修复了测试构建配置,通过直接将实际源文件包含在测试目标中,而不 是链接到dock-taskmanager库。这确保测试能够正确编译和链接rolecombinemodel 和rolegroupmodel的实现。添加了Qt Gui模块依赖,因为这些模型可能需要GUI 组件。 Influence: 1. 验证rolecombinemodel_tests和rolegroupmodel_tests能够成功构建 2. 测试构建配置更改后所有单元测试是否通过 3. 确保不会因缺少依赖而发生链接错误 4. 确认测试可执行文件运行不会崩溃
1 parent d84337c commit f846ad0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/panels/dock/taskmanager/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Co
88
include(GoogleTest)
99

1010
add_executable(rolecombinemodel_tests
11+
${CMAKE_SOURCE_DIR}/panels/dock/taskmanager/rolecombinemodel.h
12+
${CMAKE_SOURCE_DIR}/panels/dock/taskmanager/rolecombinemodel.cpp
1113
combinemodela.cpp
1214
combinemodela.h
1315
combinemodelb.cpp
@@ -19,8 +21,8 @@ target_link_libraries(rolecombinemodel_tests
1921
GTest::GTest
2022
GTest::Main
2123
Qt${QT_VERSION_MAJOR}::Core
24+
Qt${QT_VERSION_MAJOR}::Gui
2225
Qt${QT_VERSION_MAJOR}::Test
23-
dock-taskmanager
2426
)
2527
target_include_directories(rolecombinemodel_tests PRIVATE
2628
${CMAKE_SOURCE_DIR}/panels/dock/taskmanager/
@@ -29,15 +31,18 @@ target_include_directories(rolecombinemodel_tests PRIVATE
2931
gtest_discover_tests(rolecombinemodel_tests)
3032

3133
add_executable(rolegroupmodel_tests
34+
${CMAKE_SOURCE_DIR}/panels/dock/taskmanager/rolegroupmodel.h
35+
${CMAKE_SOURCE_DIR}/panels/dock/taskmanager/rolegroupmodel.cpp
3236
rolegroupmodeltests.cpp
3337
)
3438

3539
target_link_libraries(rolegroupmodel_tests
3640
GTest::GTest
3741
GTest::Main
3842
Qt${QT_VERSION_MAJOR}::Core
43+
Qt${QT_VERSION_MAJOR}::Gui
3944
Qt${QT_VERSION_MAJOR}::Test
40-
dock-taskmanager
45+
# dock-taskmanager
4146
)
4247
target_include_directories(rolegroupmodel_tests PRIVATE
4348
${CMAKE_SOURCE_DIR}/panels/dock/taskmanager/

0 commit comments

Comments
 (0)