diff options
author | Topi Reinio <topi.reinio@qt.io> | 2019-12-06 10:57:24 +0100 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2019-12-20 13:56:45 +0100 |
commit | 4dcc7a3d10a223ddd111eaaac6665609add7c46f (patch) | |
tree | 59ec17df2e762d4ce935b216d67256ebf856794a | |
parent | 34b27e650f2c1033e5e92c57beeccc5aabcd3f63 (diff) | |
download | qttools-4dcc7a3d10a223ddd111eaaac6665609add7c46f.tar.gz |
Add an autotest for QDoc's example manifest file
Add a test that verifies the content of the examples-manifest.xml,
with some metadata, and a QHP namespace defined.
Change-Id: I91bc25ee10e1054c823ec1d14cccb6d9c6ca36d9
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
3 files changed, 35 insertions, 0 deletions
diff --git a/tests/auto/qdoc/generatedoutput/examples-qhp.qdocconf b/tests/auto/qdoc/generatedoutput/examples-qhp.qdocconf new file mode 100644 index 000000000..816d1d1a4 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/examples-qhp.qdocconf @@ -0,0 +1,18 @@ +# QML test includes a documented example +include(testqml.qdocconf) + +# Configure .qhp generation +qhp.projects = Test + +qhp.Test.file = test.qhp +qhp.Test.namespace = org.qt-project.test.001 +qhp.Test.virtualFolder = test +qhp.Test.indexTitle = UI Components +qhp.Test.indexRoot = + +# Add some meta-data to the example +manifestmeta.filters = test + +manifestmeta.test.names = * +manifestmeta.test.attributes = isTest:true +manifestmeta.test.tags = test diff --git a/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml b/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml new file mode 100644 index 000000000..330923033 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<instructionals module="Test"> + <examples> + <example name="QML Documentation Example" docUrl="qthelp://org.qt-project.test.001/test/test-componentset-example.html" isTest="true"> + <description><![CDATA[No description available]]></description> + <tags>documentation,qml,test</tags> + </example> + </examples> +</instructionals> diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index 17f930981..a705575a8 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -47,6 +47,8 @@ private slots: void webXmlFromQml(); void webXmlFromCppBug80259(); + void examplesManifestXml(); + private: QScopedPointer<QTemporaryDir> m_outputDir; QString m_qdoc; @@ -237,6 +239,12 @@ void tst_generatedOutput::webXmlFromCppBug80259() "html/index.webxml"); } +void tst_generatedOutput::examplesManifestXml() +{ + testAndCompare("examples-qhp.qdocconf", + "examples-manifest.xml"); +} + QTEST_APPLESS_MAIN(tst_generatedOutput) #include "tst_generatedoutput.moc" |