summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick3d
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2016-10-06 15:03:18 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-12-16 07:15:20 +0000
commit68cb31fcad89f15e9977b9a6c6314b857eee0928 (patch)
tree513d559be9ca6cb3c09b296110e0f18effb4b79f /tests/auto/quick3d
parent1046123cd225a1ef8403d9b93dc84c68897337c1 (diff)
Add unit tests to check all Quick3DInput imports
Change-Id: Ia95dc4f5a8ac3494e2137a9f26ed70180ba15eaa Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/auto/quick3d')
-rw-r--r--tests/auto/quick3d/3dinput/3dinput.pro13
-rw-r--r--tests/auto/quick3d/3dinput/3dinput.qml52
-rw-r--r--tests/auto/quick3d/3dinput/3dinput.qrc5
-rw-r--r--tests/auto/quick3d/3dinput/tst_import3dinput.cpp52
-rw-r--r--tests/auto/quick3d/quick3d.pro3
5 files changed, 124 insertions, 1 deletions
diff --git a/tests/auto/quick3d/3dinput/3dinput.pro b/tests/auto/quick3d/3dinput/3dinput.pro
new file mode 100644
index 000000000..a45f4b563
--- /dev/null
+++ b/tests/auto/quick3d/3dinput/3dinput.pro
@@ -0,0 +1,13 @@
+TEMPLATE = app
+
+TARGET = tst_import3dinput
+
+QT += 3dcore 3dcore-private 3drender 3drender-private testlib 3dquick
+
+CONFIG += testcase
+
+SOURCES += tst_import3dinput.cpp
+
+include(../../render/qmlscenereader/qmlscenereader.pri)
+
+RESOURCES += 3dinput.qrc
diff --git a/tests/auto/quick3d/3dinput/3dinput.qml b/tests/auto/quick3d/3dinput/3dinput.qml
new file mode 100644
index 000000000..9ae53f66a
--- /dev/null
+++ b/tests/auto/quick3d/3dinput/3dinput.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+import Qt3D.Input 2.0 as QQ3Input20
+import QtQuick 2.0
+
+Item {
+
+ // Misc
+ //QQ3Input20.KeyEvent // (uncreatable) Qt3DInput::QKeyEvent
+ QQ3Input20.KeyboardDevice {} //Qt3DInput::QKeyboardDevice
+ QQ3Input20.KeyboardHandler {} //Qt3DInput::QKeyboardHandler
+ QQ3Input20.InputSettings {} //Qt3DInput::QInputSettings
+ //QQ3Input20.MouseEvent // (uncreatable) Qt3DInput::QMouseEvent
+ //QQ3Input20.WheelEvent // (uncreatable) Qt3DInput::QWheelEvent
+ QQ3Input20.MouseHandler {} //Qt3DInput::QMouseHandler
+ QQ3Input20.MouseDevice {} //Qt3DInput::QMouseDevice
+ //QQ3Input20.AbstractActionInput // (uncreatable) Qt3DInput::QAbstractActionInput
+ QQ3Input20.ActionInput {} //Qt3DInput::QActionInput
+ //QQ3Input20.AbstractAxisInput // (uncreatable) Qt3DInput::QAbstractAxisInput
+ QQ3Input20.AxisSetting {} //Qt3DInput::QAxisSetting
+ QQ3Input20.AnalogAxisInput {} //Qt3DInput::QAnalogAxisInput
+ QQ3Input20.ButtonAxisInput {} //Qt3DInput::QButtonAxisInput
+ QQ3Input20.GamepadInput {} //Qt3DInput::QGamepadInput
+
+}
diff --git a/tests/auto/quick3d/3dinput/3dinput.qrc b/tests/auto/quick3d/3dinput/3dinput.qrc
new file mode 100644
index 000000000..096e25a28
--- /dev/null
+++ b/tests/auto/quick3d/3dinput/3dinput.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>3dinput.qml</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/quick3d/3dinput/tst_import3dinput.cpp b/tests/auto/quick3d/3dinput/tst_import3dinput.cpp
new file mode 100644
index 000000000..78216b07f
--- /dev/null
+++ b/tests/auto/quick3d/3dinput/tst_import3dinput.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtTest/QTest>
+#include <QObject>
+#include <qmlscenereader.h>
+
+class tst_import3dinput : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+
+ void checkQMLImports()
+ {
+ // GIVEN
+ QmlSceneReader sceneReader(QUrl("qrc:/3dinput.qml"));
+
+ // THEN
+ QVERIFY(sceneReader.root() != nullptr);
+ }
+};
+
+QTEST_MAIN(tst_import3dinput)
+
+#include "tst_import3dinput.moc"
diff --git a/tests/auto/quick3d/quick3d.pro b/tests/auto/quick3d/quick3d.pro
index 593a58e3a..4a83219d9 100644
--- a/tests/auto/quick3d/quick3d.pro
+++ b/tests/auto/quick3d/quick3d.pro
@@ -4,5 +4,6 @@ qtConfig(private_tests) {
SUBDIRS += \
quick3dnodeinstantiator \
dynamicnodecreation \
- 3drender
+ 3drender \
+ 3dinput
}