diff options
author | Levon Sargsyan <levon.sargsyan@qt.io> | 2019-12-02 17:26:49 +0100 |
---|---|---|
committer | Levon Sargsyan <levon.sargsyan@qt.io> | 2019-12-04 16:01:59 +0100 |
commit | 619a3d00fee89223d8ce19435dfde9140daf00b4 (patch) | |
tree | 79e126d92abdcfecef4200145b519a17dee5c499 | |
parent | 61617f7a13a2692cdc5415cd62acdedb2fd7a76d (diff) | |
download | qttools-619a3d00fee89223d8ce19435dfde9140daf00b4.tar.gz |
Add regression test for class name sorting
This patch adds a regression test to cover QTBUG-80259
by adding new test data to the existing end-2-end qdoc test suite.
The test is covering class name sorting functionality
during documentation generation.
Change-Id: I6421981596f4d72e8b0ce8351e85a8e5b3856b45
Fixes: QTBUG-80456
Reviewed-by: Levon Sargsyan <levon.sargsyan@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
12 files changed, 219 insertions, 0 deletions
diff --git a/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/TestModule.h b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/TestModule.h new file mode 100644 index 000000000..686cbe948 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/TestModule.h @@ -0,0 +1,3 @@ +#include "testmodule/aaa.h" +#include "testmodule/bbb.h" +#include "testmodule/ccc.h" diff --git a/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/aaa.h b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/aaa.h new file mode 100644 index 000000000..dea5c1841 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/aaa.h @@ -0,0 +1,4 @@ +#pragma once +class Third +{ +}; diff --git a/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/bbb.h b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/bbb.h new file mode 100644 index 000000000..0dc6e52c6 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/bbb.h @@ -0,0 +1,5 @@ +#pragma once +class First +{ + class Nested {}; +}; diff --git a/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/ccc.h b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/ccc.h new file mode 100644 index 000000000..d3a1557e1 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/ccc.h @@ -0,0 +1,4 @@ +#pragma once +class Second +{ +}; diff --git a/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp b/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp new file mode 100644 index 000000000..a8991e18f --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2019 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$ +** +****************************************************************************/ +/*! +\class First +\inmodule TestModule + +This is a first class +*/ + +/*! +\class First::Nested +\inmodule TestModule + +This is a nested class +*/ + +/*! +\class Second +\inmodule TestModule + +This is a second class +*/ + +/*! +\class Third +\inmodule TestModule + +This is a third class +*/ diff --git a/tests/auto/qdoc/generatedoutput/bug80259/src/qdoc/index.qdoc b/tests/auto/qdoc/generatedoutput/bug80259/src/qdoc/index.qdoc new file mode 100644 index 000000000..35ef7e087 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/bug80259/src/qdoc/index.qdoc @@ -0,0 +1,7 @@ +/*! + \page index.html + \title doc index + + \generatelist {classesbymodule TestModule} + +*/ diff --git a/tests/auto/qdoc/generatedoutput/bug80259/testmodule.qdocconf b/tests/auto/qdoc/generatedoutput/bug80259/testmodule.qdocconf new file mode 100644 index 000000000..c02fb6fcf --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/bug80259/testmodule.qdocconf @@ -0,0 +1,13 @@ +project = TestModule + +moduleheader = TestModule.h + +headerdirs = inc +sourcedirs = src +includepaths += ./bug80259/inc/testmodule + +sources.fileextensions = "*.cpp *.qdoc" +headers.fileextensions = "*.h" + +outputdir = doc +outputformats = HTML diff --git a/tests/auto/qdoc/generatedoutput/expected_output/first.html b/tests/auto/qdoc/generatedoutput/expected_output/first.html new file mode 100644 index 000000000..0a7f52a13 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/first.html @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<!-- main.cpp --> + <title>First Class | TestModule</title> +</head> +<body> +<li>First</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">First Class</h1> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <First></span> +</td></tr></table></div><ul> +</ul> +<a name="details"></a> +<!-- $$$First-description --> +<div class="descr"> +<h2 id="details">Detailed Description</h2> +<p>This is a first class</p> +</div> +<!-- @@@First --> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/index.html b/tests/auto/qdoc/generatedoutput/expected_output/index.html new file mode 100644 index 000000000..8600e0867 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/index.html @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<!-- index.qdoc --> + <title>doc index | TestModule</title> +</head> +<body> +<h1 class="title">doc index</h1> +<span class="subtitle"></span> +<!-- $$$index.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="first.html">First</a></p></td></tr> +<tr class="even topAlign"><td class="tblName"><p><a href="">First::Nested</a></p></td></tr> +<tr class="odd topAlign"><td class="tblName"><p><a href="second.html">Second</a></p></td></tr> +<tr class="even topAlign"><td class="tblName"><p><a href="third.html">Third</a></p></td></tr> +</table></div> +</div> +<!-- @@@index.html --> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/second.html b/tests/auto/qdoc/generatedoutput/expected_output/second.html new file mode 100644 index 000000000..c3d76d0f8 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/second.html @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<!-- main.cpp --> + <title>Second Class | TestModule</title> +</head> +<body> +<li>Second</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">Second Class</h1> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <Second></span> +</td></tr></table></div><ul> +</ul> +<a name="details"></a> +<!-- $$$Second-description --> +<div class="descr"> +<h2 id="details">Detailed Description</h2> +<p>This is a second class</p> +</div> +<!-- @@@Second --> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/third.html b/tests/auto/qdoc/generatedoutput/expected_output/third.html new file mode 100644 index 000000000..93dc5a1c1 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/third.html @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<!-- main.cpp --> + <title>Third Class | TestModule</title> +</head> +<body> +<li>Third</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">Third Class</h1> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <Third></span> +</td></tr></table></div><ul> +</ul> +<a name="details"></a> +<!-- $$$Third-description --> +<div class="descr"> +<h2 id="details">Detailed Description</h2> +<p>This is a third class</p> +</div> +<!-- @@@Third --> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index 09709ac6c..6c8211125 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -40,6 +40,7 @@ private slots: void htmlFromQDocFile(); void htmlFromCpp(); void htmlFromQml(); + void htmlFromCppBug80259(); private: QScopedPointer<QTemporaryDir> m_outputDir; @@ -157,6 +158,15 @@ void tst_generatedOutput::htmlFromQml() "uicomponents-qmlmodule.html"); } +void tst_generatedOutput::htmlFromCppBug80259() +{ + testAndCompare("bug80259/testmodule.qdocconf", + "first.html " + "second.html " + "third.html " + "index.html"); +} + QTEST_APPLESS_MAIN(tst_generatedOutput) #include "tst_generatedoutput.moc" |