diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-06-29 20:24:40 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-06-30 16:26:08 +0200 |
commit | c55e385f1f70f11d3ffd0f8372ccb8e7405018c5 (patch) | |
tree | a04c2e84b43830ecf9c8817f830055bfcf64cc0d /tests | |
parent | a3e0fe474c20eb526af9668c5cc97cf7055c77fa (diff) | |
parent | 086f3722777ee61f3c019ca064d4a844cf0f6fe4 (diff) | |
download | qtwebsockets-c55e385f1f70f11d3ffd0f8372ccb8e7405018c5.tar.gz |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
.qmake.conf
src/websockets/qwebsocket_p.cpp
Change-Id: Ibcc1898263cc8bc80066370f045df6a217e46574
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/auto.pro | 17 | ||||
-rw-r--r-- | tests/auto/qml/qml.pro | 3 | ||||
-rw-r--r-- | tests/auto/qml/qmlwebsockets/qmlwebsockets.pro | 9 | ||||
-rw-r--r-- | tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp | 35 | ||||
-rw-r--r-- | tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml | 52 | ||||
-rw-r--r-- | tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro | 9 | ||||
-rw-r--r-- | tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp | 35 | ||||
-rw-r--r-- | tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml | 52 | ||||
-rw-r--r-- | tests/auto/websockets/dataprocessor/dataprocessor.pro (renamed from tests/auto/dataprocessor/dataprocessor.pro) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/dataprocessor/tst_dataprocessor.cpp (renamed from tests/auto/dataprocessor/tst_dataprocessor.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/handshakerequest/handshakerequest.pro (renamed from tests/auto/handshakerequest/handshakerequest.pro) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/handshakerequest/tst_handshakerequest.cpp (renamed from tests/auto/handshakerequest/tst_handshakerequest.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/handshakeresponse/handshakeresponse.pro (renamed from tests/auto/handshakeresponse/handshakeresponse.pro) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/handshakeresponse/tst_handshakeresponse.cpp (renamed from tests/auto/handshakeresponse/tst_handshakeresponse.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/qdefaultmaskgenerator/qdefaultmaskgenerator.pro (renamed from tests/auto/qdefaultmaskgenerator/qdefaultmaskgenerator.pro) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/qdefaultmaskgenerator/tst_defaultmaskgenerator.cpp (renamed from tests/auto/qdefaultmaskgenerator/tst_defaultmaskgenerator.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/qwebsocket/qwebsocket.pro (renamed from tests/auto/qwebsocket/qwebsocket.pro) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp (renamed from tests/auto/qwebsocket/tst_qwebsocket.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro (renamed from tests/auto/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp (renamed from tests/auto/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/qwebsocketserver/qwebsocketserver.pro (renamed from tests/auto/qwebsocketserver/qwebsocketserver.pro) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp (renamed from tests/auto/qwebsocketserver/tst_qwebsocketserver.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/websocketframe/tst_websocketframe.cpp (renamed from tests/auto/websocketframe/tst_websocketframe.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/websocketframe/websocketframe.pro (renamed from tests/auto/websocketframe/websocketframe.pro) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/websocketprotocol/tst_websocketprotocol.cpp (renamed from tests/auto/websocketprotocol/tst_websocketprotocol.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/websocketprotocol/websocketprotocol.pro (renamed from tests/auto/websocketprotocol/websocketprotocol.pro) | 0 | ||||
-rw-r--r-- | tests/auto/websockets/websockets.pro | 16 | ||||
-rw-r--r-- | tests/doc/README | 58 |
28 files changed, 273 insertions, 13 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 4698cd0..d96c4a5 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -1,16 +1,7 @@ TEMPLATE = subdirs -SUBDIRS = \ - qwebsocketcorsauthenticator +SUBDIRS += cmake websockets -contains(QT_CONFIG, private_tests): SUBDIRS += \ - websocketprotocol \ - dataprocessor \ - websocketframe \ - handshakerequest \ - handshakeresponse \ - qdefaultmaskgenerator - -SUBDIRS += \ - qwebsocket \ - qwebsocketserver +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 + } +} diff --git a/tests/auto/dataprocessor/dataprocessor.pro b/tests/auto/websockets/dataprocessor/dataprocessor.pro index ac5ba5c..ac5ba5c 100644 --- a/tests/auto/dataprocessor/dataprocessor.pro +++ b/tests/auto/websockets/dataprocessor/dataprocessor.pro diff --git a/tests/auto/dataprocessor/tst_dataprocessor.cpp b/tests/auto/websockets/dataprocessor/tst_dataprocessor.cpp index c1dd9a1..c1dd9a1 100644 --- a/tests/auto/dataprocessor/tst_dataprocessor.cpp +++ b/tests/auto/websockets/dataprocessor/tst_dataprocessor.cpp diff --git a/tests/auto/handshakerequest/handshakerequest.pro b/tests/auto/websockets/handshakerequest/handshakerequest.pro index d887cd6..d887cd6 100644 --- a/tests/auto/handshakerequest/handshakerequest.pro +++ b/tests/auto/websockets/handshakerequest/handshakerequest.pro diff --git a/tests/auto/handshakerequest/tst_handshakerequest.cpp b/tests/auto/websockets/handshakerequest/tst_handshakerequest.cpp index 9c579bd..9c579bd 100644 --- a/tests/auto/handshakerequest/tst_handshakerequest.cpp +++ b/tests/auto/websockets/handshakerequest/tst_handshakerequest.cpp diff --git a/tests/auto/handshakeresponse/handshakeresponse.pro b/tests/auto/websockets/handshakeresponse/handshakeresponse.pro index 4d7cd50..4d7cd50 100644 --- a/tests/auto/handshakeresponse/handshakeresponse.pro +++ b/tests/auto/websockets/handshakeresponse/handshakeresponse.pro diff --git a/tests/auto/handshakeresponse/tst_handshakeresponse.cpp b/tests/auto/websockets/handshakeresponse/tst_handshakeresponse.cpp index b5f103b..b5f103b 100644 --- a/tests/auto/handshakeresponse/tst_handshakeresponse.cpp +++ b/tests/auto/websockets/handshakeresponse/tst_handshakeresponse.cpp diff --git a/tests/auto/qdefaultmaskgenerator/qdefaultmaskgenerator.pro b/tests/auto/websockets/qdefaultmaskgenerator/qdefaultmaskgenerator.pro index 3a951a7..3a951a7 100644 --- a/tests/auto/qdefaultmaskgenerator/qdefaultmaskgenerator.pro +++ b/tests/auto/websockets/qdefaultmaskgenerator/qdefaultmaskgenerator.pro diff --git a/tests/auto/qdefaultmaskgenerator/tst_defaultmaskgenerator.cpp b/tests/auto/websockets/qdefaultmaskgenerator/tst_defaultmaskgenerator.cpp index f5fc5c4..f5fc5c4 100644 --- a/tests/auto/qdefaultmaskgenerator/tst_defaultmaskgenerator.cpp +++ b/tests/auto/websockets/qdefaultmaskgenerator/tst_defaultmaskgenerator.cpp diff --git a/tests/auto/qwebsocket/qwebsocket.pro b/tests/auto/websockets/qwebsocket/qwebsocket.pro index 0155d08..0155d08 100644 --- a/tests/auto/qwebsocket/qwebsocket.pro +++ b/tests/auto/websockets/qwebsocket/qwebsocket.pro diff --git a/tests/auto/qwebsocket/tst_qwebsocket.cpp b/tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp index f993f84..f993f84 100644 --- a/tests/auto/qwebsocket/tst_qwebsocket.cpp +++ b/tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp diff --git a/tests/auto/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro b/tests/auto/websockets/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro index aa485fc..aa485fc 100644 --- a/tests/auto/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro +++ b/tests/auto/websockets/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro diff --git a/tests/auto/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp b/tests/auto/websockets/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp index 225adc8..225adc8 100644 --- a/tests/auto/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp +++ b/tests/auto/websockets/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp diff --git a/tests/auto/qwebsocketserver/qwebsocketserver.pro b/tests/auto/websockets/qwebsocketserver/qwebsocketserver.pro index 25216d3..25216d3 100644 --- a/tests/auto/qwebsocketserver/qwebsocketserver.pro +++ b/tests/auto/websockets/qwebsocketserver/qwebsocketserver.pro diff --git a/tests/auto/qwebsocketserver/tst_qwebsocketserver.cpp b/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp index c2ba842..c2ba842 100644 --- a/tests/auto/qwebsocketserver/tst_qwebsocketserver.cpp +++ b/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp diff --git a/tests/auto/websocketframe/tst_websocketframe.cpp b/tests/auto/websockets/websocketframe/tst_websocketframe.cpp index 5db82d5..5db82d5 100644 --- a/tests/auto/websocketframe/tst_websocketframe.cpp +++ b/tests/auto/websockets/websocketframe/tst_websocketframe.cpp diff --git a/tests/auto/websocketframe/websocketframe.pro b/tests/auto/websockets/websocketframe/websocketframe.pro index 9682348..9682348 100644 --- a/tests/auto/websocketframe/websocketframe.pro +++ b/tests/auto/websockets/websocketframe/websocketframe.pro diff --git a/tests/auto/websocketprotocol/tst_websocketprotocol.cpp b/tests/auto/websockets/websocketprotocol/tst_websocketprotocol.cpp index 94816de..94816de 100644 --- a/tests/auto/websocketprotocol/tst_websocketprotocol.cpp +++ b/tests/auto/websockets/websocketprotocol/tst_websocketprotocol.cpp diff --git a/tests/auto/websocketprotocol/websocketprotocol.pro b/tests/auto/websockets/websocketprotocol/websocketprotocol.pro index c21bb64..c21bb64 100644 --- a/tests/auto/websocketprotocol/websocketprotocol.pro +++ b/tests/auto/websockets/websocketprotocol/websocketprotocol.pro diff --git a/tests/auto/websockets/websockets.pro b/tests/auto/websockets/websockets.pro new file mode 100644 index 0000000..4698cd0 --- /dev/null +++ b/tests/auto/websockets/websockets.pro @@ -0,0 +1,16 @@ +TEMPLATE = subdirs + +SUBDIRS = \ + qwebsocketcorsauthenticator + +contains(QT_CONFIG, private_tests): SUBDIRS += \ + websocketprotocol \ + dataprocessor \ + websocketframe \ + handshakerequest \ + handshakeresponse \ + qdefaultmaskgenerator + +SUBDIRS += \ + qwebsocket \ + qwebsocketserver diff --git a/tests/doc/README b/tests/doc/README new file mode 100644 index 0000000..da9b2b5 --- /dev/null +++ b/tests/doc/README @@ -0,0 +1,58 @@ +This directory contains autotests and manual tests for the Qt WebSockets +module. + +In addition, Autobahn|Testsuite, a standard test suite for WebSocket +Protocol (RFC 6455), can be used for testing the conformance of Qt +WebSockets. + +http://autobahn.ws/testsuite/ + +Refer to Autobahn|Testsuite installation documentation at +http://autobahn.ws/testsuite/installation.html + +//! [testsuite] +\section1 Testing Qt WebSockets with Autobahn|Testsuite + + +\section2 wstest - fuzzingserver mode + +\code + cd your_build_dir/tests/manual/compliance + qmake your_src_dir/tests/manual/compliance/compliance.pro + make + + cd ~ + wstest -m fuzzingserver +\endcode + +Then, in another terminal: + +\code + cd your_build_dir/tests/manual/compliance + ./tst_compliance +\endcode + +Test results will be generated under ~/reports/clients directory. +Point your browser to ~/reports/clients/index.html. + + +\section2 wstest - fuzzingclient mode + +\code + cd your_build_dir/examples/websockets/echoserver + qmake your_src_dir/examples/websockets/echoserver/echoserver.pro + make + + ./echoserver -p 9001 +\endcode + +Then, in another terminal: + +\code + cd ~ + wstest -m fuzzingclient +\endcode + +Test results will be generated under ~/reports/servers directory. +Point your browser to ~/reports/servers/index.html. +//! [testsuite] |