Skip to content

Commit 24982ba

Browse files
committed
fix: set RPATH for taskmanager test executables
Added RPATH configuration for rolecombinemodel_tests and rolegroupmodel_tests executables to ensure they can find required shared libraries at runtime during testing. This includes setting BUILD_RPATH to point to the build directories containing the taskmanager plugin and frame libraries, and adding explicit linker flags with -rpath options. The changes address runtime linking issues that could occur when running tests directly from the build directory without installation. Influence: 1. Verify that both test executables can run successfully from build directory 2. Test that the executables can locate and load required shared libraries 3. Confirm no linker errors occur during test execution 4. Validate that RPATH settings don't interfere with installed version behavior fix: 为任务管理器测试可执行文件设置 RPATH 为 rolecombinemodel_tests 和 rolegroupmodel_tests 可执行文件添加了 RPATH 配置,确保它们在测试运行时能够找到所需的共享库。这包括设置 BUILD_RPATH 指向包含任务管理器插件和框架库的构建目录,并添加带有 -rpath 选项的显式链 接器标志。这些更改解决了在未安装的情况下直接从构建目录运行测试时可能出现 的运行时链接问题。 Influence: 1. 验证两个测试可执行文件都能从构建目录成功运行 2. 测试可执行文件能够定位并加载所需的共享库 3. 确认测试执行期间不会出现链接器错误 4. 验证 RPATH 设置不会干扰已安装版本的行为
1 parent 6430c48 commit 24982ba

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/panels/dock/taskmanager/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ target_link_libraries(rolecombinemodel_tests
2222
Qt${QT_VERSION_MAJOR}::Test
2323
dock-taskmanager
2424
)
25+
set_target_properties(rolecombinemodel_tests PROPERTIES
26+
BUILD_RPATH "${CMAKE_BINARY_DIR}/plugins:${CMAKE_BINARY_DIR}/frame"
27+
SKIP_BUILD_RPATH OFF
28+
SKIP_RPATH OFF
29+
)
30+
2531
target_include_directories(rolecombinemodel_tests PRIVATE
2632
${CMAKE_SOURCE_DIR}/panels/dock/taskmanager/
2733
)
@@ -43,4 +49,10 @@ target_include_directories(rolegroupmodel_tests PRIVATE
4349
${CMAKE_SOURCE_DIR}/panels/dock/taskmanager/
4450
)
4551

52+
set_target_properties(rolegroupmodel_tests PROPERTIES
53+
BUILD_RPATH "${CMAKE_BINARY_DIR}/plugins:${CMAKE_BINARY_DIR}/frame"
54+
SKIP_BUILD_RPATH OFF
55+
SKIP_RPATH OFF
56+
)
57+
4658
gtest_discover_tests(rolegroupmodel_tests)

0 commit comments

Comments
 (0)