test(common): extend existing tests for better coverage - #503
Conversation
There was a problem hiding this comment.
Sorry @pengfeixx, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Reviewer's GuideThis PR extends unit test coverage for several common and controls components (Utils, Tabbar, Settings, CSyntaxHighlighter, FindBar, LineBar, JumpLineBar) by deleting obsolete commented‑out tests and adding new, executable tests that exercise previously uncovered branches, lambdas, and helper functions without changing production code. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
97b31f8 to
a3d54a1
Compare
Add test cases for CSyntaxHighlighter, Settings, Utils, FindBar, JumpLineBar, LineBar and Tabbar. Log: 扩充common和controls模块现有测试用例 Influence: 提升Settings、Utils、Tabbar等类的函数覆盖率
a3d54a1 to
9a1595a
Compare
Log: 更新已修改文件的SPDX版权头年份范围 Influence: 无
deepin pr auto review★ 总体评分:90分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 diff --git a/tests/src/controls/ut_linebar.cpp b/tests/src/controls/ut_linebar.cpp
index 8c690e35..8ea3969e 100644
--- a/tests/src/controls/ut_linebar.cpp
+++ b/tests/src/controls/ut_linebar.cpp
@@ -6,9 +6,7 @@
#include "../../src/controls/linebar.h"
#include <QFocusEvent>
#include <QEvent>
#include <DGuiApplicationHelper>
DGUI_USE_NAMESPACE
-DGUI_USE_NAMESPACE
-DGUI_USE_NAMESPACE
test_linebar::test_linebar()
{
diff --git a/tests/test-prj-running.sh b/tests/test-prj-running.sh
index fc2c3531..ce79da3c 100644
--- a/tests/test-prj-running.sh
+++ b/tests/test-prj-running.sh
@@ -1,15 +1,15 @@
#!/bin/bash
builddir=build
reportdir=build-ut
-# rm -r $builddir
-# rm -r ../$builddir
-# rm -r $reportdir
-# rm -r ../$reportdir
-# mkdir ../$builddir
-# mkdir ../$reportdir
+rm -rf $builddir
+rm -rf ../$builddir
+rm -rf $reportdir
+rm -rf ../$reportdir
+mkdir ../$builddir
+mkdir ../$reportdir
cd ../$builddir
#编译
-# cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SAFETYTEST_ARG="CMAKE_SAFETYTEST_ARG_ON" ..
+cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SAFETYTEST_ARG="CMAKE_SAFETYTEST_ARG_ON" ..
make -j8
#生成asan日志和ut测试xml结果
export ASAN_OPTIONS=abort_on_error=0:detect_leaks=0 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, pengfeixx 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 |
|
/merge |
Add test cases for CSyntaxHighlighter, Settings, Utils, FindBar, JumpLineBar, LineBar and Tabbar.
Log: 扩充common和controls模块现有测试用例
Influence: 提升Settings、Utils、Tabbar等类的函数覆盖率
Summary by Sourcery
Extend unit test coverage for common utilities, settings, syntax highlighting, and controls components.
Tests: