diff options
author | Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> | 2021-05-03 17:32:49 +0200 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2021-05-08 01:03:01 +0200 |
commit | 67f282f795ce15dc561a95a5082569ab018ab7d8 (patch) | |
tree | 91bc43f8b0152bd3a75eabf1dbc44c081bb52b05 /tests | |
parent | 6fca105fdfd1edf80d8fe792908eaae9390b134e (diff) |
qdoc: Check if the module version no. is empty
Assuming that the version string is always available
leads to import text with just a dot in the docs.
Added a test qmlmodule without the version to check
if this works. In addition, updated the documentation
to mention the optional version argument and made a few
minor edits.
Fixes: QTBUG-93265
Pick-to: 6.0 6.1
Change-Id: Ib0ee8c1e0fca43cd2cbee19374d14140a51f13fa
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'tests')
15 files changed, 160 insertions, 6 deletions
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoc-test-qmlmodule.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoc-test-qmlmodule.xml index 8d514bad1..340a83f53 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoc-test-qmlmodule.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoc-test-qmlmodule.xml @@ -1,7 +1,7 @@ <?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:title>QDoc.Test QML Module</db:title> <db:productname>Test</db:productname> <db:titleabbrev>A test project for QDoc build artifacts</db:titleabbrev> <db:abstract> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-test-nover-typenoversion.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-test-nover-typenoversion.xml new file mode 100644 index 000000000..318c6175a --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-test-nover-typenoversion.xml @@ -0,0 +1,28 @@ +<?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>TypeNoVersion QML Type</db:title> +<db:productname>Test</db:productname> +<db:titleabbrev>A test project for QDoc build artifacts</db:titleabbrev> +<db:abstract> +<db:para>Another QML type documented in a .cpp file.</db:para> +</db:abstract> +</db:info> +<db:variablelist> +<db:varlistentry> +<db:term>Import Statement</db:term> +<db:listitem> +<db:para>import Test.NoVer</db:para> +</db:listitem> +</db:varlistentry> +<db:varlistentry> +<db:term>Instantiates:</db:term> +<db:listitem> +<db:para><db:link xlink:href="testqdoc-testderived.xml">TestDerived</db:link></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/docbook/test-nover-qmlmodule.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/test-nover-qmlmodule.xml new file mode 100644 index 000000000..7a3138cca --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/test-nover-qmlmodule.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>Versionless QML Module</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 without version.</db:para> +<db:para>This module was introduced in Qt 1.1.</db:para> +</db:abstract> +</db:info> +<db:para>This module was introduced in Qt 1.1.</db:para> +<db:anchor xml:id="details"/> +<db:variablelist role="members"> +<db:varlistentry> +<db:term><db:link xlink:href="qml-test-nover-typenoversion.xml" xlink:role="">TypeNoVersion</db:link></db:term> +<db:listitem> +<db:para>Another QML type documented in a .cpp file.</db:para> +</db:listitem> +</db:varlistentry> +</db:variablelist> +</db:article> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/test-nover-qmlmodule.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/test-nover-qmlmodule.webxml new file mode 100644 index 000000000..5d24b3077 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/test-nover-qmlmodule.webxml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebXML> + <document/> +</WebXML> 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 index 8934e4729..73a5f9653 100644 --- 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 @@ -1,7 +1,7 @@ <?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:title>QDoc.Test QML Module</db:title> <db:productname>Test</db:productname> <db:titleabbrev>A test project for QDoc build artifacts</db:titleabbrev> <db:abstract> 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 index 41358bce4..4a2734fc2 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/noautolist/qdoc-test-qmlmodule.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/noautolist/qdoc-test-qmlmodule.html @@ -3,10 +3,11 @@ <head> <meta charset="utf-8"> <!-- type.cpp --> - <title>Test</title> + <title>QDoc.Test QML Module | Test</title> </head> <body> <div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div> +<h1 class="title">QDoc.Test QML Module</h1> <span class="subtitle"></span> <p><b>This module is under development and is subject to change.</b></p> <p>This module was introduced in Qt 1.1.</p> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qdoc-test-qmlmodule.html b/tests/auto/qdoc/generatedoutput/expected_output/qdoc-test-qmlmodule.html index 62fb2bdda..0605e4d60 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qdoc-test-qmlmodule.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qdoc-test-qmlmodule.html @@ -3,10 +3,11 @@ <head> <meta charset="utf-8"> <!-- type.cpp --> - <title>Test</title> + <title>QDoc.Test QML Module | Test</title> </head> <body> <div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div> +<h1 class="title">QDoc.Test QML Module</h1> <span class="subtitle"></span> <p><b>This module is under development and is subject to change.</b></p> <p>This module was introduced in Qt 1.1.</p> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-test-nover-typenoversion-members.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-test-nover-typenoversion-members.html new file mode 100644 index 000000000..a9bf9cf1d --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-test-nover-typenoversion-members.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- type.cpp --> + <title>List of All Members for TypeNoVersion | Test</title> +</head> +<body> +<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div> +<h1 class="title">List of All Members for TypeNoVersion</h1> +<p>This is the complete list of members for <a href="qml-test-nover-typenoversion.html">TypeNoVersion</a>, including inherited members.</p> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-test-nover-typenoversion.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-test-nover-typenoversion.html new file mode 100644 index 000000000..2bfdd1ebb --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-test-nover-typenoversion.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- type.cpp --> + <title>TypeNoVersion QML Type | Test</title> +</head> +<body> +<div class="sidebar"> +<div class="toc"> +<h3 id="toc">Contents</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">TypeNoVersion QML Type</h1> +<span class="subtitle"></span> +<!-- $$$TypeNoVersion-brief --> +<p>Another QML type documented in a .cpp file. <a href="#details">More...</a></p> +<!-- @@@TypeNoVersion --> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import Test.NoVer</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Instantiates:</td><td class="memItemRight bottomAlign"> <a href="qml-test-nover-typenoversion.html"><a href="testqdoc-testderived.html">TestDerived</a></td></tr></table></div><ul> +<li><a href="qml-test-nover-typenoversion-members.html">List of all members, including inherited members</a></li> +</ul> +<!-- $$$TypeNoVersion-description --> +<h2 id="details">Detailed Description</h2> +<!-- @@@TypeNoVersion --> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qmlmodules.html b/tests/auto/qdoc/generatedoutput/expected_output/qmlmodules.html index 8c89e1540..68860f9d8 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qmlmodules.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qmlmodules.html @@ -13,8 +13,9 @@ <div class="descr" id="details"> <div class="table"><table class="annotated"> <tr class="odd topAlign"><td class="tblName"><p><a href="test-empty-qmlmodule.html">No QML Types Here</a></p></td><td class="tblDescr"><p>A QML module with no member types.</p></td></tr> -<tr class="even topAlign"><td class="tblName"><p><a href="qdoc-test-qmlmodule.html">QDoc.Test</a></p></td><td class="tblDescr"><p>QML Types for the Test module.</p></td></tr> +<tr class="even topAlign"><td class="tblName"><p><a href="qdoc-test-qmlmodule.html">QDoc.Test QML Module</a></p></td><td class="tblDescr"><p>QML Types for the Test module.</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="uicomponents-qmlmodule.html">UI Components</a></p></td><td class="tblDescr"><p>Basic set of UI components.</p></td></tr> +<tr class="even topAlign"><td class="tblName"><p><a href="test-nover-qmlmodule.html">Versionless QML Module</a></p></td><td class="tblDescr"><p>QML Types for the Test module without version.</p></td></tr> </table></div> </div> <!-- @@@qmlmodules.html --> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test-nover-qmlmodule.html b/tests/auto/qdoc/generatedoutput/expected_output/test-nover-qmlmodule.html new file mode 100644 index 000000000..fdaa8dc95 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/test-nover-qmlmodule.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- type.cpp --> + <title>Versionless QML Module | Test</title> +</head> +<body> +<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div> +<h1 class="title">Versionless QML Module</h1> +<span class="subtitle"></span> +<p>This module was introduced in Qt 1.1.</p> +<!-- $$$Test.NoVer-description --> +<div class="descr" id="details"> +</div> +<!-- @@@Test.NoVer --> +<div class="table"><table class="annotated"> +<tr class="odd topAlign"><td class="tblName"><p><a href="qml-test-nover-typenoversion.html">TypeNoVersion</a></p></td><td class="tblDescr"><p>Another QML type documented in a .cpp file</p></td></tr> +</table></div> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp index 4fffda513..cb5379fbe 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp +++ b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp @@ -7,7 +7,6 @@ <toc> <section ref="uicomponents-qmlmodule.html" title="UI Components"> <section ref="uicomponents-qmlmodule.html" title="Test"> - <section ref="qdoc-test-qmlmodule.html" title=""/> <section ref="autolinking.html" title="Autolinking"/> <section ref="test-cmaketest-example.html" title="CMake Example Project"/> <section ref="test-demos-demo-example.html" title="Demo"/> @@ -15,9 +14,11 @@ <section ref="test-empty-qmlmodule.html" title="No QML Types Here"/> <section ref="obsolete-classes.html" title="Obsolete Classes"/> <section ref="testcpp-module.html" title="QDoc Test C++ Classes"/> + <section ref="qdoc-test-qmlmodule.html" title="QDoc.Test QML Module"/> <section ref="test-componentset-example.html" title="QML Documentation Example"/> <section ref="qmlmodules.html" title="QML Modules"/> <section ref="uicomponents-qmlmodule.html" title="UI Components"/> + <section ref="test-nover-qmlmodule.html" title="Versionless QML Module"/> </section> <section ref="testcpp-module.html" title="Classes"> <section ref="testqdoc.html" title="TestQDoc"/> @@ -74,6 +75,7 @@ <keyword name="QDOCTEST_MACRO" id="QDOCTEST_MACRO" ref="testqdoc.html#QDOCTEST_MACRO"/> <keyword name="QDOCTEST_MACRO2" id="QDOCTEST_MACRO2" ref="testqdoc-test.html#QDOCTEST_MACRO2"/> <keyword name="QDoc Test C++ Classes" id="QDoc Test C++ Classes" ref="testcpp-module.html"/> + <keyword name="QDoc.Test QML Module" id="QDoc.Test QML Module" ref="qdoc-test-qmlmodule.html"/> <keyword name="QML Modules" id="QML Modules" ref="qmlmodules.html"/> <keyword name="Switch" id="QML.Switch" ref="qml-uicomponents-switch.html"/> <keyword name="Switch" id="QML.UIComponents1.Switch" ref="qml-uicomponents-switch.html"/> @@ -87,7 +89,10 @@ <keyword name="TestQDoc" id="TestQDoc" ref="testqdoc.html"/> <keyword name="Type" id="QML.Type" ref="qml-qdoc-test-type.html"/> <keyword name="Type" id="QML.QDoc.Test1.Type" ref="qml-qdoc-test-type.html"/> + <keyword name="TypeNoVersion" id="QML.TypeNoVersion" ref="qml-test-nover-typenoversion.html"/> + <keyword name="TypeNoVersion" id="QML.Test.NoVer.TypeNoVersion" ref="qml-test-nover-typenoversion.html"/> <keyword name="UI Components" id="UI Components" ref="uicomponents-qmlmodule.html"/> + <keyword name="Versionless QML Module" id="Versionless QML Module" ref="test-nover-qmlmodule.html"/> <keyword name="YetAnotherChild" id="QML.YetAnotherChild" ref="qml-qdoc-test-yetanotherchild.html"/> <keyword name="YetAnotherChild" id="QML.QDoc.Test1.YetAnotherChild" ref="qml-qdoc-test-yetanotherchild.html"/> <keyword name="abs" id="int::abs" ref="qml-int.html#abs-method"/> @@ -157,6 +162,8 @@ <file>qml-qdoc-test-type.html</file> <file>qml-qdoc-test-yetanotherchild-members.html</file> <file>qml-qdoc-test-yetanotherchild.html</file> + <file>qml-test-nover-typenoversion-members.html</file> + <file>qml-test-nover-typenoversion.html</file> <file>qml-uicomponents-progressbar-members.html</file> <file>qml-uicomponents-progressbar.html</file> <file>qml-uicomponents-switch-members.html</file> @@ -176,6 +183,7 @@ <file>test-demos-demo-example.html</file> <file>test-demos-hidden-example.html</file> <file>test-empty-qmlmodule.html</file> + <file>test-nover-qmlmodule.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/expected_output/testtagfile.tags b/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags index 1e9a28a59..34428097b 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags +++ b/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags @@ -307,6 +307,10 @@ </member> </compound> <compound kind="class"> + <name>Test.NoVer.TypeNoVersion</name> + <filename>qml-test-nover-typenoversion.html</filename> + </compound> + <compound kind="class"> <name>QDoc.Test.YetAnotherChild</name> <filename>qml-qdoc-test-yetanotherchild.html</filename> </compound> diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp b/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp index 3dc83d39c..a931655a6 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp +++ b/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp @@ -30,6 +30,7 @@ /*! \qmlmodule QDoc.Test \QDocTestVer + \title QDoc.Test QML Module \brief QML Types for the Test module. \since 1.1 \preliminary @@ -44,6 +45,13 @@ */ /*! + \qmlmodule Test.NoVer + \title Versionless QML Module + \brief QML Types for the Test module without version. + \since 1.1 +*/ + +/*! \qmltype Type \instantiates TestQDoc::Test \inqmlmodule QDoc.Test @@ -51,6 +59,13 @@ */ /*! + \qmltype TypeNoVersion + \instantiates TestQDoc::TestDerived + \inqmlmodule Test.NoVer + \brief Another QML type documented in a .cpp file. +*/ + +/*! \qmlproperty int Type::id \readonly \brief A read-only property. diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index 9bfe6ed35..826fb2888 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -252,12 +252,15 @@ void tst_generatedOutput::htmlFromQml() "test-cmaketest-example.html " "uicomponents-qmlmodule.html " "qdoc-test-qmlmodule.html " + "test-nover-qmlmodule.html " "qml-qdoc-test-abstractparent.html " "qml-qdoc-test-child.html " "qml-qdoc-test-yetanotherchild.html " "qml-qdoc-test-doctest.html " "qml-qdoc-test-type-members.html " "qml-qdoc-test-type.html " + "qml-test-nover-typenoversion.html " + "qml-test-nover-typenoversion-members.html " "qml-uicomponents-progressbar.html " "qml-uicomponents-switch.html " "qml-uicomponents-tabwidget.html " @@ -293,6 +296,7 @@ void tst_generatedOutput::webXmlFromQml() { testAndCompare("testdata/configs/webxml_testqml.qdocconf", "html/test-componentset-example.webxml " + "html/test-nover-qmlmodule.webxml " "html/uicomponents-qmlmodule.webxml"); } @@ -328,11 +332,13 @@ void tst_generatedOutput::docBookFromQml() "docbook/test-componentset-example.xml " "docbook/uicomponents-qmlmodule.xml " "docbook/qdoc-test-qmlmodule.xml " + "docbook/test-nover-qmlmodule.xml " "docbook/qml-qdoc-test-abstractparent.xml " "docbook/qml-qdoc-test-child.xml " "docbook/qml-qdoc-test-yetanotherchild.xml " "docbook/qml-qdoc-test-doctest.xml " "docbook/qml-qdoc-test-type.xml " + "docbook/qml-test-nover-typenoversion.xml " "docbook/qml-uicomponents-progressbar.xml " "docbook/qml-uicomponents-switch.xml " "docbook/qml-uicomponents-tabwidget.xml " |