summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdoc/generatedoutput/testdata
diff options
context:
space:
mode:
authorVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2020-03-16 15:08:20 +0100
committerTopi Reinio <topi.reinio@qt.io>2020-03-20 09:57:26 +0100
commit02265f9bbc213d219afc345594307affb900e07e (patch)
tree882a41d2bba43c256a4ae565a65c89e07d29ce79 /tests/auto/qdoc/generatedoutput/testdata
parentcc92cb9329e1fc17758ef432cfa5e2c938a18da0 (diff)
qdoc: Extend \example command to consider CMake projects
QDoc looks for project file(s) in the example directories before generating docs for the example. Now that we are moving towards CMake, it's ideal that qdoc is aware of this new project file type. Refactor the code that looks for project files - add a new function to Config for this purpose, and store the project file name into ExampleNode. This allows removal of duplicated logic when generating the example-manifest.xml file. Add a unit test for Config::getExampleProjectFile(), and modify the generatedoutput test to cover output for a CMake-based example. [ChangeLog][qdoc] Added support for CMake-based example projects. Fixes: QTBUG-82908 Change-Id: If9f061c613fee94b35df277043c2f4df93da7ec0 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'tests/auto/qdoc/generatedoutput/testdata')
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/configs/testqml.qdocconf2
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/qml/cmaketest/CMakeLists.txt2
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/qml/cmaketest/doc/src/cmaketest.qdoc32
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/qml/cmaketest/main.cpp1
4 files changed, 36 insertions, 1 deletions
diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/testqml.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/testqml.qdocconf
index 2eb2c5036..8eec4ea4d 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/configs/testqml.qdocconf
+++ b/tests/auto/qdoc/generatedoutput/testdata/configs/testqml.qdocconf
@@ -16,7 +16,7 @@ excludedirs = ../bug80259
sources.fileextensions = "*.qml *.cpp *.qdoc"
headers.fileextensions = "*.h"
-examples.fileextensions = "*.qml"
+examples.fileextensions = "*.qml *.cpp"
macro.begincomment = "\\c{/*}"
macro.QDocTestVer = "1.1"
diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/cmaketest/CMakeLists.txt b/tests/auto/qdoc/generatedoutput/testdata/qml/cmaketest/CMakeLists.txt
new file mode 100644
index 000000000..c6a5c654b
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testdata/qml/cmaketest/CMakeLists.txt
@@ -0,0 +1,2 @@
+cmake_minimum_required (VERSION 2.8.11)
+project (QDOCTEST)
diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/cmaketest/doc/src/cmaketest.qdoc b/tests/auto/qdoc/generatedoutput/testdata/qml/cmaketest/doc/src/cmaketest.qdoc
new file mode 100644
index 000000000..13767e147
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testdata/qml/cmaketest/doc/src/cmaketest.qdoc
@@ -0,0 +1,32 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications 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$
+**
+****************************************************************************/
+
+/*!
+ \example cmaketest
+ \title CMake Example Project
+*/
diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/cmaketest/main.cpp b/tests/auto/qdoc/generatedoutput/testdata/qml/cmaketest/main.cpp
new file mode 100644
index 000000000..68d71eb71
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testdata/qml/cmaketest/main.cpp
@@ -0,0 +1 @@
+void main(){}