aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@qt.io>2021-09-28 12:09:54 +0200
committerTim Jenssen <tim.jenssen@qt.io>2021-09-28 11:32:34 +0000
commit3ed8d6075651f9975f576aa0501d54b25a9099b3 (patch)
tree44795b8d22f4bec4dbecde99315a553aad0790eb /tests
parentaa4b825809ba941d9f997a1aed26acd88a81270b (diff)
QmlDesigner: Integrate QmlDom
Task-number: QDS-5172 Change-Id: Ib17c38ef7b89b05daababaad1f8e2dc39d53a2bf Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/unittest/CMakeLists.txt15
-rw-r--r--tests/unit/unittest/qmldom-test.cpp51
2 files changed, 66 insertions, 0 deletions
diff --git a/tests/unit/unittest/CMakeLists.txt b/tests/unit/unittest/CMakeLists.txt
index f9f4f73e26..5699475432 100644
--- a/tests/unit/unittest/CMakeLists.txt
+++ b/tests/unit/unittest/CMakeLists.txt
@@ -474,3 +474,18 @@ extend_qtc_test(unittest
SOURCES
clangformat-test.cpp
)
+
+get_filename_component(
+ QMLDOM_STANDALONE_CMAKELISTS
+ "${CMAKE_CURRENT_SOURCE_DIR}/../../../../qmldom_standalone/src/qmldom/standalone/"
+ ABSOLUTE
+)
+
+if(EXISTS ${QMLDOM_STANDALONE_CMAKELISTS})
+ add_subdirectory(${QMLDOM_STANDALONE_CMAKELISTS} qmldom_standalone)
+ extend_qtc_test(unittest
+ DEPENDS qmldomlib
+ SOURCES
+ qmldom-test.cpp
+ )
+endif()
diff --git a/tests/unit/unittest/qmldom-test.cpp b/tests/unit/unittest/qmldom-test.cpp
new file mode 100644
index 0000000000..b7e8557f10
--- /dev/null
+++ b/tests/unit/unittest/qmldom-test.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "googletest.h"
+
+// cast of the top level items (DomEnvironments,...)
+#include <qmldom/qqmldomtop_p.h>
+
+// everything is in the QQmlJS::Dom namespace
+using namespace QQmlJS::Dom;
+
+namespace {
+
+class QmlDom : public ::testing::Test
+{
+public:
+// static void SetUpTestCase();
+// static void TearDownTestCase();
+
+protected:
+};
+
+TEST_F(QmlDom, First)
+{
+ DomItem env = DomEnvironment::create({}, DomEnvironment::Option::SingleThreaded
+ | DomEnvironment::Option::NoDependencies);
+}
+
+} // anonymous