summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2024-03-21 15:07:54 +0100
committerPaul Wicking <paul.wicking@qt.io>2024-04-03 07:33:42 +0100
commitddab61c9ea8a8ef0678df9cff58ef2595cc4017a (patch)
tree11a2647871ca26ab2db29320008740c7edab315d
parentb30834e1995dae431a2de5bd9075c665bc7b3dd0 (diff)
QDoc: Move nestedmacro test
QDoc now has better test infrastructure. Move a trivial test project from `tst_generatedOutput` into `tst_validateQdocOutputFiles` and adjust expected output accordingly. Task-number: QTBUG-119500 Pick-to: 6.7 Change-Id: I122d2aa901d7b8640df3506b89fa559b2742064d Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r--src/qdoc/qdoc/tests/generatedoutput/expected_output/docbook-nestedmacro/testcpp-module.xml85
-rw-r--r--src/qdoc/qdoc/tests/generatedoutput/expected_output/nestedmacro/testcpp-module.html59
-rw-r--r--src/qdoc/qdoc/tests/generatedoutput/testdata/configs/nestedmacro.qdocconf39
-rw-r--r--src/qdoc/qdoc/tests/generatedoutput/tst_generatedoutput.cpp8
-rw-r--r--src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/comprehensiveproject.qdocconf6
-rw-r--r--src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/docbook/testcpp-module.xml2
-rw-r--r--src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/html/testcpp-module.html2
7 files changed, 10 insertions, 191 deletions
diff --git a/src/qdoc/qdoc/tests/generatedoutput/expected_output/docbook-nestedmacro/testcpp-module.xml b/src/qdoc/qdoc/tests/generatedoutput/expected_output/docbook-nestedmacro/testcpp-module.xml
deleted file mode 100644
index 08e674292..000000000
--- a/src/qdoc/qdoc/tests/generatedoutput/expected_output/docbook-nestedmacro/testcpp-module.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?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>TestCPP</db:productname>
-<db:titleabbrev>TestCPP Reference Documentation</db:titleabbrev>
-<db:abstract>
-<db:para>A test module page.</db:para>
-<db:para>This module was introduced in Qt 2.0.</db:para>
-</db:abstract>
-</db:info>
-<db:para>A test module page.</db:para>
-<db:para>This module was introduced in Qt 2.0.</db:para>
-<db:section xml:id="namespaces">
-<db:title>Namespaces</db:title>
-<db:variablelist role="namespaces">
-<db:varlistentry>
-<db:term><db:link xlink:href="crossmoduleref.xml" xlink:role="namespace">CrossModuleRef</db:link></db:term>
-<db:listitem>
-<db:para>Namespace that has documented functions in multiple modules.</db:para>
-</db:listitem>
-</db:varlistentry>
-<db:varlistentry>
-<db:term><db:link xlink:href="testqdoc.xml" xlink:role="namespace">TestQDoc</db:link></db:term>
-<db:listitem>
-<db:para>A namespace.</db:para>
-</db:listitem>
-</db:varlistentry>
-</db:variablelist>
-</db:section>
-<db:section xml:id="classes">
-<db:title>Classes</db:title>
-<db:variablelist role="classes">
-<db:varlistentry>
-<db:term><db:link xlink:href="testqdoc-test.xml" xlink:role="class">TestQDoc::Test</db:link></db:term>
-<db:listitem>
-<db:para>A class in a namespace.</db:para>
-</db:listitem>
-</db:varlistentry>
-<db:varlistentry>
-<db:term><db:link xlink:href="testqdoc-testderived.xml" xlink:role="class">TestQDoc::TestDerived</db:link></db:term>
-<db:listitem>
-<db:para>A class in a namespace, derived from Test.</db:para>
-</db:listitem>
-</db:varlistentry>
-</db:variablelist>
-</db:section>
-<db:section xml:id="details">
-<db:title>Detailed Description</db:title>
-<db:note>
-<db:para>This is just a test. /* Look, Ma! {I'm made of arguments!} */</db:para>
-</db:note>
-<db:para>This module was introduced in version 5.15.</db:para>
-<db:para>1.0</db:para>
-<db:section xml:id="linking-to-function-like-things">
-<db:title>Linking to function-like things</db:title>
-<db:itemizedlist>
-<db:listitem>
-<db:para><db:link xlink:href="testqdoc-test.xml#someFunctionDefaultArg">someFunctionDefaultArg</db:link>()</db:para>
-</db:listitem>
-<db:listitem>
-<db:para><db:link xlink:href="testqdoc-test.xml#QDOCTEST_MACRO2">QDOCTEST_MACRO2</db:link>()</db:para>
-</db:listitem>
-<db:listitem>
-<db:para><db:link xlink:href="testqdoc-test.xml#QDOCTEST_MACRO2">QDOCTEST_MACRO2</db:link>(int &amp;x)</db:para>
-</db:listitem>
-<db:listitem>
-<db:para><db:link xlink:href="testcpp-module.xml#section">section()</db:link></db:para>
-</db:listitem>
-<db:listitem>
-<db:para><db:link xlink:href="testcpp-module.xml#section">section() is a section title</db:link></db:para>
-</db:listitem>
-<db:listitem>
-<db:para><db:link xlink:href="testqdoc-test.xml#Test">open( parenthesis</db:link></db:para>
-</db:listitem>
-<db:listitem>
-<db:para><db:link xlink:href="https://en.cppreference.com/w/cpp/utility/move">C++11 added std::move(T&amp;&amp; t)</db:link></db:para>
-</db:listitem>
-</db:itemizedlist>
-<db:section xml:id="section">
-<db:title>section()</db:title>
-</db:section>
-</db:section>
-</db:section>
-</db:article>
diff --git a/src/qdoc/qdoc/tests/generatedoutput/expected_output/nestedmacro/testcpp-module.html b/src/qdoc/qdoc/tests/generatedoutput/expected_output/nestedmacro/testcpp-module.html
deleted file mode 100644
index e2fb2598e..000000000
--- a/src/qdoc/qdoc/tests/generatedoutput/expected_output/nestedmacro/testcpp-module.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
-<!-- testcpp.cpp -->
- <meta name="description" content="A test module page.">
- <title>QDoc Test C++ Classes | TestCPP</title>
-</head>
-<body>
-<div class="sidebar">
-<div class="toc">
-<h3 id="toc">Contents</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>
-<li class="level2"><a href="#linking-to-function-like-things">Linking to function-like things</a></li>
-<li class="level3"><a href="#section">section()</a></li>
-</ul>
-</div>
-<div class="sidebar-content" id="sidebar-content"></div></div>
-<h1 class="title" translate="no">QDoc Test C++ Classes</h1>
-<!-- $$$TestCPP-brief -->
-<p>A test module page. <a href="#details">More...</a></p>
-<!-- @@@TestCPP -->
-<p>This module was introduced in Qt 2.0.</p>
-<h2 id="namespaces">Namespaces</h2>
-<div class="table"><table class="annotated">
-<tr class="odd topAlign"><td class="tblName" translate="no"><p><a href="crossmoduleref.html">CrossModuleRef</a></p></td><td class="tblDescr"><p>Namespace that has documented functions in multiple modules</p></td></tr>
-<tr class="even topAlign"><td class="tblName" translate="no"><p><a href="testqdoc.html">TestQDoc</a></p></td><td class="tblDescr"><p>A namespace</p></td></tr>
-</table></div>
-<h2 id="classes">Classes</h2>
-<div class="table"><table class="annotated">
-<tr class="odd topAlign"><td class="tblName" translate="no"><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" translate="no"><p><a href="testqdoc-testderived.html">TestQDoc::TestDerived</a></p></td><td class="tblDescr"><p>A class in a namespace, derived from Test</p></td></tr>
-</table></div>
-<!-- $$$TestCPP-description -->
-<div class="descr">
-<h2 id="details">Detailed Description</h2>
-<div class="admonition note">
-<p><b>Note: </b>This is just a test. /* Look, Ma! {I'm made of arguments!} */</p>
-</div>
-<p><b>This module was introduced in version 5.15.</b></p>
-<p>1.0</p>
-<h3 id="linking-to-function-like-things">Linking to function-like things</h3>
-<ul>
-<li><a href="testqdoc-test.html#someFunctionDefaultArg" translate="no">someFunctionDefaultArg</a>()</li>
-<li><a href="testqdoc-test.html#QDOCTEST_MACRO2" translate="no">QDOCTEST_MACRO2</a>()</li>
-<li><a href="testqdoc-test.html#QDOCTEST_MACRO2" translate="no">QDOCTEST_MACRO2</a>(int &amp;x)</li>
-<li><a href="testcpp-module.html#section" translate="no">section()</a></li>
-<li><a href="testcpp-module.html#section" translate="no">section() is a section title</a></li>
-<li><a href="testqdoc-test.html#Test" translate="no">open( parenthesis</a></li>
-<li><a href="https://en.cppreference.com/w/cpp/utility/move" translate="no">C++11 added std::move(T&amp;&amp; t)</a></li>
-</ul>
-<h4 id="section">section()</h4>
-</div>
-<!-- @@@TestCPP -->
-</body>
-</html>
diff --git a/src/qdoc/qdoc/tests/generatedoutput/testdata/configs/nestedmacro.qdocconf b/src/qdoc/qdoc/tests/generatedoutput/testdata/configs/nestedmacro.qdocconf
deleted file mode 100644
index bba39dd67..000000000
--- a/src/qdoc/qdoc/tests/generatedoutput/testdata/configs/nestedmacro.qdocconf
+++ /dev/null
@@ -1,39 +0,0 @@
-sources.fileextensions = "*.qml *.cpp *.qdoc"
-headers.fileextensions = "*.h"
-
-# images
-imagedirs = ../images
-
-# zero warning policy
-warninglimit = 0
-warninglimit.enabled = true
-
-# don't write host system-specific paths to index files
-locationinfo = false
-
-project = TestCPP
-includepaths += -I../testcpp
-
-headers = ../testcpp/testcpp.h
-sources = ../testcpp/testcpp.cpp \
- ../testcpp/classlists.qdoc
-exampledirs = ../testcpp/snippets
-
-macro.CMDFN = \\\\fn
-macro.nothing = \\dontdocument ()
-macro.testnoautolist = \\if defined(test_noautolist)\n\\noautolist\n\\endif
-
-navigation.cppclassespage = "QDoc Test C++ Classes"
-
-defines += test_nestedmacro
-
-macro.ver = "\1"
-macro.ver.match = "^(\\d+\\.\\d+)"
-macro.versionnote.HTML = "<p><b>This \1 was introduced in version \2.</b></p>\n"
-macro.versionnote.DocBook = "<db:para>This \1 was introduced in version \2.</db:para>\n"
-
-outputformats = HTML DocBook
-
-{HTML.nosubdirs,DocBook.nosubdirs} = true
-HTML.outputsubdir = nestedmacro
-DocBook.outputsubdir = docbook-nestedmacro
diff --git a/src/qdoc/qdoc/tests/generatedoutput/tst_generatedoutput.cpp b/src/qdoc/qdoc/tests/generatedoutput/tst_generatedoutput.cpp
index 64218523d..7f95cc989 100644
--- a/src/qdoc/qdoc/tests/generatedoutput/tst_generatedoutput.cpp
+++ b/src/qdoc/qdoc/tests/generatedoutput/tst_generatedoutput.cpp
@@ -28,7 +28,6 @@ private slots:
void preparePhase();
void generatePhase();
void noAutoList();
- void nestedMacro();
void properties();
private:
@@ -271,13 +270,6 @@ void tst_generatedOutput::noAutoList()
"noautolist-docbook/qdoc-test-qmlmodule.xml");
}
-void tst_generatedOutput::nestedMacro()
-{
- testAndCompare("testdata/configs/nestedmacro.qdocconf",
- "nestedmacro/testcpp-module.html "
- "docbook-nestedmacro/testcpp-module.xml");
-}
-
void tst_generatedOutput::properties()
{
if (m_extraParams.isEmpty() && !m_regen) {
diff --git a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/comprehensiveproject.qdocconf b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/comprehensiveproject.qdocconf
index 4315e216d..b65e4eb5f 100644
--- a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/comprehensiveproject.qdocconf
+++ b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/comprehensiveproject.qdocconf
@@ -38,6 +38,12 @@ macro.testnoautolist = \\if defined(test_noautolist)\n\\noautolist\n\\endif
navigation.cppclassespage = "QDoc Test C++ Classes"
defines += test_ignoresince
+defines += test_nestedmacro
+
+macro.ver = "\1"
+macro.ver.match = "^(\\d+\\.\\d+)"
+macro.versionnote.HTML = "<p><b>This \1 was introduced in version \2.</b></p>\n"
+macro.versionnote.DocBook = "<db:para>This \1 was introduced in version \2.</db:para>\n"
moduleheader = TestCPP
diff --git a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/docbook/testcpp-module.xml b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/docbook/testcpp-module.xml
index 1ef7bd780..d8e4647ac 100644
--- a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/docbook/testcpp-module.xml
+++ b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/docbook/testcpp-module.xml
@@ -56,6 +56,8 @@
<db:note>
<db:para>This is just a test. /* Look, Ma! {I'm made of arguments!} */</db:para>
</db:note>
+<db:para>This module was introduced in version 5.15.</db:para>
+<db:para>1.0</db:para>
<db:section xml:id="linking-to-function-like-things">
<db:title>Linking to function-like things</db:title>
<db:itemizedlist>
diff --git a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/html/testcpp-module.html b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/html/testcpp-module.html
index 1ba884a0f..52cebe971 100644
--- a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/html/testcpp-module.html
+++ b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/html/testcpp-module.html
@@ -41,6 +41,8 @@
<div class="admonition note">
<p><b>Note: </b>This is just a test. /* Look, Ma! {I'm made of arguments!} */</p>
</div>
+<p><b>This module was introduced in version 5.15.</b></p>
+<p>1.0</p>
<h3 id="linking-to-function-like-things">Linking to function-like things</h3>
<ul>
<li><a href="testqdoc-test.html#someFunctionDefaultArg" translate="no">someFunctionDefaultArg</a>()</li>