From fb587a3a996d2e9d2fca34cc053df29f6d23f64e Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Wed, 11 Dec 2013 15:54:33 +0100 Subject: Restructure sources and assimilate to Qt module structure. This module can hopefully be done in time for 5.3. This commit changes the source structure and QMake files to adapt to typical Qt modules. With this in place, we can now use QT += webchannel in qmake files to link against the pure Qt/C++ QtWebChannel library. The QML plugin is separated from it and can be loaded optionally, if the quick module could be found. Also added is now a qmlplugindump for tooling integration. Note that the Qt.labs namespace is removed. The test file structure is also adapted to how its done in the QtDeclarative module. Note that this setup apparently does not support to run tests without running make install first. Change-Id: I1c15d72e7ab5f525d5a6f651f4e965ef86bc17bd Reviewed-by: Simon Hausmann --- tests/qml/WebChannelTest.qml | 6 +++--- tests/qml/bench_init.html | 16 ---------------- tests/qml/data/bench_init.html | 16 ++++++++++++++++ tests/qml/data/disconnect.html | 24 ++++++++++++++++++++++++ tests/qml/data/grouping.html | 20 ++++++++++++++++++++ tests/qml/data/method.html | 20 ++++++++++++++++++++ tests/qml/data/property.html | 24 ++++++++++++++++++++++++ tests/qml/data/receiveRaw.html | 15 +++++++++++++++ tests/qml/data/respond.html | 17 +++++++++++++++++ tests/qml/data/send.html | 17 +++++++++++++++++ tests/qml/data/signal.html | 20 ++++++++++++++++++++ tests/qml/data/wrapper.html | 31 +++++++++++++++++++++++++++++++ tests/qml/disconnect.html | 24 ------------------------ tests/qml/grouping.html | 20 -------------------- tests/qml/method.html | 20 -------------------- tests/qml/property.html | 24 ------------------------ tests/qml/qml.cpp | 2 +- tests/qml/qml.pro | 15 ++++++++++++--- tests/qml/receiveRaw.html | 15 --------------- tests/qml/respond.html | 17 ----------------- tests/qml/send.html | 17 ----------------- tests/qml/signal.html | 20 -------------------- tests/qml/tst_bench.qml | 4 ++-- tests/qml/tst_metaobjectpublisher.qml | 4 ++-- tests/qml/tst_webchannel.qml | 2 +- tests/qml/wrapper.html | 31 ------------------------------- tests/tests.pro | 5 +++-- 27 files changed, 228 insertions(+), 218 deletions(-) delete mode 100644 tests/qml/bench_init.html create mode 100644 tests/qml/data/bench_init.html create mode 100644 tests/qml/data/disconnect.html create mode 100644 tests/qml/data/grouping.html create mode 100644 tests/qml/data/method.html create mode 100644 tests/qml/data/property.html create mode 100644 tests/qml/data/receiveRaw.html create mode 100644 tests/qml/data/respond.html create mode 100644 tests/qml/data/send.html create mode 100644 tests/qml/data/signal.html create mode 100644 tests/qml/data/wrapper.html delete mode 100644 tests/qml/disconnect.html delete mode 100644 tests/qml/grouping.html delete mode 100644 tests/qml/method.html delete mode 100644 tests/qml/property.html delete mode 100644 tests/qml/receiveRaw.html delete mode 100644 tests/qml/respond.html delete mode 100644 tests/qml/send.html delete mode 100644 tests/qml/signal.html delete mode 100644 tests/qml/wrapper.html (limited to 'tests') diff --git a/tests/qml/WebChannelTest.qml b/tests/qml/WebChannelTest.qml index ca2996d..ee6cadd 100644 --- a/tests/qml/WebChannelTest.qml +++ b/tests/qml/WebChannelTest.qml @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff ** Contact: http://www.qt-project.org/legal ** -** This file is part of the QWebChannel module on Qt labs. +** This file is part of the QtWebChannel module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -34,7 +34,7 @@ import QtQuick 2.0 import QtTest 1.0 -import Qt.labs.WebChannel 1.0 +import QtWebChannel 1.0 import QtWebKit 3.0 import QtWebKit.experimental 1.0 @@ -86,7 +86,7 @@ TestCase { function loadUrl(url) { verify(webChannel.baseUrl != "", "webChannel.baseUrl is empty"); - view.url = url + "?webChannelBaseUrl=" + webChannel.baseUrl; + view.url = "data/" + url + "?webChannelBaseUrl=" + webChannel.baseUrl; // now wait for page to finish loading do { loadingSpy.wait(500); diff --git a/tests/qml/bench_init.html b/tests/qml/bench_init.html deleted file mode 100644 index ef18650..0000000 --- a/tests/qml/bench_init.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/tests/qml/data/bench_init.html b/tests/qml/data/bench_init.html new file mode 100644 index 0000000..ef18650 --- /dev/null +++ b/tests/qml/data/bench_init.html @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/tests/qml/data/disconnect.html b/tests/qml/data/disconnect.html new file mode 100644 index 0000000..f4cbb0a --- /dev/null +++ b/tests/qml/data/disconnect.html @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/tests/qml/data/grouping.html b/tests/qml/data/grouping.html new file mode 100644 index 0000000..bb804f4 --- /dev/null +++ b/tests/qml/data/grouping.html @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/tests/qml/data/method.html b/tests/qml/data/method.html new file mode 100644 index 0000000..618550f --- /dev/null +++ b/tests/qml/data/method.html @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/tests/qml/data/property.html b/tests/qml/data/property.html new file mode 100644 index 0000000..1a8360a --- /dev/null +++ b/tests/qml/data/property.html @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/tests/qml/data/receiveRaw.html b/tests/qml/data/receiveRaw.html new file mode 100644 index 0000000..cfe685e --- /dev/null +++ b/tests/qml/data/receiveRaw.html @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/tests/qml/data/respond.html b/tests/qml/data/respond.html new file mode 100644 index 0000000..29e47b8 --- /dev/null +++ b/tests/qml/data/respond.html @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/tests/qml/data/send.html b/tests/qml/data/send.html new file mode 100644 index 0000000..f30e9c8 --- /dev/null +++ b/tests/qml/data/send.html @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/tests/qml/data/signal.html b/tests/qml/data/signal.html new file mode 100644 index 0000000..e3815cb --- /dev/null +++ b/tests/qml/data/signal.html @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/tests/qml/data/wrapper.html b/tests/qml/data/wrapper.html new file mode 100644 index 0000000..54f456b --- /dev/null +++ b/tests/qml/data/wrapper.html @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/tests/qml/disconnect.html b/tests/qml/disconnect.html deleted file mode 100644 index f4cbb0a..0000000 --- a/tests/qml/disconnect.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - diff --git a/tests/qml/grouping.html b/tests/qml/grouping.html deleted file mode 100644 index bb804f4..0000000 --- a/tests/qml/grouping.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/tests/qml/method.html b/tests/qml/method.html deleted file mode 100644 index 618550f..0000000 --- a/tests/qml/method.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/tests/qml/property.html b/tests/qml/property.html deleted file mode 100644 index 1a8360a..0000000 --- a/tests/qml/property.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - diff --git a/tests/qml/qml.cpp b/tests/qml/qml.cpp index 242a2b6..9dfd7e6 100644 --- a/tests/qml/qml.cpp +++ b/tests/qml/qml.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff ** Contact: http://www.qt-project.org/legal ** -** This file is part of the QWebChannel module on Qt labs. +** This file is part of the QtWebChannel module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/tests/qml/qml.pro b/tests/qml/qml.pro index c969291..a2b6933 100644 --- a/tests/qml/qml.pro +++ b/tests/qml/qml.pro @@ -1,10 +1,19 @@ -QT += testlib - +QT += testlib declarative +TEMPLATE = app TARGET = qml CONFIG += warn_on qmltestcase -IMPORTPATH += $$OUT_PWD/../../src $$PWD +# TODO: running tests without requiring make install +IMPORTPATH += $$PWD SOURCES += \ qml.cpp + +OTHER_FILES += \ + WebChannelTest.qml \ + tst_webchannel.qml \ + tst_metaobjectpublisher.qml \ + tst_bench.qml + +TESTDATA = data/* diff --git a/tests/qml/receiveRaw.html b/tests/qml/receiveRaw.html deleted file mode 100644 index cfe685e..0000000 --- a/tests/qml/receiveRaw.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - diff --git a/tests/qml/respond.html b/tests/qml/respond.html deleted file mode 100644 index 29e47b8..0000000 --- a/tests/qml/respond.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - diff --git a/tests/qml/send.html b/tests/qml/send.html deleted file mode 100644 index f30e9c8..0000000 --- a/tests/qml/send.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - diff --git a/tests/qml/signal.html b/tests/qml/signal.html deleted file mode 100644 index e3815cb..0000000 --- a/tests/qml/signal.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/tests/qml/tst_bench.qml b/tests/qml/tst_bench.qml index c7c7c7c..6893a00 100644 --- a/tests/qml/tst_bench.qml +++ b/tests/qml/tst_bench.qml @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff ** Contact: http://www.qt-project.org/legal ** -** This file is part of the QWebChannel module on Qt labs. +** This file is part of the QtWebChannel module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -33,7 +33,7 @@ import QtQuick 2.0 -import Qt.labs.WebChannel 1.0 +import QtWebChannel 1.0 WebChannelTest { name: "Bench" diff --git a/tests/qml/tst_metaobjectpublisher.qml b/tests/qml/tst_metaobjectpublisher.qml index 6cb01e6..c99cb47 100644 --- a/tests/qml/tst_metaobjectpublisher.qml +++ b/tests/qml/tst_metaobjectpublisher.qml @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff ** Contact: http://www.qt-project.org/legal ** -** This file is part of the QWebChannel module on Qt labs. +** This file is part of the QtWebChannel module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -33,7 +33,7 @@ import QtQuick 2.0 -import Qt.labs.WebChannel 1.0 +import QtWebChannel 1.0 WebChannelTest { name: "MetaObjectPublisher" diff --git a/tests/qml/tst_webchannel.qml b/tests/qml/tst_webchannel.qml index a915ea3..2cc6153 100644 --- a/tests/qml/tst_webchannel.qml +++ b/tests/qml/tst_webchannel.qml @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff ** Contact: http://www.qt-project.org/legal ** -** This file is part of the QWebChannel module on Qt labs. +** This file is part of the QtWebChannel module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/tests/qml/wrapper.html b/tests/qml/wrapper.html deleted file mode 100644 index 54f456b..0000000 --- a/tests/qml/wrapper.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - diff --git a/tests/tests.pro b/tests/tests.pro index 3f166e8..a839495 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs -SUBDIRS = \ - qml +qtHaveModule(quick) { + SUBDIRS += qml +} -- cgit v1.2.1