Commit 468521b0 authored by Ulf Hermann's avatar Ulf Hermann

QmlProfiler: Add test for attach dialog

Change-Id: I040ef23f780e361037386a92444fcf45aded7a3f
Reviewed-by: Christian Kandeler's avatarChristian Kandeler <christian.kandeler@qt.io>
parent 6361152d
......@@ -90,6 +90,7 @@ QtcPlugin {
"qmleventtype_test.cpp", "qmleventtype_test.h",
"qmlnote_test.cpp", "qmlnote_test.h",
"qmlprofileranimationsmodel_test.cpp", "qmlprofileranimationsmodel_test.h",
"qmlprofilerattachdialog_test.cpp", "qmlprofilerattachdialog_test.h",
]
}
}
......@@ -43,6 +43,7 @@
#include "tests/qmleventtype_test.h"
#include "tests/qmlnote_test.h"
#include "tests/qmlprofileranimationsmodel_test.h"
#include "tests/qmlprofilerattachdialog_test.h"
#endif
#include <extensionsystem/pluginmanager.h>
......@@ -103,6 +104,7 @@ QList<QObject *> QmlProfiler::Internal::QmlProfilerPlugin::createTestObjects() c
tests << new QmlEventTypeTest;
tests << new QmlNoteTest;
tests << new QmlProfilerAnimationsModelTest;
tests << new QmlProfilerAttachDialogTest;
#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.
**
****************************************************************************/
#include "qmlprofilerattachdialog_test.h"
#include "projectexplorer/kitmanager.h"
#include "projectexplorer/kit.h"
#include <QtTest>
namespace QmlProfiler {
namespace Internal {
QmlProfilerAttachDialogTest::QmlProfilerAttachDialogTest(QObject *parent) : QObject(parent)
{
}
void QmlProfilerAttachDialogTest::testAccessors()
{
QmlProfilerAttachDialog dialog;
int port = dialog.port();
QVERIFY(port >= 0);
QVERIFY(port < 65536);
dialog.setPort(4444);
QCOMPARE(dialog.port(), 4444);
ProjectExplorer::Kit *kit = dialog.kit();
QVERIFY(kit);
ProjectExplorer::Kit *newKit = new ProjectExplorer::Kit("dings");
ProjectExplorer::KitManager *kitManager = ProjectExplorer::KitManager::instance();
QVERIFY(kitManager);
QVERIFY(kitManager->registerKit(newKit));
dialog.setKitId("dings");
QCOMPARE(dialog.kit(), newKit);
kitManager->deregisterKit(newKit);
}
} // namespace Internal
} // namespace QmlProfiler
/****************************************************************************
**
** 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/qmlprofilerattachdialog.h>
#include <QObject>
namespace QmlProfiler {
namespace Internal {
class QmlProfilerAttachDialogTest : public QObject
{
Q_OBJECT
public:
explicit QmlProfilerAttachDialogTest(QObject *parent = 0);
private slots:
void testAccessors();
};
} // namespace Internal
} // namespace QmlProfiler
......@@ -11,7 +11,8 @@ SOURCES += \
$$PWD/qmleventlocation_test.cpp \
$$PWD/qmleventtype_test.cpp \
$$PWD/qmlnote_test.cpp \
$$PWD/qmlprofileranimationsmodel_test.cpp
$$PWD/qmlprofileranimationsmodel_test.cpp \
$$PWD/qmlprofilerattachdialog_test.cpp
HEADERS += \
$$PWD/debugmessagesmodel_test.h \
......@@ -26,4 +27,5 @@ HEADERS += \
$$PWD/qmleventlocation_test.h \
$$PWD/qmleventtype_test.h \
$$PWD/qmlnote_test.h \
$$PWD/qmlprofileranimationsmodel_test.h
$$PWD/qmlprofileranimationsmodel_test.h \
$$PWD/qmlprofilerattachdialog_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