mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
chore: 添加内存泄露检测的编译参数
为后面CI自动化做准备,内存检测编译参数仅在Release模式下生效 Log: Change-Id: Id03a9781ba55578645942e597fa7b0425dd419a7
This commit is contained in:
parent
1377e77448
commit
e4d7556090
@ -69,6 +69,7 @@ AppDragWidget::AppDragWidget(QWidget *parent)
|
|||||||
, m_animOpacity(new QPropertyAnimation(m_object, "opacity", this))
|
, m_animOpacity(new QPropertyAnimation(m_object, "opacity", this))
|
||||||
, m_animGroup(new QParallelAnimationGroup(this))
|
, m_animGroup(new QParallelAnimationGroup(this))
|
||||||
, m_goBackAnim(new QPropertyAnimation(this, "pos", this))
|
, m_goBackAnim(new QPropertyAnimation(this, "pos", this))
|
||||||
|
, m_dockPosition(Dock::Position::Bottom)
|
||||||
, m_removeTips(new TipsWidget(this))
|
, m_removeTips(new TipsWidget(this))
|
||||||
, m_popupWindow(nullptr)
|
, m_popupWindow(nullptr)
|
||||||
, m_distanceMultiple(Utils::SettingValue("com.deepin.dde.dock.distancemultiple", "/com/deepin/dde/dock/distancemultiple/", "distance-multiple", 1.5).toDouble())
|
, m_distanceMultiple(Utils::SettingValue("com.deepin.dde.dock.distancemultiple", "/com/deepin/dde/dock/distancemultiple/", "distance-multiple", 1.5).toDouble())
|
||||||
|
@ -57,6 +57,7 @@ using namespace Dock;
|
|||||||
AppSnapshot::AppSnapshot(const WId wid, QWidget *parent)
|
AppSnapshot::AppSnapshot(const WId wid, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, m_wid(wid)
|
, m_wid(wid)
|
||||||
|
, m_closeAble(false)
|
||||||
, m_isWidowHidden(false)
|
, m_isWidowHidden(false)
|
||||||
, m_title(new TipsWidget(this))
|
, m_title(new TipsWidget(this))
|
||||||
, m_waitLeaveTimer(new QTimer(this))
|
, m_waitLeaveTimer(new QTimer(this))
|
||||||
|
@ -11,6 +11,11 @@ file(GLOB_RECURSE SRCS "*.h" "*.cpp" "../widgets/*.h" "../widgets/*.cpp")
|
|||||||
# 用于测试覆盖率的编译条件
|
# 用于测试覆盖率的编译条件
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -lgcov")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -lgcov")
|
||||||
|
|
||||||
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fsanitize=address -O2")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fsanitize=address -O2")
|
||||||
|
endif()
|
||||||
|
|
||||||
# 查找gmock的cmake文件
|
# 查找gmock的cmake文件
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/tests/cmake/modules)
|
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/tests/cmake/modules)
|
||||||
|
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
#ifdef QT_DEBUG
|
||||||
|
#include <sanitizer/asan_interface.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "dockapplication.h"
|
#include "dockapplication.h"
|
||||||
|
|
||||||
@ -29,7 +32,7 @@
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
// gerrit编译时没有显示器,需要指定环境变量,本地Debug模式编译时不要设置这个宏,导致获取不到显示器相关信息
|
// gerrit编译时没有显示器,需要指定环境变量,本地Debug模式编译时不要设置这个宏,导致获取不到显示器相关信息
|
||||||
#ifndef QT_DEBUG
|
#ifndef QT_DEBUG
|
||||||
qputenv("QT_QPA_PLATFORM", "offscreen");
|
qputenv("QT_QPA_PLATFORM", "offscreen");
|
||||||
#endif
|
#endif
|
||||||
@ -40,5 +43,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
::testing::InitGoogleTest(&argc, argv);
|
||||||
|
|
||||||
|
#ifdef QT_DEBUG
|
||||||
|
__sanitizer_set_report_path("asan.log");
|
||||||
|
#endif
|
||||||
return RUN_ALL_TESTS();
|
return RUN_ALL_TESTS();
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,9 @@ cd ../
|
|||||||
rm -rf $BUILD_DIR
|
rm -rf $BUILD_DIR
|
||||||
mkdir $BUILD_DIR
|
mkdir $BUILD_DIR
|
||||||
cd $BUILD_DIR
|
cd $BUILD_DIR
|
||||||
|
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
|
|
||||||
cmake ../
|
cmake ../
|
||||||
make -j 16
|
make -j 16
|
||||||
|
|
||||||
@ -20,3 +23,5 @@ lcov -r code.info '*/dbus/*' '*/xcb/*' -o final.info
|
|||||||
rm -rf ../../tests/$REPORT_DIR
|
rm -rf ../../tests/$REPORT_DIR
|
||||||
mkdir -p ../../tests/$REPORT_DIR
|
mkdir -p ../../tests/$REPORT_DIR
|
||||||
genhtml -o ../../tests/$REPORT_DIR final.info
|
genhtml -o ../../tests/$REPORT_DIR final.info
|
||||||
|
|
||||||
|
mv asan.log* asan_dde-dock.log
|
||||||
|
Loading…
x
Reference in New Issue
Block a user