test: add cov5/resid cov headers and use native display in test-prj-r…#872
test: add cov5/resid cov headers and use native display in test-prj-r…#872pengfeixx wants to merge 1 commit into
Conversation
…unning.sh Switch tests/test-prj-running.sh from offscreen to native display (env has real screen+camera) — recovers GUI/paint/cursor/screengrab coverage that offscreen skipped. Add ut_main_window_cov5 (shortcut-lambda sweep via emit QShortcut::activated) and ut_resid_cov (45 tests across ShapesWidget/ SubToolWidget/ToolBar/ScreenGrabber/CameraWidget/EventMonitor deep paths). 新增 cov5(快捷键 lambda 扫描)与 resid_cov(45 个用例覆盖 ShapesWidget 等 6 类深层路径);将 tests/test-prj-running.sh 由 offscreen 改为原生 显示(环境有真实屏幕+摄像头),恢复 GUI/paint/cursor/screengrab 覆盖。 Log: 新增深层路径 cov 用例并切换原生显示 Influence: 新增 cov5/resid 覆盖头文件,offscreen 改原生显示,src/ 行覆盖率提升约 3.5%。
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
|
[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 |
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 建议将 ut_resid_cov.h 按被测类拆分,以下为 shapeswidget 残余覆盖独立文件示例
// ut_shapeswidget_resid.h
#pragma once
#include <gtest/gtest.h>
#include "stub.h"
#include "addr_pri.h"
#include "../../src/widgets/shapeswidget.h"
using namespace testing;
ACCESS_PRIVATE_FIELD(ShapesWidget, bool, m_isRecording);
ACCESS_PRIVATE_FIELD(ShapesWidget, bool, m_isPressed);
ACCESS_PRIVATE_FUN(ShapesWidget, void(QPinchGesture *), pinchTriggered);
class ShapesWidgetResidTest : public Test {
public:
ShapesWidget *m_w = nullptr;
void SetUp() override {
m_w = new ShapesWidget;
m_w->resize(400, 300);
}
void TearDown() override {
delete m_w;
m_w = nullptr;
}
};
TEST_F(ShapesWidgetResidTest, pinchTriggeredCenterFlag) {
QPinchGesture pinch;
pinch.setCenterPoint(QPointF(100, 100));
pinch.setScaleFactor(1.5);
pinch.setChangeFlags(QPinchGesture::ScaleFactorChanged |
QPinchGesture::CenterPointChanged);
call_private_fun::ShapesWidgetpinchTriggered(*m_w, &pinch);
} |
…unning.sh
Switch tests/test-prj-running.sh from offscreen to native display (env has real screen+camera) — recovers GUI/paint/cursor/screengrab coverage that offscreen skipped. Add ut_main_window_cov5 (shortcut-lambda sweep via emit QShortcut::activated) and ut_resid_cov (45 tests across ShapesWidget/ SubToolWidget/ToolBar/ScreenGrabber/CameraWidget/EventMonitor deep paths).
新增 cov5(快捷键 lambda 扫描)与 resid_cov(45 个用例覆盖 ShapesWidget 等 6 类深层路径);将 tests/test-prj-running.sh 由 offscreen 改为原生 显示(环境有真实屏幕+摄像头),恢复 GUI/paint/cursor/screengrab 覆盖。
Log: 新增深层路径 cov 用例并切换原生显示
Influence: 新增 cov5/resid 覆盖头文件,offscreen 改原生显示,src/ 行覆盖率提升约 3.5%。