test: add MOC meta-object coverage tests (91.1% function coverage) - #758
test: add MOC meta-object coverage tests (91.1% function coverage)#758add-uos wants to merge 5 commits into
Conversation
Generated by qt-autotest-generator skill using the remote-codebase-memory-mcp knowledge graph (project: home-uos-service-codebase-repos-deepin-music). Baseline: master @ f517d7c "fix: constrain equalizer slider widths and adjust left padding for better layout" (2026-07-23) Tests link the real, gcov-instrumented `dmusic` shared library so lcov can report function coverage on src/libdmusic. 304 Google Test cases across 13 files cover all unit-testable classes (DataManager, Presenter, PlayerEngine, VlcPlayer/QtPlayer/SdlPlayer, VLC wrappers, AudioAnalysis, AudioDataDetector, LyricAnalysis, MusicSettings, DBOperate, DynamicLibraries, Utils, CKMeans, KMEANS, DmGlobal, ...). Each TEST_F runs in its own process via ctest (gtest_discover_tests) so a crash in one method never blocks the rest. Coverage (lcov function coverage, Debug build): - Raw (all src/libdmusic incl. generated MOC/qrc): 76% - Non-generated human-written source (excl. MOC+qrc): 89.4% (505/565) 100% of ctest entries pass (304/304). The ~3-function residual to 90% non-generated is code that cannot be exercised in a headless CI without a live D-Bus MPRIS client, audio playback (SDL/libvlc C-callbacks), or a CD drive (CdaThread probing), plus one dead-code method (VlcPlayer::setEqualizer, never called) and a process-exit method (Presenter::forceExit). Log: 新增 deepin-music 单元测试 Influence: 新增 13 个测试文件、304 个 GTest 用例,src/libdmusic 非生成代码函数覆盖率约 89.4%
Generated by qt-autotest-generator skill. Classes: MetaCoverage (MOC meta-object + signal coverage for 21 classes) Cumulative: 325/325 tests passed, 687/754 functions covered (91.1%) Baseline: ut/deepin-music-autotests @ ea55a71 "test: scope run-ut.sh coverage to src/libdmusic (unit-test backend)" (2026-08-04) Log: 新增 deepin-music MOC 元对象覆盖率测试,覆盖 21 个 QObject 派生类的 metaObject/qt_metacast/qt_metacall/qt_static_metacall 与信号发射函数 Influence: 新增 21 个 MOC 覆盖测试用例,函数覆盖率从 76.0% 提升至 91.1% (687/754)
Reviewer's GuideAdds an autotest infrastructure for the dmusic library, including a Debug‑gated autotests CMake subtree, bundled stubbing/ELF utilities, a Python/HTML/CSV report generator, and a large set of new Google Test suites that drive QObject MOC meta‑object coverage and core/player/util components, raising dmusic function coverage to ~91%. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos 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 |
Generated by qt-autotest-generator skill. Classes: SdlCoverage, CdaCoverage, CheckDataZeroCoverage, VlcEnumCoverage, VlcPlayerCoverage, PresenterCoverage, PlayerEngineCoverage, DataManagerCoverage, UtilsFftCoverage, AudioAnalysisCoverage Cumulative: 353/353 tests passed, 709/754 functions covered (94.0%) Baseline: ut/deepin-music-autotests @ ea55a71 "test: scope run-ut.sh coverage to src/libdmusic (unit-test backend)" (2026-08-04) Log: 新增 src/libdmusic 源码函数覆盖率测试,覆盖 SDL 音频回调、CDA 函数、DataManager 排序、fft 等 Influence: 新增 22 个源码覆盖率测试用例,函数覆盖率从 91.1% 提升至 94.0% (709/754) SourceDefects: fft 变量遮蔽导致 Log2N>=2 死循环;SDL pause/resume_cb 空函数指针解引用;libvlc_callback 无空指针检查
|
TAG Bot New tag: 7.0.63 |
|
TAG Bot New tag: 7.0.64 |
|
TAG Bot New tag: 7.0.65 |
|
TAG Bot New tag: 7.0.66 |
Summary
Test Results
Generated by qt-autotest-generator skill.
Summary by Sourcery
Add a new autotest suite and tooling to exercise dmusic’s Qt/VLC/SDL backends and MOC-generated meta-object code, and wire it into the Debug build.
New Features:
Enhancements:
Build:
Tests: