diff options
Diffstat (limited to 'tests/auto/qdoc')
8 files changed, 254 insertions, 1 deletions
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/headerfile-docbook/headers.xml b/tests/auto/qdoc/generatedoutput/expected_output/headerfile-docbook/headers.xml new file mode 100644 index 000000000..052108b2a --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/headerfile-docbook/headers.xml @@ -0,0 +1,19 @@ +<?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>Headers</db:title> +<db:productname>HeaderFile</db:productname> +<db:titleabbrev>HeaderFile Reference Documentation</db:titleabbrev> +<db:abstract> +<db:para>HeaderFile Reference Documentation.</db:para></db:abstract> +</db:info> +<db:anchor xml:id="details"/> +<db:variablelist role="members"> +<db:varlistentry> +<db:term><db:link xlink:href="testheader.xml" xlink:role=""><TestHeader></db:link></db:term> +<db:listitem> +<db:para>A header file.</db:para> +</db:listitem> +</db:varlistentry> +</db:variablelist> +</db:article> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/headerfile-docbook/testheader.xml b/tests/auto/qdoc/generatedoutput/expected_output/headerfile-docbook/testheader.xml new file mode 100644 index 000000000..f3461fb1a --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/headerfile-docbook/testheader.xml @@ -0,0 +1,22 @@ +<?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>HeaderFile</db:productname> +<db:titleabbrev>HeaderFile Reference Documentation</db:titleabbrev> +<db:abstract> +<db:para>A header file.</db:para> +</db:abstract> +</db:info> +<db:variablelist> +<db:varlistentry> +<db:term>Header</db:term> +<db:listitem> +<db:para>TestHeader</db:para> +</db:listitem> +</db:varlistentry> +</db:variablelist> +<db:section xml:id="details"> +<db:title>Detailed Description</db:title> +</db:section> +</db:article> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/headerfile/headers.html b/tests/auto/qdoc/generatedoutput/expected_output/headerfile/headers.html new file mode 100644 index 000000000..65b88eca4 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/headerfile/headers.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- testheader.cpp --> + <title>Headers | HeaderFile</title> +</head> +<body> +<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div> +<h1 class="title">Headers</h1> +<span class="subtitle"></span> +<!-- $$$headers-description --> +<div class="descr"> <a name="details"></a> +</div> +<!-- @@@headers --> +<div class="table"><table class="annotated"> +<tr class="odd topAlign"><td class="tblName"><p><a href="testheader.html"><TestHeader></a></p></td><td class="tblDescr"><p>A header file</p></td></tr> +</table></div> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/headerfile/testheader.html b/tests/auto/qdoc/generatedoutput/expected_output/headerfile/testheader.html new file mode 100644 index 000000000..f67de8a3f --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/headerfile/testheader.html @@ -0,0 +1,72 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- testheader.cpp --> + <title><TestHeader> - Test Header | HeaderFile</title> +</head> +<body> +<li><a href="headers.html">Headers</a></li> +<li><TestHeader> - Test Header</li> +<div class="sidebar"> +<div class="toc"> +<h3><a name="toc">Contents</a></h3> +<ul> +</ul> +</div> +<div class="sidebar-content" id="sidebar-content"></div></div> +<h1 class="title"><TestHeader> - Test Header</h1> +<!-- $$$<TestHeader>-brief --> +<p>A header file. <a href="#details">More...</a></p> +<!-- @@@<TestHeader> --> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <TestHeader></span> +</td></tr></table></div><ul> +</ul> +<a name="types"></a> +<h2 id="types">Types</h2> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="testheader.html#Globals-enum">Globals</a></b> { Glo, Bal }</td></tr> +</table></div> +<a name="variables"></a> +<h2 id="variables">Variables</h2> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> const int </td><td class="memItemRight bottomAlign"><b><a href="testheader.html#globalVar-var">globalVar</a></b></td></tr> +</table></div> +<a name="functions"></a> +<h2 id="functions">Functions</h2> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testheader.html#globalFunc">globalFunc</a></b>()</td></tr> +</table></div> +<a name="details"></a> +<!-- $$$<TestHeader>-description --> +<div class="descr"> +<h2 id="details">Detailed Description</h2> +</div> +<!-- @@@<TestHeader> --> +<div class="types"> +<h2>Type Documentation</h2> +<!-- $$$Globals$$$Glo$$$Bal --> +<h3 class="fn" id="Globals-enum"><a name="Globals-enum"></a>enum <span class="name">Globals</span></h3> +<div class="table"><table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr> +<tr><td class="topAlign"><code>Glo</code></td><td class="topAlign tblval"><code>0</code></td></tr> +<tr><td class="topAlign"><code>Bal</code></td><td class="topAlign tblval"><code>1</code></td></tr> +</table></div> +<!-- @@@Globals --> +</div> +<div class="vars"> +<h2>Variable Documentation</h2> +<!-- $$$globalVar --> +<h3 class="fn" id="globalVar-var"><a name="globalVar-var"></a>const <span class="type">int</span> <span class="name">globalVar</span></h3> +<p>Global variable.</p> +<!-- @@@globalVar --> +</div> +<div class="func"> +<h2>Function Documentation</h2> +<!-- $$$globalFunc[overload1]$$$globalFunc --> +<h3 class="fn" id="globalFunc"><a name="globalFunc"></a><span class="type">void</span> <span class="name">globalFunc</span>()</h3> +<p>Global function.</p> +<!-- @@@globalFunc --> +</div> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/headerfile.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/headerfile.qdocconf new file mode 100644 index 000000000..b270556d1 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/testdata/configs/headerfile.qdocconf @@ -0,0 +1,17 @@ +project = HeaderFile +moduleheader = testheader.h + +{includepaths,sourcedirs,headerdirs} += ../headerfile + +sources.fileextensions = "*.cpp *.qdoc" +headers.fileextensions = "*.h" + +outputformats = HTML DocBook +HTML.nosubdirs = true +HTML.outputsubdir = headerfile +DocBook.nosubdirs = true +DocBook.outputsubdir = headerfile-docbook + +# zero warning tolerance +warninglimit = 0 +warninglimit.enabled = true diff --git a/tests/auto/qdoc/generatedoutput/testdata/headerfile/testheader.cpp b/tests/auto/qdoc/generatedoutput/testdata/headerfile/testheader.cpp new file mode 100644 index 000000000..3a85b169c --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/testdata/headerfile/testheader.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** 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 "testheader.h" + +/*! + \headerfile <TestHeader> + \title Test Header + \inmodule TestCPP + \brief A header file. + \ingroup headers +*/ + +/*! + \group headers + \title Headers +*/ + +/*! + \fn void globalFunc() + \brief Global function. + \relates <TestHeader> +*/ + +/*! + \variable globalVar + \brief Global variable. + \relates <TestHeader> +*/ + +/*! + \enum Globals + \relates <TestHeader> + \value Glo + \value Bal +*/ diff --git a/tests/auto/qdoc/generatedoutput/testdata/headerfile/testheader.h b/tests/auto/qdoc/generatedoutput/testdata/headerfile/testheader.h new file mode 100644 index 000000000..94c625157 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/testdata/headerfile/testheader.h @@ -0,0 +1,33 @@ +/**************************************************************************** +** +** 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 + +void globalFunc() {}; +enum Globals { Glo, Bal }; +const int globalVar; diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index 40fcdfcac..42cb2570c 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -69,6 +69,7 @@ private slots: void generatePhase(); void noAutoList(); void nestedMacro(); + void headerFile(); private: QScopedPointer<QTemporaryDir> m_outputDir; @@ -393,13 +394,21 @@ void tst_generatedOutput::noAutoList() "noautolist-docbook/qdoc-test-qmlmodule.xml"); } - void tst_generatedOutput::nestedMacro() { testAndCompare("testdata/configs/nestedmacro.qdocconf", "nestedmacro/testcpp-module.html"); } +void tst_generatedOutput::headerFile() +{ + testAndCompare("testdata/configs/headerfile.qdocconf", + "headerfile/testheader.html " + "headerfile/headers.html " + "headerfile-docbook/testheader.xml " + "headerfile-docbook/headers.xml"); +} + QTEST_APPLESS_MAIN(tst_generatedOutput) #include "tst_generatedoutput.moc" |