summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-04-15 14:06:46 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-04-15 15:08:54 +0200
commite6ad150805cc64db20d3ff3ae5fe2d356c04913b (patch)
tree0b3b6ea949c5a42005d564b79b1783b935f1a85e /tests/auto
parent830f1db786de48d34b16905086220a6ac28a0203 (diff)
parent1b992406a6523a144c58baa9bbd1198bb9a2d98c (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: a bunch of .pro and configure.json file adjustments and some conflicting cherry-picks from dev -> 5.15 that are merged into dev again src/assistant/assistant/main.cpp Change-Id: I174c00b6a300c6d46c4e081bdcb2f15f23ae9ef2
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseobjc/main.mm51
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseobjc/project.pro3
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseobjc/project.ts.result20
-rw-r--r--tests/auto/linguist/lupdate/tst_lupdate.cpp3
-rw-r--r--tests/auto/qdoc/config/testdata/configs/exampletest.qdocconf2
-rw-r--r--tests/auto/qdoc/config/testdata/exampletest/examples/test/empty/test.pro1
-rw-r--r--tests/auto/qdoc/config/testdata/exampletest/examples/test/example1/example1.pro1
-rw-r--r--tests/auto/qdoc/config/testdata/exampletest/examples/test/example2/example2.qmlproject1
-rw-r--r--tests/auto/qdoc/config/testdata/exampletest/examples/test/example3/example3.pyproject1
-rw-r--r--tests/auto/qdoc/config/testdata/exampletest/examples/test/example4/CMakeLists.txt1
-rw-r--r--tests/auto/qdoc/config/tst_config.cpp29
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/demos-manifest.xml9
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml5
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/nestedmacro/testcpp-module.html43
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/noautolist-docbook/qdoc-test-qmlmodule.xml12
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/noautolist-docbook/test-componentset-example.xml37
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/noautolist-docbook/testcpp-module.xml15
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/noautolist/qdoc-test-qmlmodule.html16
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/noautolist/test-componentset-example.html51
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/noautolist/testcpp-module.html29
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/test-cmaketest-example.html22
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/test.qhp6
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/configs/examples-qhp.qdocconf2
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/configs/nestedmacro.qdocconf9
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/configs/noautolist.qdocconf13
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf1
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/configs/testqml.qdocconf2
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/demo.pro2
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/doc/src/demo.qdoc32
-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
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/qml/componentset/examples.qdoc2
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp2
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/singleexec/singleexec.qdocconf4
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp6
-rw-r--r--tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp22
37 files changed, 487 insertions, 3 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseobjc/main.mm b/tests/auto/linguist/lupdate/testdata/good/parseobjc/main.mm
new file mode 100644
index 000000000..7cc1c34e3
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/parseobjc/main.mm
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite 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 <QtCore/qcoreapplication.h>
+
+@interface NSObject
+@end
+
+@interface Foo : NSObject
+@property (nonatomic, retain) NSObject *child;
+- (bool)someMethodWithArg:(NSObject*)child andAnotherArg:(int)age;
+@end
+
+@implementation Foo
+- (bool)someMethodWithArg:(NSObject*)child andAnotherArg:(int)age
+{
+ QCoreApplication::translate("Biz", "Baz");
+ return self.child == child && age == 42;
+}
+@end
+
+int main()
+{
+ QCoreApplication::translate("Foo", "Bar");
+ return 0;
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseobjc/project.pro b/tests/auto/linguist/lupdate/testdata/good/parseobjc/project.pro
new file mode 100644
index 000000000..e9d4e1ec3
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/parseobjc/project.pro
@@ -0,0 +1,3 @@
+SOURCES += main.mm
+
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseobjc/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parseobjc/project.ts.result
new file mode 100644
index 000000000..675d16449
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/parseobjc/project.ts.result
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1">
+<context>
+ <name>Biz</name>
+ <message>
+ <location filename="main.mm" line="42"/>
+ <source>Baz</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Foo</name>
+ <message>
+ <location filename="main.mm" line="49"/>
+ <source>Bar</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/tst_lupdate.cpp b/tests/auto/linguist/lupdate/tst_lupdate.cpp
index b2ced9df8..ac6e4db2b 100644
--- a/tests/auto/linguist/lupdate/tst_lupdate.cpp
+++ b/tests/auto/linguist/lupdate/tst_lupdate.cpp
@@ -222,6 +222,9 @@ void tst_lupdate::good_data()
#ifndef Q_OS_WIN
dirs.removeAll(QLatin1String("backslashes"));
#endif
+#ifndef Q_OS_MACOS
+ dirs.removeAll(QLatin1String("parseobjc"));
+#endif
for (const QString &dir : qAsConst(dirs))
QTest::newRow(dir.toLocal8Bit()) << dir;
diff --git a/tests/auto/qdoc/config/testdata/configs/exampletest.qdocconf b/tests/auto/qdoc/config/testdata/configs/exampletest.qdocconf
new file mode 100644
index 000000000..a1459f977
--- /dev/null
+++ b/tests/auto/qdoc/config/testdata/configs/exampletest.qdocconf
@@ -0,0 +1,2 @@
+project = ExampleTest
+exampledirs = ../exampletest/examples
diff --git a/tests/auto/qdoc/config/testdata/exampletest/examples/test/empty/test.pro b/tests/auto/qdoc/config/testdata/exampletest/examples/test/empty/test.pro
new file mode 100644
index 000000000..556df42ea
--- /dev/null
+++ b/tests/auto/qdoc/config/testdata/exampletest/examples/test/empty/test.pro
@@ -0,0 +1 @@
+# nothing
diff --git a/tests/auto/qdoc/config/testdata/exampletest/examples/test/example1/example1.pro b/tests/auto/qdoc/config/testdata/exampletest/examples/test/example1/example1.pro
new file mode 100644
index 000000000..556df42ea
--- /dev/null
+++ b/tests/auto/qdoc/config/testdata/exampletest/examples/test/example1/example1.pro
@@ -0,0 +1 @@
+# nothing
diff --git a/tests/auto/qdoc/config/testdata/exampletest/examples/test/example2/example2.qmlproject b/tests/auto/qdoc/config/testdata/exampletest/examples/test/example2/example2.qmlproject
new file mode 100644
index 000000000..556df42ea
--- /dev/null
+++ b/tests/auto/qdoc/config/testdata/exampletest/examples/test/example2/example2.qmlproject
@@ -0,0 +1 @@
+# nothing
diff --git a/tests/auto/qdoc/config/testdata/exampletest/examples/test/example3/example3.pyproject b/tests/auto/qdoc/config/testdata/exampletest/examples/test/example3/example3.pyproject
new file mode 100644
index 000000000..556df42ea
--- /dev/null
+++ b/tests/auto/qdoc/config/testdata/exampletest/examples/test/example3/example3.pyproject
@@ -0,0 +1 @@
+# nothing
diff --git a/tests/auto/qdoc/config/testdata/exampletest/examples/test/example4/CMakeLists.txt b/tests/auto/qdoc/config/testdata/exampletest/examples/test/example4/CMakeLists.txt
new file mode 100644
index 000000000..556df42ea
--- /dev/null
+++ b/tests/auto/qdoc/config/testdata/exampletest/examples/test/example4/CMakeLists.txt
@@ -0,0 +1 @@
+# nothing
diff --git a/tests/auto/qdoc/config/tst_config.cpp b/tests/auto/qdoc/config/tst_config.cpp
index 1e9383fb9..44a1ba953 100644
--- a/tests/auto/qdoc/config/tst_config.cpp
+++ b/tests/auto/qdoc/config/tst_config.cpp
@@ -28,6 +28,8 @@
#include "config.h"
+#include <QtCore/qdir.h>
+#include <QtCore/qfileinfo.h>
#include <QtCore/qhash.h>
#include <QtCore/qstringlist.h>
#include <QtTest/QtTest>
@@ -43,6 +45,7 @@ class tst_Config : public QObject
private slots:
void classMembersInitializeToFalseOrEmpty();
void includePathsFromCommandLine();
+ void getExampleProjectFile();
};
void tst_Config::classMembersInitializeToFalseOrEmpty()
@@ -80,6 +83,32 @@ void tst_Config::includePathsFromCommandLine()
QCOMPARE(actual, expected);
}
+void::tst_Config::getExampleProjectFile()
+{
+ QStringList commandLineArgs = { QStringLiteral("./qdoc") };
+ Config::instance().init("QDoc Test", commandLineArgs);
+ auto &config = Config::instance();
+
+ const auto docConfig = QFINDTESTDATA("/testdata/configs/exampletest.qdocconf");
+ config.load(docConfig);
+
+ auto rootDir = QFileInfo(docConfig).dir();
+ QVERIFY(rootDir.cd("../exampletest/examples/test"));
+
+ QVERIFY(config.getExampleProjectFile("invalid").isEmpty());
+ QVERIFY(config.getExampleProjectFile("test/empty").isEmpty());
+
+ QCOMPARE(config.getExampleProjectFile("test/example1"),
+ rootDir.absoluteFilePath("example1/example1.pro"));
+ QCOMPARE(config.getExampleProjectFile("test/example2"),
+ rootDir.absoluteFilePath("example2/example2.qmlproject"));
+ QCOMPARE(config.getExampleProjectFile("test/example3"),
+ rootDir.absoluteFilePath("example3/example3.pyproject"));
+ QCOMPARE(config.getExampleProjectFile("test/example4"),
+ rootDir.absoluteFilePath("example4/CMakeLists.txt"));
+}
+
+
QTEST_APPLESS_MAIN(tst_Config)
#include "tst_config.moc"
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/demos-manifest.xml b/tests/auto/qdoc/generatedoutput/expected_output/demos-manifest.xml
new file mode 100644
index 000000000..d83906f44
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/demos-manifest.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<instructionals module="Test">
+ <demos>
+ <demo name="Demo" docUrl="qthelp://org.qt-project.test.001/test/test-demos-demo-example.html" projectPath="test/demos/demo/demo.pro" isTest="true">
+ <description><![CDATA[No description available]]></description>
+ <tags>demo,test</tags>
+ </demo>
+ </demos>
+</instructionals>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml b/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml
index 7f206d0e8..8aa9ce303 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<instructionals module="Test">
<examples>
+ <example name="CMake Example Project" docUrl="qthelp://org.qt-project.test.001/test/test-cmaketest-example.html" projectPath="test/cmaketest/CMakeLists.txt" isTest="true">
+ <description><![CDATA[No description available]]></description>
+ <tags>cmake,project,test</tags>
+ <fileToOpen mainFile="true">test/cmaketest/main.cpp</fileToOpen>
+ </example>
<example name="QML Documentation Example" docUrl="qthelp://org.qt-project.test.001/test/test-componentset-example.html" projectPath="tutorials/componentset/componentset.pro" isTest="true">
<description><![CDATA[Example for documenting QML types.]]></description>
<tags>documentation,qml,sample,test</tags>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/nestedmacro/testcpp-module.html b/tests/auto/qdoc/generatedoutput/expected_output/nestedmacro/testcpp-module.html
new file mode 100644
index 000000000..6ab4d245b
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/nestedmacro/testcpp-module.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+<!-- testcpp.cpp -->
+ <title>QDoc Test C++ Classes | TestCPP</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#namespaces">Namespaces</a></li>
+<li class="level1"><a href="#classes">Classes</a></li>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">QDoc Test C++ Classes</h1>
+<span class="subtitle"></span>
+<!-- $$$TestCPP-brief -->
+<p>A test module page. <a href="#details">More...</a></p>
+<!-- @@@TestCPP -->
+<a name="namespaces"></a>
+<h2 id="namespaces">Namespaces</h2>
+<div class="table"><table class="annotated">
+<tr class="odd topAlign"><td class="tblName"><p><a href="testqdoc.html">TestQDoc</a></p></td><td class="tblDescr"><p>A namespace</p></td></tr>
+</table></div>
+<a name="classes"></a>
+<h2 id="classes">Classes</h2>
+<div class="table"><table class="annotated">
+<tr class="odd topAlign"><td class="tblName"><p><a href="testqdoc-test.html">TestQDoc::Test</a></p></td><td class="tblDescr"><p>A class in a namespace</p></td></tr>
+<tr class="even topAlign"><td class="tblName"><p><a href="testqdoc-testderived.html">TestQDoc::TestDerived</a></p></td><td class="tblDescr"><p>A derived class in a namespace</p></td></tr>
+</table></div>
+<!-- $$$TestCPP-description -->
+<a name="details"></a>
+<div class="descr">
+<h2 id="details">Detailed Description</h2>
+<p><b>This module was introduced in version 5.15.</b></p>
+</div>
+<!-- @@@TestCPP -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/noautolist-docbook/qdoc-test-qmlmodule.xml b/tests/auto/qdoc/generatedoutput/expected_output/noautolist-docbook/qdoc-test-qmlmodule.xml
new file mode 100644
index 000000000..b99e58480
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/noautolist-docbook/qdoc-test-qmlmodule.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<db:article xmlns:db="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.2" xml:lang="en">
+<db:info>
+<db:title></db:title>
+<db:productname>Test</db:productname>
+<db:titleabbrev>A test project for QDoc build artifacts</db:titleabbrev>
+<db:abstract>
+<db:para>QML Types for the Test module.</db:para>
+</db:abstract>
+</db:info>
+<db:anchor xml:id="details"/>
+</db:article>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/noautolist-docbook/test-componentset-example.xml b/tests/auto/qdoc/generatedoutput/expected_output/noautolist-docbook/test-componentset-example.xml
new file mode 100644
index 000000000..4e1dbf915
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/noautolist-docbook/test-componentset-example.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<db:article xmlns:db="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.2" xml:lang="en">
+<db:info>
+<db:title>QML Documentation Example</db:title>
+<db:productname>Test</db:productname>
+<db:titleabbrev>A test project for QDoc build artifacts</db:titleabbrev>
+<db:abstract>
+<db:para>Example for documenting QML types.</db:para>
+</db:abstract>
+</db:info>
+<db:para>This example demonstrates one of the ways to document QML types.</db:para>
+<db:para>In particular, there are sample types that are documented with QDoc commands comments. There are documentation comments for the QML types and their public interfaces. The types are grouped into a module, the <db:link xlink:href="uicomponents-qmlmodule.xml">UI Components</db:link> module.</db:para>
+<db:para>The uicomponents.qdoc file generates the overview page for the <db:link xlink:href="uicomponents-qmlmodule.xml">UI Components</db:link> module page.</db:para>
+<db:para>The generated documentation is available in the <db:link xlink:href="uicomponents-qmlmodule.xml">UI Components</db:link> module.</db:para>
+<db:section xml:id="qml-class">
+<db:title>QML Class</db:title>
+<db:para>The QML types use the \qmltype to document the type. In addition, they have the \inmodule command in order for QDoc to associate them to the <db:code>UIComponents</db:code> module.</db:para>
+<db:para>QDoc uses the \brief command to place a basic description when listing the types.</db:para>
+</db:section>
+<db:section xml:id="properties-signals-handlers-and-methods">
+<db:title>Properties, Signals, Handlers, and Methods</db:title>
+<db:para>The types have their properties, signals, handlers, and methods defined in their respective QML files. QDoc associates the properties and methods to the types, therefore, you only need to place the documentation above the property, method, or signal.</db:para>
+<db:para>To document the type of a <db:emphasis>property alias</db:emphasis>, you must use the \qmlproperty command to specify the data type.</db:para>
+<db:programlisting language="cpp">\qmlproperty &lt;@type&gt;int&lt;/@type&gt; anAliasedProperty
+An aliased property of type &lt;@type&gt;int&lt;/@type&gt;&lt;@op&gt;.&lt;/@op&gt;
+</db:programlisting>
+<db:section xml:id="internal-documentation">
+<db:title>Internal Documentation</db:title>
+<db:para>You may declare that a documentation is for internal use by placing the \internal command after the beginning QDoc comment <db:code>/*</db:code>. QDoc will prevent the internal documentation from appearing in the public API.</db:para>
+<db:para>If you wish to omit certain parts of the documentation, you may use the \omit and \endomit command.</db:para>
+</db:section>
+</db:section>
+<db:section xml:id="qml-types-with-c-implementation">
+<db:title>QML Types with C++ Implementation</db:title>
+<db:para>This example only demonstrates the documentation for types in QML files, but the regular QML commands may be placed inside C++ classes to define the public API of the QML type.</db:para>
+</db:section>
+</db:article>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/noautolist-docbook/testcpp-module.xml b/tests/auto/qdoc/generatedoutput/expected_output/noautolist-docbook/testcpp-module.xml
new file mode 100644
index 000000000..d2ba83a13
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/noautolist-docbook/testcpp-module.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<db:article xmlns:db="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.2" xml:lang="en">
+<db:info>
+<db:title>QDoc Test C++ Classes</db:title>
+<db:productname>Test</db:productname>
+<db:titleabbrev>A test project for QDoc build artifacts</db:titleabbrev>
+<db:abstract>
+<db:para>A test module page.</db:para>
+</db:abstract>
+</db:info>
+<db:para>A test module page.</db:para>
+<db:section xml:id="details">
+<db:title>Detailed Description</db:title>
+</db:section>
+</db:article>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/noautolist/qdoc-test-qmlmodule.html b/tests/auto/qdoc/generatedoutput/expected_output/noautolist/qdoc-test-qmlmodule.html
new file mode 100644
index 000000000..8efd70c0f
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/noautolist/qdoc-test-qmlmodule.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+<!-- type.cpp -->
+ <title>Test</title>
+</head>
+<body>
+<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
+<span class="subtitle"></span>
+<!-- $$$QDoc.Test-description -->
+<div class="descr"> <a name="details"></a>
+</div>
+<!-- @@@QDoc.Test -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/noautolist/test-componentset-example.html b/tests/auto/qdoc/generatedoutput/expected_output/noautolist/test-componentset-example.html
new file mode 100644
index 000000000..5331c2b35
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/noautolist/test-componentset-example.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+<!-- examples.qdoc -->
+ <title>QML Documentation Example | Test</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#qml-class">QML Class</a></li>
+<li class="level1"><a href="#properties-signals-handlers-and-methods">Properties, Signals, Handlers, and Methods</a></li>
+<li class="level2"><a href="#internal-documentation">Internal Documentation</a></li>
+<li class="level1"><a href="#qml-types-with-c-implementation">QML Types with C++ Implementation</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">QML Documentation Example</h1>
+<span class="subtitle"></span>
+<!-- $$$componentset-brief -->
+<p>Example for documenting QML types.</p>
+<!-- @@@componentset -->
+<!-- $$$componentset-description -->
+<div class="descr"> <a name="details"></a>
+<p>This example demonstrates one of the ways to document QML types.</p>
+<p>In particular, there are sample types that are documented with QDoc commands comments. There are documentation comments for the QML types and their public interfaces. The types are grouped into a module, the <a href="uicomponents-qmlmodule.html">UI Components</a> module.</p>
+<p>The uicomponents.qdoc file generates the overview page for the <a href="uicomponents-qmlmodule.html">UI Components</a> module page.</p>
+<p>The generated documentation is available in the <a href="uicomponents-qmlmodule.html">UI Components</a> module.</p>
+<a name="qml-class"></a>
+<h4 id="qml-class">QML Class</h4>
+<p>The QML types use the \qmltype to document the type. In addition, they have the \inmodule command in order for QDoc to associate them to the <code>UIComponents</code> module.</p>
+<p>QDoc uses the \brief command to place a basic description when listing the types.</p>
+<a name="properties-signals-handlers-and-methods"></a>
+<h4 id="properties-signals-handlers-and-methods">Properties, Signals, Handlers, and Methods</h4>
+<p>The types have their properties, signals, handlers, and methods defined in their respective QML files. QDoc associates the properties and methods to the types, therefore, you only need to place the documentation above the property, method, or signal.</p>
+<p>To document the type of a <i>property alias</i>, you must use the \qmlproperty command to specify the data type.</p>
+<pre class="cpp">\qmlproperty <span class="type">int</span> anAliasedProperty
+An aliased property of type <span class="type">int</span><span class="operator">.</span></pre>
+<a name="internal-documentation"></a>
+<h5 id="internal-documentation">Internal Documentation</h5>
+<p>You may declare that a documentation is for internal use by placing the \internal command after the beginning QDoc comment <code>/*</code>. QDoc will prevent the internal documentation from appearing in the public API.</p>
+<p>If you wish to omit certain parts of the documentation, you may use the \omit and \endomit command.</p>
+<a name="qml-types-with-c-implementation"></a>
+<h4 id="qml-types-with-c-implementation">QML Types with C++ Implementation</h4>
+<p>This example only demonstrates the documentation for types in QML files, but the regular QML commands may be placed inside C++ classes to define the public API of the QML type.</p>
+</div>
+<!-- @@@componentset -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/noautolist/testcpp-module.html b/tests/auto/qdoc/generatedoutput/expected_output/noautolist/testcpp-module.html
new file mode 100644
index 000000000..8108b0979
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/noautolist/testcpp-module.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+<!-- testcpp.cpp -->
+ <title>QDoc Test C++ Classes | Test</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">QDoc Test C++ Classes</h1>
+<span class="subtitle"></span>
+<!-- $$$TestCPP-brief -->
+<p>A test module page. <a href="#details">More...</a></p>
+<!-- @@@TestCPP -->
+<!-- $$$TestCPP-description -->
+<a name="details"></a>
+<div class="descr">
+<h2 id="details">Detailed Description</h2>
+</div>
+<!-- @@@TestCPP -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test-cmaketest-example.html b/tests/auto/qdoc/generatedoutput/expected_output/test-cmaketest-example.html
new file mode 100644
index 000000000..dc123674d
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/test-cmaketest-example.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+<!-- cmaketest.qdoc -->
+ <title>CMake Example Project | Test</title>
+</head>
+<body>
+<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">CMake Example Project</h1>
+<span class="subtitle"></span>
+<!-- $$$cmaketest-description -->
+<div class="descr"> <a name="details"></a>
+<p>Files:</p>
+<ul>
+<li><a href="test-cmaketest-cmakelists-txt.html">cmaketest/CMakeLists.txt</a></li>
+<li><a href="test-cmaketest-main-cpp.html">cmaketest/main.cpp</a></li>
+</ul>
+</div>
+<!-- @@@cmaketest -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp
index 4816ef1d5..387e018ae 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp
+++ b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp
@@ -8,6 +8,8 @@
<section ref="uicomponents-qmlmodule.html" title="UI Components">
<section ref="uicomponents-qmlmodule.html" title="Test">
<section ref="qdoc-test-qmlmodule.html" title=""/>
+ <section ref="test-cmaketest-example.html" title="CMake Example Project"/>
+ <section ref="test-demos-demo-example.html" title="Demo"/>
<section ref="testcpp-module.html" title="QDoc Test C++ Classes"/>
<section ref="test-componentset-example.html" title="QML Documentation Example"/>
<section ref="uicomponents-qmlmodule.html" title="UI Components"/>
@@ -119,11 +121,15 @@
<file>qml-uicomponents-switch.html</file>
<file>qml-uicomponents-tabwidget-members.html</file>
<file>qml-uicomponents-tabwidget.html</file>
+ <file>test-cmaketest-cmakelists-txt.html</file>
+ <file>test-cmaketest-example.html</file>
+ <file>test-cmaketest-main-cpp.html</file>
<file>test-componentset-componentset-pro.html</file>
<file>test-componentset-example.html</file>
<file>test-componentset-progressbar-qml.html</file>
<file>test-componentset-switch-qml.html</file>
<file>test-componentset-tabwidget-qml.html</file>
+ <file>test-demos-demo-example.html</file>
<file>testcpp-module.html</file>
<file>testqdoc-test-members.html</file>
<file>testqdoc-test-obsolete.html</file>
diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/examples-qhp.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/examples-qhp.qdocconf
index a1ed619a3..11695289e 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/configs/examples-qhp.qdocconf
+++ b/tests/auto/qdoc/generatedoutput/testdata/configs/examples-qhp.qdocconf
@@ -4,6 +4,8 @@ version = 0.0.1
examplesinstallpath = test
+exampledirs += ../examples
+
# Configure .qhp generation
qhp.projects = Test
diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/nestedmacro.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/nestedmacro.qdocconf
new file mode 100644
index 000000000..64475be7e
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testdata/configs/nestedmacro.qdocconf
@@ -0,0 +1,9 @@
+include(testcpp.qdocconf)
+defines += test_nestedmacro
+
+macro.ver = "5.15.0"
+macro.ver.match = "^(\\d+\\.\\d+)"
+macro.versionnote.HTML = "<p><b>This \1 was introduced in version \2.</b></p>\n"
+
+HTML.nosubdirs = true
+HTML.outputsubdir = nestedmacro
diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/noautolist.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/noautolist.qdocconf
new file mode 100644
index 000000000..fc720c57e
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testdata/configs/noautolist.qdocconf
@@ -0,0 +1,13 @@
+include(testqml.qdocconf)
+defines += test_noautolist
+
+outputformats = HTML DocBook
+
+HTML.nosubdirs = true
+DocBook.nosubdirs = true
+HTML.outputsubdir = noautolist
+DocBook.outputsubdir = noautolist-docbook
+
+# TODO: DocBook generator has trouble handling shared comment nodes
+# - allow two warnings related to these
+warninglimit = 2
diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf
index b07aa71c0..7bb7810f1 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf
+++ b/tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf
@@ -6,6 +6,7 @@ sources = ../testcpp/testcpp.cpp
macro.CMDFN = \\\\fn
macro.nothing = \\dontdocument ()
+macro.testnoautolist = \\if defined(test_noautolist)\n\\noautolist\n\\endif
locationinfo = false
# zero warning tolerance
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/examples/demos/demo/demo.pro b/tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/demo.pro
new file mode 100644
index 000000000..dbe8ff3c0
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/demo.pro
@@ -0,0 +1,2 @@
+TEMPLATE = aux
+message("Nothing to see here.")
diff --git a/tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/doc/src/demo.qdoc b/tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/doc/src/demo.qdoc
new file mode 100644
index 000000000..08b609126
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/doc/src/demo.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 demos/demo
+ \title Demo
+*/
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(){}
diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/componentset/examples.qdoc b/tests/auto/qdoc/generatedoutput/testdata/qml/componentset/examples.qdoc
index 0816e624c..bce12a4ae 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/qml/componentset/examples.qdoc
+++ b/tests/auto/qdoc/generatedoutput/testdata/qml/componentset/examples.qdoc
@@ -30,6 +30,8 @@
\title QML Documentation Example
\brief Example for documenting QML types.
+ \testnoautolist
+
\meta tag {test,sample}
\meta installpath tutorials
diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp b/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp
index bf04bdb43..2e967c4a2 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp
+++ b/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp
@@ -31,6 +31,8 @@
/*!
\qmlmodule QDoc.Test \QDocTestVer
\brief QML Types for the Test module.
+
+ \testnoautolist
*/
/*!
diff --git a/tests/auto/qdoc/generatedoutput/testdata/singleexec/singleexec.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/singleexec/singleexec.qdocconf
index eee0253d0..037cfc74a 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/singleexec/singleexec.qdocconf
+++ b/tests/auto/qdoc/generatedoutput/testdata/singleexec/singleexec.qdocconf
@@ -1,2 +1,2 @@
-./testdata/configs/testcpp_singleexec.qdocconf
-./testdata/crossmodule/crossmodule_singleexec.qdocconf
+../configs/testcpp_singleexec.qdocconf
+../crossmodule/crossmodule_singleexec.qdocconf
diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp
index b1acdccf0..17045eed5 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp
+++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp
@@ -34,6 +34,12 @@ namespace TestQDoc {
\qtvariable testcpp
\title QDoc Test C++ Classes
\brief A test module page.
+
+ \testnoautolist
+
+\if defined(test_nestedmacro)
+ \versionnote {module} {\ver}
+\endif
*/
/*!
diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
index 5449a50e2..40fcdfcac 100644
--- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
+++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
@@ -67,6 +67,8 @@ private slots:
void singleExec();
void preparePhase();
void generatePhase();
+ void noAutoList();
+ void nestedMacro();
private:
QScopedPointer<QTemporaryDir> m_outputDir;
@@ -203,6 +205,7 @@ void tst_generatedOutput::htmlFromQml()
{
testAndCompare("testdata/configs/testqml.qdocconf",
"test-componentset-example.html "
+ "test-cmaketest-example.html "
"uicomponents-qmlmodule.html "
"qdoc-test-qmlmodule.html "
"qml-qdoc-test-abstractparent.html "
@@ -292,6 +295,7 @@ void tst_generatedOutput::examplesManifestXmlAndQhp()
{
testAndCompare("testdata/configs/examples-qhp.qdocconf",
"examples-manifest.xml "
+ "demos-manifest.xml "
"test.qhp");
}
@@ -378,6 +382,24 @@ void tst_generatedOutput::generatePhase()
"-generate");
}
+void tst_generatedOutput::noAutoList()
+{
+ testAndCompare("testdata/configs/noautolist.qdocconf",
+ "noautolist/testcpp-module.html "
+ "noautolist/test-componentset-example.html "
+ "noautolist/qdoc-test-qmlmodule.html "
+ "noautolist-docbook/testcpp-module.xml "
+ "noautolist-docbook/test-componentset-example.xml "
+ "noautolist-docbook/qdoc-test-qmlmodule.xml");
+}
+
+
+void tst_generatedOutput::nestedMacro()
+{
+ testAndCompare("testdata/configs/nestedmacro.qdocconf",
+ "nestedmacro/testcpp-module.html");
+}
+
QTEST_APPLESS_MAIN(tst_generatedOutput)
#include "tst_generatedoutput.moc"