-
Notifications
You must be signed in to change notification settings - Fork 156
fix(tests): fix unit test bugs and migrate coverage script to Qt6 #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
deepin-bot
merged 1 commit into
linuxdeepin:master
from
pengfeixx:feat/migrate-tests-to-qt6
Jun 4, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,45 @@ | ||
| #!/bin/bash | ||
|
|
||
| # SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. | ||
| # SPDX-FileCopyrightText: 2022-2026 UnionTech Software Technology Co., Ltd. | ||
| # | ||
| # SPDX-License-Identifier: GPL-3.0-only | ||
|
|
||
| BUILD_DIR=build | ||
| REPORT_DIR=report | ||
|
|
||
| cd ../../ | ||
| # 自动检测 qmake6 / qmake | ||
| if command -v qmake6 &>/dev/null; then | ||
| QMAKE=qmake6 | ||
| else | ||
| QMAKE=qmake | ||
| fi | ||
|
|
||
| rm -rf $BUILD_DIR | ||
| mkdir $BUILD_DIR | ||
|
|
||
| cd $BUILD_DIR | ||
| echo "Using qmake: $QMAKE ($($QMAKE --version 2>&1 | tail -1))" | ||
|
|
||
| qmake ../ | ||
| make | ||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
| cd "$SCRIPT_DIR" | ||
|
|
||
| cd ../src/tests/ | ||
| rm -rf $BUILD_DIR | ||
| mkdir $BUILD_DIR | ||
| cd $BUILD_DIR | ||
|
|
||
| qmake CONFIG+=debug ../ | ||
|
|
||
| TESTARGS="--gtest_output=xml:deepin_test_report_boot_maker.xml" make check -j$(nproc) | ||
| # 覆盖率构建不用 CONFIG+=debug,避免 ASAN 导致退出时崩溃、.gcda 文件丢失 | ||
| $QMAKE CONFIG+=release ../tests.pro | ||
|
|
||
| mv asan_loader.log* asan_dde-boot-maker.log | ||
| TESTARGS="--gtest_output=xml:deepin_test_report_boot_maker.xml" make check -j$(nproc) | ||
|
|
||
| [ -e asan_loader.log* ] && mv asan_loader.log* asan_dde-boot-maker.log || touch asan_dde-boot-maker.log | ||
| # ASAN 日志处理 | ||
| if ls asan_loader.log* 1>/dev/null 2>&1; then | ||
| mv asan_loader.log* asan_dde-boot-maker.log | ||
| else | ||
| touch asan_dde-boot-maker.log | ||
| fi | ||
|
|
||
| # 生成覆盖率报告 | ||
| lcov -d ./ -c -o coverage_all.info | ||
|
|
||
| lcov --remove coverage_all.info "*/tests/*" "*/usr/include*" --output-file coverage.info | ||
| cd .. | ||
| genhtml -o $REPORT_DIR $BUILD_DIR/coverage.info | ||
| #rm -rf $BUILD_DIR | ||
|
|
||
| exit 0 | ||
| exit 0 |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Guard
__gcov_dumpusage so the test binary still links when coverage is not enabledUnconditional declaration/calls to
__gcov_dump()will fail to link when tests are built without gcov instrumentation (e.g. non-coverage CI or local debug builds). Please wrap the declaration and all uses in a feature macro (e.g.#ifdef USE_GCOV_DUMP,#ifdef __GNUC__, or a project-specific#ifdef ENABLE_COVERAGE) and enable it only in coverage builds so tests remain runnable in all configurations.