diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-01-25 03:01:54 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-01-25 03:01:54 +0100 |
commit | a66d0fba77e5ae50deebd325377187b31b58de4a (patch) | |
tree | 5a385e5f3bccdc647eb00f4bb2a46c3ab581a608 /tests | |
parent | dfe72000141db04d6dd17bc37291ef208733ffb4 (diff) | |
parent | eac773c8dfd0e2166db53c88f5aa0c1e85933cac (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I57321367797f347a23e26bb60aea137fb00a9d34
Diffstat (limited to 'tests')
25 files changed, 697 insertions, 4 deletions
diff --git a/tests/auto/qdoc/generatedoutput/TestCPP b/tests/auto/qdoc/generatedoutput/TestCPP index 50cce69ff..4ed786108 100644 --- a/tests/auto/qdoc/generatedoutput/TestCPP +++ b/tests/auto/qdoc/generatedoutput/TestCPP @@ -1 +1,5 @@ #include "testcpp.h" + +#ifdef test_template +# include "testtemplate.h" +#endif diff --git a/tests/auto/qdoc/generatedoutput/dontdocument/TestCPP b/tests/auto/qdoc/generatedoutput/dontdocument/TestCPP new file mode 100644 index 000000000..7291e6d8f --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/dontdocument/TestCPP @@ -0,0 +1,2 @@ +#include "../TestCPP" +#include "dont.h" diff --git a/tests/auto/qdoc/generatedoutput/dontdocument/dont.cpp b/tests/auto/qdoc/generatedoutput/dontdocument/dont.cpp new file mode 100644 index 000000000..33e208459 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/dontdocument/dont.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#include "dont.h" + +/*! + \class UnseenClass + \inmodule TestCPP + \brief A public but undocumented class. +*/ +UnseenClass::UnseenClass() +{ +} + +/*! + \class SeenClass + \inmodule TestCPP + \brief A public but undocumented class. +*/ +SeenClass::SeenClass() +{ +} diff --git a/tests/auto/qdoc/generatedoutput/dontdocument/dont.h b/tests/auto/qdoc/generatedoutput/dontdocument/dont.h new file mode 100644 index 000000000..5ef436b5c --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/dontdocument/dont.h @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#pragma once + +class UnseenClass +{ +public: + UnseenClass(); +}; + +class SeenClass : public UnseenClass +{ +public: + SeenClass(); +}; diff --git a/tests/auto/qdoc/generatedoutput/dontdocument/dontdocument.qdocconf b/tests/auto/qdoc/generatedoutput/dontdocument/dontdocument.qdocconf new file mode 100644 index 000000000..1c141784b --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/dontdocument/dontdocument.qdocconf @@ -0,0 +1,7 @@ +include(../testcpp.qdocconf) + +headers += dont.h +sources += dont.cpp test.qdoc + +HTML.nosubdirs = true +HTML.outputsubdir = dontdocument diff --git a/tests/auto/qdoc/generatedoutput/dontdocument/test.qdoc b/tests/auto/qdoc/generatedoutput/dontdocument/test.qdoc new file mode 100644 index 000000000..3f6e0be30 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/dontdocument/test.qdoc @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +/*! + \dontdocument (UnseenClass) +*/ + +/*! \page classes.html + \title Classes + \generatelist annotatedclasses +*/ diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml index 39292e2dc..0cfeb1724 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml @@ -2,7 +2,7 @@ <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>Test Class</db:title> -<db:subtitle>(TestQDoc::Test)</db:subtitle> +<db:subtitle>TestQDoc::Test</db:subtitle> <db:productname>TestCPP</db:productname> <db:titleabbrev>TestCPP Reference Documentation</db:titleabbrev> <db:abstract> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml index 7a07adb85..9bb613cfc 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml @@ -2,7 +2,7 @@ <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>TestDerived Class</db:title> -<db:subtitle>(TestQDoc::TestDerived)</db:subtitle> +<db:subtitle>TestQDoc::TestDerived</db:subtitle> <db:productname>TestCPP</db:productname> <db:titleabbrev>TestCPP Reference Documentation</db:titleabbrev> <db:abstract> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/classes.html b/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/classes.html new file mode 100644 index 000000000..f5bae610a --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/classes.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- test.qdoc --> + <title>Classes | TestCPP</title> +</head> +<body> +<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div> +<h1 class="title">Classes</h1> +<span class="subtitle"></span> +<!-- $$$classes.html-description --> +<div class="descr"> <a name="details"></a> +<div class="table"><table class="annotated"> +<tr class="odd topAlign"><td class="tblName"><p><a href="seenclass.html">SeenClass</a></p></td><td class="tblDescr"><p>A public but undocumented class</p></td></tr> +<tr class="even 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="odd 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> +</div> +<!-- @@@classes.html --> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/seenclass.html b/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/seenclass.html new file mode 100644 index 000000000..119841e44 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/seenclass.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- dont.cpp --> + <title>SeenClass Class | TestCPP</title> +</head> +<body> +<li>SeenClass</li> +<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">SeenClass Class</h1> +<!-- $$$SeenClass-brief --> +<p>A public but undocumented class. <a href="#details">More...</a></p> +<!-- @@@SeenClass --> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <SeenClass></span> +</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += testcpp</td></tr></table></div><ul> +</ul> +<a name="details"></a> +<!-- $$$SeenClass-description --> +<div class="descr"> +<h2 id="details">Detailed Description</h2> +</div> +<!-- @@@SeenClass --> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html index 0cb766e42..71c54c2e9 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html @@ -19,7 +19,7 @@ </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">Test Class</h1> -<span class="small-subtitle">(<a href="testqdoc-test.html">TestQDoc::Test</a>)<br/></span> +<span class="small-subtitle">class <a href="testqdoc.html">TestQDoc</a>::Test</span> <!-- $$$Test-brief --> <p>A class in a namespace. <a href="#details">More...</a></p> <!-- @@@Test --> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html new file mode 100644 index 000000000..145fc724a --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html @@ -0,0 +1,108 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- testcpp.cpp --> + <title>Test Class | TestCPP</title> +</head> +<body> +<li>Test</li> +<div class="sidebar"> +<div class="toc"> +<h3><a name="toc">Contents</a></h3> +<ul> +<li class="level1"><a href="#public-types">Public Types</a></li> +<li class="level1"><a href="#public-functions">Public Functions</a></li> +<li class="level1"><a href="#protected-functions">Protected Functions</a></li> +<li class="level1"><a href="#macros">Macros</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">Test Class</h1> +<span class="small-subtitle">class <a href="testqdoc.html">TestQDoc</a>::Test</span> +<!-- $$$Test-brief --> +<p>A class in a namespace. <a href="#details">More...</a></p> +<!-- @@@Test --> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <Test></span> +</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += testcpp</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="testqdoc-testderived.html">TestQDoc::TestDerived</a></p> +</td></tr></table></div><ul> +<li><a href="testqdoc-test-members.html">List of all members, including inherited members</a></li> +<li><a href="testqdoc-test-obsolete.html">Obsolete members</a></li> +</ul> +<a name="public-types"></a> +<h2 id="public-types">Public Types</h2> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> enum class </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#ScopedEnum-enum">ScopedEnum</a></b> { This, That, All }</td></tr> +</table></div> +<a name="public-functions"></a> +<h2 id="public-functions">Public Functions</h2> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b>()</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b>(int <i>v</i>)</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunctionDefaultArg">someFunctionDefaultArg</a></b>(int <i>i</i>, bool <i>b</i> = false)</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#virtualFun">virtualFun</a></b>()</td></tr> +</table></div> +<a name="protected-functions"></a> +<h2 id="protected-functions">Protected Functions</h2> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#overload">overload</a></b>()</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#overload-1">overload</a></b>(bool <i>b</i>)</td></tr> +</table></div> +<a name="macros"></a> +<h2 id="macros">Macros</h2> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#QDOCTEST_MACRO2">QDOCTEST_MACRO2</a></b>(<i>x</i>)</td></tr> +</table></div> +<a name="details"></a> +<!-- $$$Test-description --> +<div class="descr"> +<h2 id="details">Detailed Description</h2> +</div> +<!-- @@@Test --> +<div class="types"> +<h2>Member Type Documentation</h2> +<!-- $$$ScopedEnum$$$This$$$That$$$All$$$OmittedValue --> +<h3 class="fn" id="ScopedEnum-enum"><a name="ScopedEnum-enum"></a>enum class Test::<span class="name">ScopedEnum</span></h3> +<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> +<tr><td class="topAlign"><code>TestQDoc::Test::ScopedEnum::This</code></td><td class="topAlign tblval"><code>0x01</code></td><td class="topAlign">Something</td></tr> +<tr><td class="topAlign"><code>TestQDoc::Test::ScopedEnum::That</code></td><td class="topAlign tblval"><code>0x02</code></td><td class="topAlign">Something else</td></tr> +<tr><td class="topAlign"><code>TestQDoc::Test::ScopedEnum::All</code></td><td class="topAlign tblval"><code>This | That</code></td><td class="topAlign">Everything</td></tr> +</table></div> +<!-- @@@ScopedEnum --> +</div> +<div class="func"> +<h2>Member Function Documentation</h2> +<!-- $$$ --> +<div class="fngroup"> +<h3 class="fn fngroupitem" id="overload"><a name="overload"></a><code>[protected] </code><span class="type">void</span> Test::<span class="name">overload</span>()</h3><h3 class="fn fngroupitem" id="overload-1"><a name="overload-1"></a><code>[protected] </code><span class="type">void</span> Test::<span class="name">overload</span>(<span class="type">bool</span> <i>b</i>)</h3></div> +<p>Overloads that share a documentation comment, optionally taking a parameter <i>b</i>.</p> +<!-- @@@ --> +<!-- $$$inlineFunction[overload1]$$$inlineFunction --> +<h3 class="fn" id="inlineFunction"><a name="inlineFunction"></a><span class="type">void</span> Test::<span class="name">inlineFunction</span>()</h3> +<p>An inline function, documented using the \fn QDoc command.</p> +<!-- @@@inlineFunction --> +<!-- $$$someFunction[overload1]$$$someFunctionint --> +<h3 class="fn" id="someFunction"><a name="someFunction"></a><span class="type">int</span> Test::<span class="name">someFunction</span>(<span class="type">int</span> <i>v</i>)</h3> +<p>Function that takes a parameter <i>v</i>. Also returns the value of <i>v</i>.</p> +<!-- @@@someFunction --> +<!-- $$$someFunctionDefaultArg[overload1]$$$someFunctionDefaultArgintbool --> +<h3 class="fn" id="someFunctionDefaultArg"><a name="someFunctionDefaultArg"></a><span class="type">void</span> Test::<span class="name">someFunctionDefaultArg</span>(<span class="type">int</span> <i>i</i>, <span class="type">bool</span> <i>b</i> = false)</h3> +<p>Function that takes a parameter <i>i</i> and <i>b</i>.</p> +<!-- @@@someFunctionDefaultArg --> +<!-- $$$virtualFun[overload1]$$$virtualFun --> +<h3 class="fn" id="virtualFun"><a name="virtualFun"></a><code>[virtual] </code><span class="type">void</span> Test::<span class="name">virtualFun</span>()</h3> +<p>Function that must be reimplemented.</p> +<!-- @@@virtualFun --> +</div> +<div class="macros"> +<h2>Macro Documentation</h2> +<!-- $$$QDOCTEST_MACRO2[overload1]$$$QDOCTEST_MACRO2 --> +<h3 class="fn" id="QDOCTEST_MACRO2"><a name="QDOCTEST_MACRO2"></a><span class="name">QDOCTEST_MACRO2</span>(<i>x</i>)</h3> +<p>A macro with argument <i>x</i>.</p> +<p>This function was introduced in Test 1.1.</p> +<!-- @@@QDOCTEST_MACRO2 --> +</div> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/template/bar.html b/tests/auto/qdoc/generatedoutput/expected_output/template/bar.html new file mode 100644 index 000000000..552cbe9cd --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/template/bar.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- testtemplate.cpp --> + <title>Bar Class | TestCPP</title> +</head> +<body> +<li>Bar</li> +<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">Bar Class</h1> +<span class="small-subtitle">template <typename T, typename D> class Bar</span> +<!-- $$$Bar-brief --> +<p>Another class template. <a href="#details">More...</a></p> +<!-- @@@Bar --> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <Bar></span> +</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += testcpp</td></tr></table></div><ul> +</ul> +<a name="details"></a> +<!-- $$$Bar-description --> +<div class="descr"> +<h2 id="details">Detailed Description</h2> +</div> +<!-- @@@Bar --> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/template/baz.html b/tests/auto/qdoc/generatedoutput/expected_output/template/baz.html new file mode 100644 index 000000000..4ab135c20 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/template/baz.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- testtemplate.cpp --> + <title>Baz Class | TestCPP</title> +</head> +<body> +<li>Baz</li> +<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">Baz Class</h1> +<span class="small-subtitle">template <template <typename> class X, typename Y> class Baz</span> +<!-- $$$Baz-brief --> +<p>Class template template. <a href="#details">More...</a></p> +<!-- @@@Baz --> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <Baz></span> +</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += testcpp</td></tr></table></div><ul> +</ul> +<a name="details"></a> +<!-- $$$Baz-description --> +<div class="descr"> +<h2 id="details">Detailed Description</h2> +</div> +<!-- @@@Baz --> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/template/foo.html b/tests/auto/qdoc/generatedoutput/expected_output/template/foo.html new file mode 100644 index 000000000..9e92a01b5 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/template/foo.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- testtemplate.cpp --> + <title>Foo Class | TestCPP</title> +</head> +<body> +<li>Foo</li> +<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">Foo Class</h1> +<span class="small-subtitle">template <typename T> class Foo</span> +<!-- $$$Foo-brief --> +<p>Class template. <a href="#details">More...</a></p> +<!-- @@@Foo --> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <Foo></span> +</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += testcpp</td></tr></table></div><ul> +</ul> +<a name="details"></a> +<!-- $$$Foo-description --> +<div class="descr"> +<h2 id="details">Detailed Description</h2> +</div> +<!-- @@@Foo --> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html new file mode 100644 index 000000000..d19d15535 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html @@ -0,0 +1,96 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- testcpp.cpp --> + <title>Test Class | TestCPP</title> +</head> +<body> +<li>Test</li> +<div class="sidebar"> +<div class="toc"> +<h3><a name="toc">Contents</a></h3> +<ul> +<li class="level1"><a href="#public-functions">Public Functions</a></li> +<li class="level1"><a href="#protected-functions">Protected Functions</a></li> +<li class="level1"><a href="#macros">Macros</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">Test Class</h1> +<span class="small-subtitle">class <a href="testqdoc.html">TestQDoc</a>::Test</span> +<!-- $$$Test-brief --> +<p>A class in a namespace. <a href="#details">More...</a></p> +<!-- @@@Test --> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <Test></span> +</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += testcpp</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="testqdoc-testderived.html">TestQDoc::TestDerived</a></p> +</td></tr></table></div><ul> +<li><a href="testqdoc-test-members.html">List of all members, including inherited members</a></li> +<li><a href="testqdoc-test-obsolete.html">Obsolete members</a></li> +</ul> +<a name="public-functions"></a> +<h2 id="public-functions">Public Functions</h2> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b>()</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b>(int <i>v</i>)</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunctionDefaultArg">someFunctionDefaultArg</a></b>(int <i>i</i>, bool <i>b</i> = false)</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#virtualFun">virtualFun</a></b>()</td></tr> +</table></div> +<a name="protected-functions"></a> +<h2 id="protected-functions">Protected Functions</h2> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#funcTemplate">funcTemplate</a></b>(T1 <i>a</i>, T2 <i>b</i>)</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#overload">overload</a></b>()</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#overload-1">overload</a></b>(bool <i>b</i>)</td></tr> +</table></div> +<a name="macros"></a> +<h2 id="macros">Macros</h2> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#QDOCTEST_MACRO2">QDOCTEST_MACRO2</a></b>(<i>x</i>)</td></tr> +</table></div> +<a name="details"></a> +<!-- $$$Test-description --> +<div class="descr"> +<h2 id="details">Detailed Description</h2> +</div> +<!-- @@@Test --> +<div class="func"> +<h2>Member Function Documentation</h2> +<!-- $$$ --> +<div class="fngroup"> +<h3 class="fn fngroupitem" id="overload"><a name="overload"></a><code>[protected] </code><span class="type">void</span> Test::<span class="name">overload</span>()</h3><h3 class="fn fngroupitem" id="overload-1"><a name="overload-1"></a><code>[protected] </code><span class="type">void</span> Test::<span class="name">overload</span>(<span class="type">bool</span> <i>b</i>)</h3></div> +<p>Overloads that share a documentation comment, optionally taking a parameter <i>b</i>.</p> +<!-- @@@ --> +<!-- $$$funcTemplate[overload1]$$$funcTemplateT1T2 --> +<h3 class="fn" id="funcTemplate"><a name="funcTemplate"></a><code>[protected] </code>template <typename T1, typename T2> <span class="type">void</span> Test::<span class="name">funcTemplate</span>(<span class="type">T1</span> <i>a</i>, <span class="type">T2</span> <i>b</i>)</h3> +<p>Function template with two parameters, <i>a</i> and <i>b</i>.</p> +<!-- @@@funcTemplate --> +<!-- $$$inlineFunction[overload1]$$$inlineFunction --> +<h3 class="fn" id="inlineFunction"><a name="inlineFunction"></a><span class="type">void</span> Test::<span class="name">inlineFunction</span>()</h3> +<p>An inline function, documented using the \fn QDoc command.</p> +<!-- @@@inlineFunction --> +<!-- $$$someFunction[overload1]$$$someFunctionint --> +<h3 class="fn" id="someFunction"><a name="someFunction"></a><span class="type">int</span> Test::<span class="name">someFunction</span>(<span class="type">int</span> <i>v</i>)</h3> +<p>Function that takes a parameter <i>v</i>. Also returns the value of <i>v</i>.</p> +<!-- @@@someFunction --> +<!-- $$$someFunctionDefaultArg[overload1]$$$someFunctionDefaultArgintbool --> +<h3 class="fn" id="someFunctionDefaultArg"><a name="someFunctionDefaultArg"></a><span class="type">void</span> Test::<span class="name">someFunctionDefaultArg</span>(<span class="type">int</span> <i>i</i>, <span class="type">bool</span> <i>b</i> = false)</h3> +<p>Function that takes a parameter <i>i</i> and <i>b</i>.</p> +<!-- @@@someFunctionDefaultArg --> +<!-- $$$virtualFun[overload1]$$$virtualFun --> +<h3 class="fn" id="virtualFun"><a name="virtualFun"></a><code>[virtual] </code><span class="type">void</span> Test::<span class="name">virtualFun</span>()</h3> +<p>Function that must be reimplemented.</p> +<!-- @@@virtualFun --> +</div> +<div class="macros"> +<h2>Macro Documentation</h2> +<!-- $$$QDOCTEST_MACRO2[overload1]$$$QDOCTEST_MACRO2 --> +<h3 class="fn" id="QDOCTEST_MACRO2"><a name="QDOCTEST_MACRO2"></a><span class="name">QDOCTEST_MACRO2</span>(<i>x</i>)</h3> +<p>A macro with argument <i>x</i>.</p> +<p>This function was introduced in Test 1.1.</p> +<!-- @@@QDOCTEST_MACRO2 --> +</div> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html index f373f725a..f3c8d55d0 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html @@ -19,7 +19,7 @@ </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">Test Class</h1> -<span class="small-subtitle">(<a href="testqdoc-test.html">TestQDoc::Test</a>)<br/></span> +<span class="small-subtitle">class <a href="testqdoc.html">TestQDoc</a>::Test</span> <!-- $$$Test-brief --> <p>A class in a namespace. <a href="#details">More...</a></p> <!-- @@@Test --> diff --git a/tests/auto/qdoc/generatedoutput/scopedenum.qdoc b/tests/auto/qdoc/generatedoutput/scopedenum.qdoc new file mode 100644 index 000000000..4262c1ce6 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/scopedenum.qdoc @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \enum TestQDoc::Test::ScopedEnum + + \value This Something + \value That Something else + \value All Everything + \omitvalue OmittedValue +*/ diff --git a/tests/auto/qdoc/generatedoutput/scopedenum.qdocconf b/tests/auto/qdoc/generatedoutput/scopedenum.qdocconf new file mode 100644 index 000000000..f967e266d --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/scopedenum.qdocconf @@ -0,0 +1,7 @@ +include(testcpp.qdocconf) +defines += test_scopedenum + +sources += scopedenum.qdoc + +HTML.nosubdirs = true +HTML.outputsubdir = scopedenum diff --git a/tests/auto/qdoc/generatedoutput/testcpp.cpp b/tests/auto/qdoc/generatedoutput/testcpp.cpp index 3073148c2..b703a844b 100644 --- a/tests/auto/qdoc/generatedoutput/testcpp.cpp +++ b/tests/auto/qdoc/generatedoutput/testcpp.cpp @@ -162,4 +162,13 @@ void TestDerived::virtualFun() a parameter \a b. */ +/*! +\if defined(test_template) + \fn template <typename T1, typename T2> void TestQDoc::Test::funcTemplate(T1 a, T2 b) + \brief Function template with two parameters, \a a and \a b. +\else + //! nothing +\endif +*/ + } // namespace TestQDoc diff --git a/tests/auto/qdoc/generatedoutput/testcpp.h b/tests/auto/qdoc/generatedoutput/testcpp.h index c34ada99b..4ae33a404 100644 --- a/tests/auto/qdoc/generatedoutput/testcpp.h +++ b/tests/auto/qdoc/generatedoutput/testcpp.h @@ -33,6 +33,14 @@ namespace TestQDoc { class Test { public: +#ifdef test_scopedenum + enum class ScopedEnum : unsigned char { + This = 0x01, + That = 0x02, + All = This | That, + OmittedValue = 99 + }; +#endif int someFunction(int v); void someFunctionDefaultArg(int i, bool b); void obsoleteMember(); @@ -44,6 +52,11 @@ public: protected: void overload() {} void overload(bool b) { if (!b) return; } +#ifdef test_template + template <typename T1, typename T2> void funcTemplate(T1 a, T2 b) { + a = b; + } +#endif }; class TestDerived : public Test { diff --git a/tests/auto/qdoc/generatedoutput/testtemplate.cpp b/tests/auto/qdoc/generatedoutput/testtemplate.cpp new file mode 100644 index 000000000..e9755769f --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/testtemplate.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#include "testtemplate.h" + +/*! + \class Foo + \inmodule TestCPP + \brief Class template. +*/ + +/*! + \class Bar + \inmodule TestCPP + \brief Another class template. +*/ + +/*! + \class Baz + \inmodule TestCPP + \brief Class template template. +*/ diff --git a/tests/auto/qdoc/generatedoutput/testtemplate.h b/tests/auto/qdoc/generatedoutput/testtemplate.h new file mode 100644 index 000000000..d60ab0da4 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/testtemplate.h @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#pragma once + +template <typename T> +class Foo { +public: + Foo() {} +private: + T t; +}; + +template <typename T, typename D> +class Bar { +public: + Bar() {} +private: + T t; + D d; +}; + +template<template<typename> class X, typename Y> +struct Baz +{ + X<Y> z; + Baz() : z() {} +}; diff --git a/tests/auto/qdoc/generatedoutput/testtemplate.qdocconf b/tests/auto/qdoc/generatedoutput/testtemplate.qdocconf new file mode 100644 index 000000000..437319683 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/testtemplate.qdocconf @@ -0,0 +1,8 @@ +include(testcpp.qdocconf) +defines += test_template + +headers += testtemplate.h +sources += testtemplate.cpp + +HTML.nosubdirs = true +HTML.outputsubdir = template diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index 01608e95f..7d87470f6 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -57,6 +57,9 @@ private slots: // Output format independent tests void examplesManifestXml(); void ignoresinceVariable(); + void templateParameters(); + void scopedEnum(); + void dontDocument(); private: QScopedPointer<QTemporaryDir> m_outputDir; @@ -275,6 +278,26 @@ void tst_generatedOutput::ignoresinceVariable() "ignoresince/testqdoc-test.html"); } +void tst_generatedOutput::templateParameters() +{ + testAndCompare("testtemplate.qdocconf", "template/testqdoc-test.html " + "template/foo.html " + "template/bar.html " + "template/baz.html"); +} + +void tst_generatedOutput::scopedEnum() +{ + testAndCompare("scopedenum.qdocconf", "scopedenum/testqdoc-test.html"); +} + +void tst_generatedOutput::dontDocument() +{ + testAndCompare("dontdocument/dontdocument.qdocconf", "dontdocument/classes.html " + "dontdocument/seenclass.html"); +} + + QTEST_APPLESS_MAIN(tst_generatedOutput) #include "tst_generatedoutput.moc" |