Commit f372f4aa authored by Ulf Hermann's avatar Ulf Hermann

QmlProfiler: Add tests for client manager

Change-Id: I9d758857dc65daa564ab6a0394250c02ea006832
Reviewed-by: Christian Kandeler's avatarChristian Kandeler <christian.kandeler@qt.io>
parent 62b12178
......@@ -92,6 +92,7 @@ QtcPlugin {
"qmlprofilerattachdialog_test.cpp", "qmlprofilerattachdialog_test.h",
"qmlprofilerbindingloopsrenderpass_test.cpp",
"qmlprofilerbindingloopsrenderpass_test.h",
"qmlprofilerclientmanager_test.cpp", "qmlprofilerclientmanager_test.h",
]
}
}
......@@ -30,6 +30,7 @@
#include "qmlprofilertimelinemodel.h"
#ifdef WITH_TESTS
#include "tests/debugmessagesmodel_test.h"
#include "tests/flamegraph_test.h"
#include "tests/flamegraphmodel_test.h"
......@@ -45,7 +46,15 @@
#include "tests/qmlprofileranimationsmodel_test.h"
#include "tests/qmlprofilerattachdialog_test.h"
#include "tests/qmlprofilerbindingloopsrenderpass_test.h"
#endif
#include "tests/qmlprofilerclientmanager_test.h"
// Force QML Debugging to be enabled, so that we can selftest the profiler
#define QT_QML_DEBUG_NO_WARNING
#include <QQmlDebuggingEnabler>
#include <QQmlEngine>
#undef QT_QML_DEBUG_NO_WARNING
#endif // WITH_TESTS
#include <extensionsystem/pluginmanager.h>
#include <utils/hostosinfo.h>
......@@ -107,6 +116,9 @@ QList<QObject *> QmlProfiler::Internal::QmlProfilerPlugin::createTestObjects() c
tests << new QmlProfilerAnimationsModelTest;
tests << new QmlProfilerAttachDialogTest;
tests << new QmlProfilerBindingLoopsRenderPassTest;
tests << new QmlProfilerClientManagerTest;
tests << new QQmlEngine; // Trigger debug connector to be started
#endif
return tests;
}
......
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <qmlprofiler/qmlprofilerclientmanager.h>
#include <qmlprofiler/qmlprofilermodelmanager.h>
#include <qmlprofiler/qmlprofilerstatemanager.h>
#include <QObject>
namespace QmlProfiler {
namespace Internal {
class QmlProfilerClientManagerTest : public QObject
{
Q_OBJECT
public:
explicit QmlProfilerClientManagerTest(QObject *parent = 0);
private slots:
void testConnectionFailure_data();
void testConnectionFailure();
void testUnresponsiveTcp();
void testUnresponsiveLocal();
void testResponsiveTcp_data();
void testResponsiveTcp();
void testResponsiveLocal_data();
void testResponsiveLocal();
void testInvalidData();
private:
QmlProfilerClientManager clientManager;
QmlProfilerModelManager modelManager;
QmlProfilerStateManager stateManager;
};
} // namespace Internal
} // namespace QmlProfiler
......@@ -13,7 +13,8 @@ SOURCES += \
$$PWD/qmlnote_test.cpp \
$$PWD/qmlprofileranimationsmodel_test.cpp \
$$PWD/qmlprofilerattachdialog_test.cpp \
$$PWD/qmlprofilerbindingloopsrenderpass_test.cpp
$$PWD/qmlprofilerbindingloopsrenderpass_test.cpp \
$$PWD/qmlprofilerclientmanager_test.cpp
HEADERS += \
$$PWD/debugmessagesmodel_test.h \
......@@ -30,4 +31,5 @@ HEADERS += \
$$PWD/qmlnote_test.h \
$$PWD/qmlprofileranimationsmodel_test.h \
$$PWD/qmlprofilerattachdialog_test.h \
$$PWD/qmlprofilerbindingloopsrenderpass_test.h
$$PWD/qmlprofilerbindingloopsrenderpass_test.h \
$$PWD/qmlprofilerclientmanager_test.h
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment