summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-05-20 14:37:58 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-05-22 07:13:36 +0000
commitbd1f5e1651c7cdaa712feebe2573dd158c87bb07 (patch)
tree63f3d142ee8c8818ea9e258749fedf498e05d265 /tests/auto
parentfaab6ff98dafa564f2c58bd95689ffba6d3a4e32 (diff)
downloadqtwebsockets-bd1f5e1651c7cdaa712feebe2573dd158c87bb07.tar.gz
Fix qmldir for qmlwebsockets_compat
It is not supported to have both "import Qt.WebSockets 1.0" and "import QtWebSockets 1.0" in the same project. Task-number: QTBUG-46205 Change-Id: I71b824b091f4491b8ab5e1eae8290a51159b03e2 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/auto.pro4
-rw-r--r--tests/auto/qml/qml.pro3
-rw-r--r--tests/auto/qml/qmlwebsockets/qmlwebsockets.pro9
-rw-r--r--tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp35
-rw-r--r--tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml52
-rw-r--r--tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro9
-rw-r--r--tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp35
-rw-r--r--tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml52
8 files changed, 199 insertions, 0 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 634e44b..d83cc1f 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -1,3 +1,7 @@
TEMPLATE = subdirs
SUBDIRS += websockets
+
+qtHaveModule(quick) {
+ SUBDIRS += qml
+}
diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro
new file mode 100644
index 0000000..24941ad
--- /dev/null
+++ b/tests/auto/qml/qml.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+
+SUBDIRS += qmlwebsockets qmlwebsockets_compat
diff --git a/tests/auto/qml/qmlwebsockets/qmlwebsockets.pro b/tests/auto/qml/qmlwebsockets/qmlwebsockets.pro
new file mode 100644
index 0000000..9405f37
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets/qmlwebsockets.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+TARGET = tst_qmlwebsockets
+CONFIG += qmltestcase
+CONFIG += console
+SOURCES += tst_qmlwebsockets.cpp
+
+importFiles.path = .
+DEPLOYMENT += importFiles
+
diff --git a/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp b/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp
new file mode 100644
index 0000000..c230bf5
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtQuickTest/quicktest.h>
+QUICK_TEST_MAIN(qmlwebsockets)
diff --git a/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml b/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml
new file mode 100644
index 0000000..6018037
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.5
+import QtWebSockets 1.0
+
+Rectangle {
+ width: 360
+ height: 360
+
+ function appendMessage(message) {
+ messageBox.text += "\n" + message
+ }
+
+ WebSocketServer {
+ id: server
+ }
+
+ WebSocket {
+ id: socket
+ }
+}
diff --git a/tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro b/tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro
new file mode 100644
index 0000000..104e6de
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+TARGET = tst_qmlwebsockets_compat
+CONFIG += qmltestcase
+CONFIG += console
+SOURCES += tst_qmlwebsockets_compat.cpp
+
+importFiles.path = .
+DEPLOYMENT += importFiles
+
diff --git a/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp b/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp
new file mode 100644
index 0000000..0ce5bce
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtQuickTest/quicktest.h>
+QUICK_TEST_MAIN(qmlwebsockets_compat)
diff --git a/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml b/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml
new file mode 100644
index 0000000..fa2a992
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.5
+import Qt.WebSockets 1.0
+
+Rectangle {
+ width: 360
+ height: 360
+
+ function appendMessage(message) {
+ messageBox.text += "\n" + message
+ }
+
+ WebSocketServer {
+ id: server
+ }
+
+ WebSocket {
+ id: socket
+ }
+}