summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdoc
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2019-09-05 00:42:43 +0200
committerTopi Reinio <topi.reinio@qt.io>2019-09-27 12:57:56 +0200
commitdd800d1669f49340614ac26dd9a4ef0bcc8f78f1 (patch)
treee93dde8d1a65d9664db6f5c2c1816bc844276bc3 /tests/auto/qdoc
parentc05f918435fab435d4492c3df24afcb872671a93 (diff)
Add a test case for QDoc's link command
Validate different ways of linking to other documentation topics. Fix the incorrect expected output in the existing tests. Task-number: QTBUG-78040 Change-Id: Idb6bf9c79ec99894e2fe0ddb7e65150204c96627 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'tests/auto/qdoc')
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qdoctests-qdocfileoutput-linking.html28
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qdoctests-qdocfileoutput.html10
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testqdoc.html2
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/uicomponents-qmlmodule.html2
-rw-r--r--tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc25
-rw-r--r--tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp3
6 files changed, 67 insertions, 3 deletions
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qdoctests-qdocfileoutput-linking.html b/tests/auto/qdoc/generatedoutput/expected_output/qdoctests-qdocfileoutput-linking.html
new file mode 100644
index 000000000..da5398612
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qdoctests-qdocfileoutput-linking.html
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- qdoctests-outputfromqdocfiles.qdoc -->
+ <title>Testing QDoc's link command | Test</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#link-targets">Link targets</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">Testing QDoc's link command</h1>
+<span class="subtitle"></span>
+<!-- $$$qdoctests-qdocfileoutput-linking.html-description -->
+<div class="descr"> <a name="details"></a>
+<a name="link-test-target"></a><a name="link-targets"></a>
+<h2 id="link-targets">Link targets</h2>
+<p>Valid parameters for the link command (<code>\l</code>) are page and section titles, targets defined with \target or \keyword commands, and API reference keywords (types, methods, namespaces, and so on).</p>
+</div>
+<!-- @@@qdoctests-qdocfileoutput-linking.html -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qdoctests-qdocfileoutput.html b/tests/auto/qdoc/generatedoutput/expected_output/qdoctests-qdocfileoutput.html
index 199d63ef1..6f444482d 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/qdoctests-qdocfileoutput.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qdoctests-qdocfileoutput.html
@@ -13,6 +13,7 @@
<ul>
<li class="level1"><a href="#supported-file-types">Supported file types</a></li>
<li class="level1"><a href="#further-information">Further information</a></li>
+<li class="level1"><a href="#linking">Linking</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
@@ -38,6 +39,15 @@
<li><code>\li</code></li>
<li><code>\endlist</code></li>
</ul>
+<a name="linking"></a>
+<h2 id="linking">Linking</h2>
+<p>There are multiple ways to create hyperlinks to other topics:</p>
+<ul>
+<li><a href="qdoctests-qdocfileoutput-linking.html">Linking to a page title</a></li>
+<li><a href="qdoctests-qdocfileoutput-linking.html#link-targets">Linking to a section title</a></li>
+<li><a href="qdoctests-qdocfileoutput-linking.html#link-test-target">Linking using a \target string</a></li>
+<li><a href="qdoctests-qdocfileoutput-linking.html">Linking using a \keyword string</a></li>
+</ul>
</div>
<!-- @@@qdoctests-qdocfileoutput.html -->
</body>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc.html
index d46a4f5c8..055b859b5 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc.html
@@ -54,7 +54,7 @@
<div class="macros">
<h2>Macro Documentation</h2>
<!-- $$$QDOCTEST_MACRO[overload1]$$$QDOCTEST_MACRO -->
-<h3 class="fn" id="QDOCTEST_MACRO"><a name="QDOCTEST_MACRO"></a>TestQDoc::<span class="name">QDOCTEST_MACRO</span></h3>
+<h3 class="fn" id="QDOCTEST_MACRO"><a name="QDOCTEST_MACRO"></a><span class="name">QDOCTEST_MACRO</span></h3>
<!-- @@@QDOCTEST_MACRO -->
</div>
</body>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/uicomponents-qmlmodule.html b/tests/auto/qdoc/generatedoutput/expected_output/uicomponents-qmlmodule.html
index 87a0d45b5..8c577ab7f 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/uicomponents-qmlmodule.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/uicomponents-qmlmodule.html
@@ -13,7 +13,7 @@
<!-- $$$UIComponents-description -->
<div class="descr"> <a name="details"></a>
<p>This is a listing of a list of UI components implemented by QML types. These files are available for general import and they are based on the Qt Quick Code Samples.</p>
-<p>This module is part of the <a href="test-componentset-example.html#">UIComponents</a> example.</p>
+<p>This module is part of the <a href="test-componentset-example.html">UIComponents</a> example.</p>
</div>
<!-- @@@UIComponents -->
</body>
diff --git a/tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc b/tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc
index fc3a5d870..e56c447c4 100644
--- a/tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc
+++ b/tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc
@@ -55,4 +55,29 @@
\li \c {\li}
\li \c {\endlist}
\endlist
+
+ \section1 Linking
+
+ There are multiple ways to create hyperlinks to other topics:
+
+ \list
+ \li \l {Testing QDoc's link command}{Linking to a page title}
+ \li \l {Link targets}{Linking to a section title}
+ \li \l {link-test-target}{Linking using a \\target string}
+ \li \l {QDoc Linking Test}{Linking using a \\keyword string}
+ \endlist
+*/
+
+/*!
+ \keyword QDoc Linking Test
+ \page qdoctests-qdocfileoutput-linking.html
+ \title Testing QDoc's link command
+ \brief This is a page for testing QDoc's link command.
+
+ \target link-test-target
+ \section1 Link targets
+
+ Valid parameters for the link command (\c {\l}) are page and section
+ titles, targets defined with \\target or \\keyword commands, and API
+ reference keywords (types, methods, namespaces, and so on).
*/
diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
index 61a9245ec..09709ac6c 100644
--- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
+++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
@@ -137,7 +137,8 @@ void tst_generatedOutput::testAndCompare(const char *input,
void tst_generatedOutput::htmlFromQDocFile()
{
testAndCompare("test.qdocconf",
- "qdoctests-qdocfileoutput.html");
+ "qdoctests-qdocfileoutput.html "
+ "qdoctests-qdocfileoutput-linking.html");
}
void tst_generatedOutput::htmlFromCpp()