Merged
Conversation
Contributor
Johnson-zs
commented
Mar 24, 2026
- feat: add Qt Test based unit testing framework
- test: restructure search test framework and cleanup client
Added comprehensive unit testing infrastructure using Qt Test framework 1. Created main test configuration in autotests/CMakeLists.txt with BUILD_UNIT_TESTS option 2. Added test directories for dfm-io, dfm-mount, dfm-burn, and dfm- search libraries 3. Implemented test executables with proper linking against respective libraries 4. Added comprehensive test cases for utility functions and helper classes 5. Created README.md with detailed documentation on building, running, and writing tests 6. Added support for both Qt5 and Qt6 versions with automatic library detection 7. Implemented custom test-all target for running all tests with ctest The testing framework enables automated testing of core functionality and helps maintain code quality. It provides proper isolation between test modules and supports both individual test execution and batch testing. Influence: 1. Verify tests build successfully with both Qt5 and Qt6 2. Run individual test executables to ensure they execute without crashes 3. Execute test-all target to run complete test suite 4. Test with BUILD_UNIT_TESTS=OFF to ensure optional inclusion works correctly 5. Verify test output shows proper pass/fail status for each test case 6. Check that legacy tests directory remains disabled as commented feat: 添加基于 Qt Test 的单元测试框架 新增了使用 Qt Test 框架的全面单元测试基础设施 1. 在 autotests/CMakeLists.txt 中创建了主测试配置,包含 BUILD_UNIT_TESTS 选项 2. 为 dfm-io、dfm-mount、dfm-burn 和 dfm-search 库添加了测试目录 3. 实现了测试可执行文件,正确链接到相应的库 4. 为工具函数和辅助类添加了全面的测试用例 5. 创建了 README.md,包含构建、运行和编写测试的详细文档 6. 添加了对 Qt5 和 Qt6 版本的支持,支持自动库检测 7. 实现了自定义 test-all 目标,用于使用 ctest 运行所有测试 该测试框架支持核心功能的自动化测试,有助于维护代码质量。它提供了测试模块 之间的适当隔离,并支持单个测试执行和批量测试。 Influence: 1. 验证测试在 Qt5 和 Qt6 下都能成功构建 2. 运行单个测试可执行文件,确保它们执行时不会崩溃 3. 执行 test-all 目标以运行完整的测试套件 4. 使用 BUILD_UNIT_TESTS=OFF 测试,确保可选包含功能正常工作 5. 验证测试输出显示每个测试用例的正确通过/失败状态 6. 检查遗留测试目录是否按注释保持禁用状态
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Johnson-zs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Warning
详情 {
"export": {
"tests/all-ut-prj-running.sh": {
"a": [
"export DISPLAY=\":0\"",
"export QT_QPA_PLATFORM="
]
},
"tests/cppcheck-prj-running.sh": {
"a": [
"export DISPLAY=\":0\"",
"export QT_QPA_PLATFORM="
]
}
}
} |
1. Removed test code from main client application and moved to dedicated test files 2. Added main.cpp to autotests to properly handle multiple test classes 3. Simplified CMakeLists.txt by removing recursive glob and adding proper include directories 4. Created comprehensive test suite for search utilities including pinyin validation, blacklist matching, and global functions 5. Updated copyright years from 2025 to 2026 6. Changed test slot visibility from private to public for better test organization The changes separate test code from production code, improve test maintainability, and provide better test infrastructure for the search functionality. The client application is now cleaner without debug test code. Influence: 1. Verify all unit tests pass with the new test structure 2. Test search functionality through the client application to ensure no regression 3. Validate pinyin recognition and blacklist matching behavior 4. Check that the build system correctly compiles both tests and main application 5. Ensure test coverage includes all critical search components test: 重构搜索测试框架并清理客户端代码 1. 从主客户端应用程序中移除测试代码,移至专用测试文件 2. 在自动化测试中添加 main.cpp 以正确处理多个测试类 3. 简化 CMakeLists.txt,移除递归 glob 并添加正确的包含目录 4. 创建全面的搜索工具测试套件,包括拼音验证、黑名单匹配和全局函数测试 5. 将版权年份从 2025 更新至 2026 6. 将测试槽可见性从私有改为公有,以改善测试组织 这些更改将测试代码与生产代码分离,提高了测试的可维护性,并为搜索功能提供 了更好的测试基础设施。客户端应用程序现在更加清晰,没有调试测试代码。 Influence: 1. 验证所有单元测试在新的测试结构下通过 2. 通过客户端应用程序测试搜索功能,确保没有回归问题 3. 验证拼音识别和黑名单匹配行为 4. 检查构建系统是否正确编译测试和主应用程序 5. 确保测试覆盖包括所有关键的搜索组件
|
Warning
详情 {
"export": {
"tests/all-ut-prj-running.sh": {
"a": [
"export DISPLAY=\":0\"",
"export QT_QPA_PLATFORM="
]
},
"tests/cppcheck-prj-running.sh": {
"a": [
"export DISPLAY=\":0\"",
"export QT_QPA_PLATFORM="
]
}
}
} |
Removed cpp-stub and stub-ext third-party testing utilities from the project along with their MIT license files. These dependencies were previously used in the tests/3rdparty/utils directory but are no longer needed for the project's testing infrastructure. The removal includes deleting the corresponding license entries from .reuse/dep5 and removing the MIT.txt license file that was associated with these dependencies. This cleanup simplifies the project's dependency management and reduces maintenance overhead by removing unused testing utilities. The change helps maintain a cleaner codebase with only necessary third-party components. Influence: 1. Verify that the project builds successfully without these dependencies 2. Check that all existing tests continue to pass 3. Confirm that no functionality relied on these removed utilities 4. Validate that license compliance is maintained after removal chore: 移除 cpp-stub 和 stub-ext 第三方依赖 从项目中移除了 cpp-stub 和 stub-ext 第三方测试工具及其 MIT 许可证文件。 这些依赖项之前用于 tests/3rdparty/utils 目录,但项目测试基础设施不再需 要。此次清理包括从 .reuse/dep5 中删除相应的许可证条目,并移除与这些依赖 项相关的 MIT.txt 许可证文件。 此次清理简化了项目的依赖管理,通过移除未使用的测试工具减少了维护开销。该 变更有助于保持代码库的整洁,仅保留必要的第三方组件。 Influence: 1. 验证项目在没有这些依赖项的情况下能成功构建 2. 检查所有现有测试是否继续通过 3. 确认没有功能依赖于这些已移除的工具 4. 验证移除后许可证合规性是否得到保持
|
Warning
详情 {
"export": {
"tests/all-ut-prj-running.sh": {
"a": [
"export DISPLAY=\":0\"",
"export QT_QPA_PLATFORM="
]
},
"tests/cppcheck-prj-running.sh": {
"a": [
"export DISPLAY=\":0\"",
"export QT_QPA_PLATFORM="
]
}
}
} |
Contributor
Author
|
/forcemerge |
|
This pr force merged! (status: blocked) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.