summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2019-09-25 13:30:21 +0200
committerPaul Wicking <paul.wicking@qt.io>2019-10-14 12:21:02 +0200
commit5706c33a229f6e73da28125c33727a3591dc731f (patch)
tree07f6ef21c26ae87a9c7a8d661192af07e27bcde1 /tests
parentd10045175f1a943e7e89fc43d15a276d6f0f9fcc (diff)
QDoc: Remove QDocGlobals
This change moves the setting of configuration options from QDocGlobals to Config. This allows for the removal of the entire QDocGlobals class. Some methods (getters/setters) are part of the move, others were used exclusively by Config:: and are therefore dropped entirely. Also, move the ownership of QDocCommandLineParser from main() to Config - this makes Config the authoritative source of all settings, whether from the command line or .qdocconf variables, and makes it possible to reset() the full state of the Config. Finally, remove the QDocGlobals auto-test, as it is no longer needed. Change-Id: I8e39931c828c763cb0462cbbdf3fe1a39b2ad70b Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qdoc/qdoc.pro3
-rw-r--r--tests/auto/qdoc/qdocglobals/qdocglobals.pro9
-rw-r--r--tests/auto/qdoc/qdocglobals/tst_qdocglobals.cpp205
3 files changed, 1 insertions, 216 deletions
diff --git a/tests/auto/qdoc/qdoc.pro b/tests/auto/qdoc/qdoc.pro
index 74c6e7787..97117dc6f 100644
--- a/tests/auto/qdoc/qdoc.pro
+++ b/tests/auto/qdoc/qdoc.pro
@@ -1,5 +1,4 @@
TEMPLATE = subdirs
SUBDIRS = \
- generatedoutput \
- qdocglobals
+ generatedoutput
diff --git a/tests/auto/qdoc/qdocglobals/qdocglobals.pro b/tests/auto/qdoc/qdocglobals/qdocglobals.pro
deleted file mode 100644
index fa7ddb8e0..000000000
--- a/tests/auto/qdoc/qdocglobals/qdocglobals.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-CONFIG += testcase
-QT = core testlib
-TARGET = tst_qdocglobals
-INCLUDEPATH += $$PWD/../../../../src/qdoc
-
-HEADERS += $$PWD/../../../../src/qdoc/qdocglobals.h
-
-SOURCES += $$PWD/../../../../src/qdoc/qdocglobals.cpp \
- tst_qdocglobals.cpp
diff --git a/tests/auto/qdoc/qdocglobals/tst_qdocglobals.cpp b/tests/auto/qdoc/qdocglobals/tst_qdocglobals.cpp
deleted file mode 100644
index fca46911f..000000000
--- a/tests/auto/qdoc/qdocglobals/tst_qdocglobals.cpp
+++ /dev/null
@@ -1,205 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qdocglobals.h"
-
-#include <QtCore/qhash.h>
-#include <QtCore/qstringlist.h>
-#include <QtTest/QtTest>
-
-class testQDocGlobals : public QObject
-{
- Q_OBJECT
-
-private slots:
- void testClassMembersInitializeToFalseOrEmpty();
- void testEnableHighlighting();
- void testSetShowInternal();
- void testSetSingleExec();
- void testSetWriteQaPages();
- void testRedirectDocumentationToDevNull();
- void testSetNoLinkErrors();
- void testSetAutoLinkErrors();
- void testSetObsoleteLinks();
-
- void testAddDefine();
- void testAddIncludePath();
- void testDependModules();
- void testAppendToIndexDirs();
- void testSetCurrentDir();
- void testPreviousCurrentDir();
-};
-
-void testQDocGlobals::testClassMembersInitializeToFalseOrEmpty()
-{
- QDocGlobals qdocTestGlobals;
- QCOMPARE(qdocTestGlobals.highlighting(), false);
- QCOMPARE(qdocTestGlobals.showInternal(), false);
- QCOMPARE(qdocTestGlobals.singleExec(), false);
- QCOMPARE(qdocTestGlobals.writeQaPages(), false);
- QCOMPARE(qdocTestGlobals.redirectDocumentationToDevNull(), false);
- QCOMPARE(qdocTestGlobals.noLinkErrors(), false);
- QCOMPARE(qdocTestGlobals.autolinkErrors(), false);
- QCOMPARE(qdocTestGlobals.obsoleteLinks(), false);
-
- QVERIFY(qdocTestGlobals.defines().isEmpty());
- QVERIFY(qdocTestGlobals.includesPaths().isEmpty());
- QVERIFY(qdocTestGlobals.dependModules().isEmpty());
- QVERIFY(qdocTestGlobals.indexDirs().isEmpty());
- QVERIFY(qdocTestGlobals.currentDir().isEmpty());
- QVERIFY(qdocTestGlobals.previousCurrentDir().isEmpty());
-}
-
-void testQDocGlobals::testEnableHighlighting()
-{
- QDocGlobals qdocTestGlobals;
- qdocTestGlobals.enableHighlighting(true);
- QVERIFY(qdocTestGlobals.highlighting());
-}
-
-void testQDocGlobals::testSetShowInternal()
-{
- QDocGlobals qdocTestGlobals;
- qdocTestGlobals.setShowInternal(true);
- QVERIFY(qdocTestGlobals.showInternal());
-}
-
-void testQDocGlobals::testSetSingleExec()
-{
- QDocGlobals qdocTestGlobals;
- qdocTestGlobals.setSingleExec(true);
- QVERIFY(qdocTestGlobals.singleExec());
-}
-
-void testQDocGlobals::testSetWriteQaPages()
-{
- QDocGlobals qdocTestGlobals;
- qdocTestGlobals.setWriteQaPages(true);
- QVERIFY(qdocTestGlobals.writeQaPages());
-}
-
-void testQDocGlobals::testRedirectDocumentationToDevNull()
-{
- QDocGlobals qdocTestGlobals;
- qdocTestGlobals.setRedirectDocumentationToDevNull(true);
- QVERIFY(qdocTestGlobals.redirectDocumentationToDevNull());
-}
-
-void testQDocGlobals::testSetNoLinkErrors()
-{
- QDocGlobals qdocTestGlobals;
- qdocTestGlobals.setNoLinkErrors(true);
- QVERIFY(qdocTestGlobals.noLinkErrors());
-}
-
-void testQDocGlobals::testSetAutoLinkErrors()
-{
- QDocGlobals qdocTestGlobals;
- qdocTestGlobals.setAutolinkErrors(true);
- QVERIFY(qdocTestGlobals.autolinkErrors());
-}
-
-void testQDocGlobals::testSetObsoleteLinks()
-{
- QDocGlobals qdocTestGlobals;
- qdocTestGlobals.setObsoleteLinks(true);
- QVERIFY(qdocTestGlobals.obsoleteLinks());
-}
-
-void testQDocGlobals::testAddDefine()
-{
- QDocGlobals qdocTestGlobals;
- QStringList defineTestList1 = { QStringLiteral("qtforpython") };
- QStringList defineTestList2 = { QStringLiteral("example") };
- QStringList expected;
- expected << defineTestList1 << defineTestList2;
-
- qdocTestGlobals.addDefine(defineTestList1);
- QCOMPARE(qdocTestGlobals.defines().size(), 1);
- qdocTestGlobals.addDefine(defineTestList2);
- QCOMPARE(qdocTestGlobals.defines().size(), 2);
- QCOMPARE(qdocTestGlobals.defines(), expected);
-}
-
-void testQDocGlobals::testAddIncludePath()
-{
- QDocGlobals qdocTestGlobals;
- QString testFlag = "-I";
- QString testPath0 = "/qt5/qtdoc/doc/.";
- QString testPath1 = "/qt5/qtbase/mkspecs/linux-g++";
- QStringList expected = { "-I/qt5/qtdoc/doc/.",
- "-I/qt5/qtbase/mkspecs/linux-g++" };
-
- qdocTestGlobals.addIncludePath(testFlag, testPath0);
- qdocTestGlobals.addIncludePath(testFlag, testPath1);
- QStringList result = qdocTestGlobals.includesPaths();
- QCOMPARE(result, expected);
-}
-
-void testQDocGlobals::testDependModules()
-{
- QDocGlobals qdocTestGlobals;
- QStringList expected = { "qdoc", "qmake", "qtcore", "qthelp", "qtqml" };
-
- qdocTestGlobals.dependModules() = expected;
- QCOMPARE(qdocTestGlobals.dependModules().size(), 5);
- QCOMPARE(qdocTestGlobals.dependModules(), expected);
-}
-
-void testQDocGlobals::testAppendToIndexDirs()
-{
- QDocGlobals qdocTestGlobals;
- QString testPath = "/qt5/qtbase/doc";
- QStringList expected;
- expected << testPath;
-
- qdocTestGlobals.appendToIndexDirs(testPath);
- QCOMPARE(qdocTestGlobals.indexDirs(), expected);
-}
-
-void testQDocGlobals::testSetCurrentDir()
-{
- QDocGlobals qdocTestGlobals;
- QString expected = "/qt5/qtdoc/doc/config";
-
- qdocTestGlobals.setCurrentDir(expected);
- QCOMPARE(qdocTestGlobals.currentDir(), expected);
-}
-
-void testQDocGlobals::testPreviousCurrentDir()
-{
- QDocGlobals qdocTestGlobals;
- QString expected = "/qt5/qtdoc/doc";
-
- qdocTestGlobals.setCurrentDir(expected);
- QCOMPARE(qdocTestGlobals.currentDir(), expected);
-}
-
-QTEST_APPLESS_MAIN(testQDocGlobals)
-
-#include "tst_qdocglobals.moc"