Skip to content

Commit

Permalink
chore: update current unit test
Browse files Browse the repository at this point in the history
由于结构调整,目前的单元测试构建失效了。这个提交修复了这个问题,
并补充了一个简单测试。

Log:
  • Loading branch information
BLumia committed Nov 13, 2024
1 parent 5b935ad commit 1be2f93
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ qt_standard_project_setup()
macro(launchpad_add_tests)
foreach(_testname ${ARGN})
qt_add_executable(launchpad-${_testname} ${_testname}.cpp)
target_link_libraries(launchpad-${_testname} PRIVATE Qt6::Core Qt6::Test launcher-models)
target_link_libraries(launchpad-${_testname} PRIVATE Qt6::Core Qt6::Test launchpadcommon)
add_test(NAME launchpad-${_testname} COMMAND launchpad-${_testname})
endforeach()
endmacro()

launchpad_add_tests(
itemspagetest
gioappinfotest
)
24 changes: 24 additions & 0 deletions tests/gioappinfotest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#include <QTest>

#include "appinfo.h"

class TestGioAppInfo: public QObject
{
Q_OBJECT
private slots:
void dfmInfo();
};

void TestGioAppInfo::dfmInfo()
{
QString path = AppInfo::fullPathByDesktopId("dde-file-manager.desktop");
QVERIFY(QFile::exists(path));
QVERIFY(!path.isEmpty());
}

QTEST_MAIN(TestGioAppInfo)
#include "gioappinfotest.moc"

0 comments on commit 1be2f93

Please sign in to comment.