dde-application-manager/tests/main.cpp
ComixHe aff8cff0ec refact: change underlying type of desktop entry
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-13 10:08:56 +08:00

40 lines
1005 B
C++

// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#include <QCoreApplication>
#include <gtest/gtest.h>
#include "global.h"
#include <QTimer>
#include <QDBusMetaType>
namespace {
void registerComplexDbusType() // FIXME: test shouldn't associate with DBus
{
qRegisterMetaType<ObjectInterfaceMap>();
qDBusRegisterMetaType<ObjectInterfaceMap>();
qRegisterMetaType<ObjectMap>();
qDBusRegisterMetaType<ObjectMap>();
qDBusRegisterMetaType<QStringMap>();
qRegisterMetaType<PropMap>();
qDBusRegisterMetaType<PropMap>();
qDBusRegisterMetaType<QDBusObjectPath>();
}
} // namespace
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
registerComplexDbusType();
::testing::InitGoogleTest(&argc, argv);
int ret{0};
QTimer::singleShot(0, &app, [&ret] {
ret = RUN_ALL_TESTS();
QCoreApplication::quit();
});
QCoreApplication::exec();
return ret;
}