From 39618f3a9766ad273fdb4c6036255e0a1b0d42e6 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Mon, 28 Sep 2020 09:42:08 +0200 Subject: QDoc: Turn QdocTagFiles into TagFileWriter to unify design MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the generateTagFile wrapper from QDocDatabase. Let the HtmlGenerator accesses the TagFileWriter directly. Drop being a singleton for the sake of being a singleton, as it is clearly not needed. Add test case to expected output test as part of refactoring. Task-number: QTBUG-71176 Fixes: QTBUG-86999 Change-Id: I0f7b3caa1249679c9676327417d675ca164e7a40 Reviewed-by: Topi Reiniƶ --- .../expected_output/testtagfile.tags | 257 +++++++++++++++++++++ .../testdata/configs/tagfiles.qdocconf | 2 + .../qdoc/generatedoutput/tst_generatedoutput.cpp | 8 +- 3 files changed, 265 insertions(+), 2 deletions(-) create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags create mode 100644 tests/auto/qdoc/generatedoutput/testdata/configs/tagfiles.qdocconf (limited to 'tests') diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags b/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags new file mode 100644 index 000000000..893b6aba1 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags @@ -0,0 +1,257 @@ + + + + QDoc.Test.AbstractParent + qml-qdoc-test-abstractparent.html + + void + rear + qml-qdoc-test-abstractparent.html + rear-method + (Child child, var method) + + + + QDoc.Test.Child + qml-qdoc-test-child.html + + + QDoc.Test.DocTest + qml-qdoc-test-doctest.html + + + completed + qml-qdoc-test-doctest.html + completed-signal + () + + + + foo + qml-qdoc-test-doctest.html + foo-signal + (var bar) + + + + fail + qml-qdoc-test-doctest.html + fail-method + ( message) + + + + doctest_fail + qml-qdoc-test-doctest.html + doctest_fail-method + ( msg) + + + + fail_hard + qml-qdoc-test-doctest.html + fail_hard-method + ( msg, option) + + + + UIComponents.ProgressBar + qml-uicomponents-progressbar.html + + + UIComponents.Switch + qml-uicomponents-switch.html + + + toggle + qml-uicomponents-switch.html + toggle-method + () + + + + releaseSwitch + qml-uicomponents-switch.html + releaseSwitch-method + () + + + + UIComponents.TabWidget + qml-uicomponents-tabwidget.html + + + setOpacities + qml-uicomponents-tabwidget.html + setOpacities-method + () + + + + TestQDoc + testqdoc.html + TestQDoc::Test + TestQDoc::TestDerived + + + QDOCTEST_MACRO + testqdoc.html + QDOCTEST_MACRO + QDOCTEST_MACRO + + + + TestQDoc::Test + testqdoc-test.html + + SomeType + testqdoc-test.html + SomeType-typedef + + + + int + someFunction + testqdoc-test.html + someFunction + (int v) + + + void + someFunctionDefaultArg + testqdoc-test.html + someFunctionDefaultArg + (int i, bool b) + + + void + obsoleteMember + testqdoc-test-obsolete.html + obsoleteMember + () + + + void + anotherObsoleteMember + testqdoc-test-obsolete.html + anotherObsoleteMember + () + + + void + deprecatedMember + testqdoc-test-obsolete.html + deprecatedMember + () + + + void (*)(bool) + funcPtr + testqdoc-test.html + funcPtr + (*)(bool) funcPtr(bool b, const char *s) + + + void + inlineFunction + testqdoc-test.html + inlineFunction + () + + + virtual void + virtualFun + testqdoc-test.html + virtualFun + () + + + void + overload + testqdoc-test.html + overload + () + + + void + overload + testqdoc-test.html + overload-1 + (bool b) + + + + QDOCTEST_MACRO2 + testqdoc-test.html + QDOCTEST_MACRO2 + (int &x) + + + + TestQDoc::TestDerived + testqdoc-testderived.html + Test + + DerivedType + testqdoc-testderived.html + DerivedType-alias + + + + NotTypedef + testqdoc-testderived.html + NotTypedef-alias + + + + virtual void + virtualFun + testqdoc-testderived.html + virtualFun + () override + + + + QDoc.Test.Type + qml-qdoc-test-type.html + + Type + copy + qml-qdoc-test-type.html + copy-method + ( a) + + + + enable + qml-qdoc-test-type.html + enable-method + () + + + + disable + qml-qdoc-test-type.html + disable-method + () + + + + completed + qml-qdoc-test-type.html + completed-signal + (int status) + + + + configured + qml-qdoc-test-type.html + configured-signal + () + + + + QDoc.Test.YetAnotherChild + qml-qdoc-test-yetanotherchild.html + + diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/tagfiles.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/tagfiles.qdocconf new file mode 100644 index 000000000..5e1382588 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/testdata/configs/tagfiles.qdocconf @@ -0,0 +1,2 @@ +include(testqml.qdocconf) +tagfile = testtagfile.tags diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index 3891111e3..896144049 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -76,6 +76,7 @@ private slots: void headerFile(); void usingDirective(); void properties(); + void testTagFile(); private: QScopedPointer m_outputDir; @@ -199,7 +200,6 @@ void tst_generatedOutput::testAndCompare(const char *input, const char *outNames fileInfo.filePath())); } QSKIP("Regenerated expected output only."); - return; } compareLineByLine(expectedOuts); @@ -475,7 +475,6 @@ void tst_generatedOutput::properties() { if (m_extraParams.isEmpty() && !m_regen) { QSKIP("Required include paths not available"); - return; } testAndCompare("testdata/configs/properties.qdocconf", @@ -486,6 +485,11 @@ void tst_generatedOutput::properties() m_extraParams.toLatin1().data()); } +void tst_generatedOutput::testTagFile() +{ + testAndCompare("testdata/configs/tagfiles.qdocconf", "testtagfile.tags"); +} + int main(int argc, char *argv[]) { tst_generatedOutput tc; -- cgit v1.2.3