summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdoc/config
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qdoc/config')
-rw-r--r--tests/auto/qdoc/config/CMakeLists.txt16
-rw-r--r--tests/auto/qdoc/config/testdata/configs/exampletest.qdocconf2
-rw-r--r--tests/auto/qdoc/config/testdata/configs/expandvars.qdocconf13
-rw-r--r--tests/auto/qdoc/config/testdata/configs/includepaths.qdocconf2
-rw-r--r--tests/auto/qdoc/config/testdata/configs/includes/test.qdoc1
-rw-r--r--tests/auto/qdoc/config/testdata/configs/paths.qdocconf5
-rw-r--r--tests/auto/qdoc/config/testdata/configs/vars.qdocconf17
-rw-r--r--tests/auto/qdoc/config/testdata/exampletest/examples/test/empty/test.pro1
-rw-r--r--tests/auto/qdoc/config/testdata/exampletest/examples/test/example1/example1.pro1
-rw-r--r--tests/auto/qdoc/config/testdata/exampletest/examples/test/example2/example2.qmlproject1
-rw-r--r--tests/auto/qdoc/config/testdata/exampletest/examples/test/example3/example3.pyproject1
-rw-r--r--tests/auto/qdoc/config/testdata/exampletest/examples/test/example4/CMakeLists.txt1
-rw-r--r--tests/auto/qdoc/config/testdata/includepaths/include/framework/ignore.h1
-rw-r--r--tests/auto/qdoc/config/testdata/includepaths/include/more/ignore.h1
-rw-r--r--tests/auto/qdoc/config/testdata/includepaths/include/purpose.h1
-rw-r--r--tests/auto/qdoc/config/testdata/includepaths/include/system/ignore.h1
-rw-r--r--tests/auto/qdoc/config/testdata/includepaths/includepaths.qdocconf16
-rw-r--r--tests/auto/qdoc/config/testdata/paths/includes/test.qdoc1
-rw-r--r--tests/auto/qdoc/config/testdata/paths/paths.qdocconf2
-rw-r--r--tests/auto/qdoc/config/tst_config.cpp205
20 files changed, 0 insertions, 289 deletions
diff --git a/tests/auto/qdoc/config/CMakeLists.txt b/tests/auto/qdoc/config/CMakeLists.txt
deleted file mode 100644
index 458214503..000000000
--- a/tests/auto/qdoc/config/CMakeLists.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-# Generated from config.pro.
-
-#####################################################################
-## tst_config Test:
-#####################################################################
-
-qt_internal_add_test(tst_config
- SOURCES
- ../../../../src/qdoc/config.cpp ../../../../src/qdoc/config.h
- ../../../../src/qdoc/location.cpp ../../../../src/qdoc/location.h
- ../../../../src/qdoc/qdoccommandlineparser.cpp ../../../../src/qdoc/qdoccommandlineparser.h
- ../../../../src/qdoc/utilities.cpp ../../../../src/qdoc/utilities.h
- tst_config.cpp
- INCLUDE_DIRECTORIES
- ../../../../src/qdoc
-)
diff --git a/tests/auto/qdoc/config/testdata/configs/exampletest.qdocconf b/tests/auto/qdoc/config/testdata/configs/exampletest.qdocconf
deleted file mode 100644
index a1459f977..000000000
--- a/tests/auto/qdoc/config/testdata/configs/exampletest.qdocconf
+++ /dev/null
@@ -1,2 +0,0 @@
-project = ExampleTest
-exampledirs = ../exampletest/examples
diff --git a/tests/auto/qdoc/config/testdata/configs/expandvars.qdocconf b/tests/auto/qdoc/config/testdata/configs/expandvars.qdocconf
deleted file mode 100644
index ace4ab13b..000000000
--- a/tests/auto/qdoc/config/testdata/configs/expandvars.qdocconf
+++ /dev/null
@@ -1,13 +0,0 @@
-project = ExpandVars
-
-{data,data1,data2} = foo
-data1 += bar
-data2 += "bar baz"
-
-expanded1 = $data
-expanded2 = ${data1,,}
-expanded3 = "${data1,} ${data2,}"
-literally = \$data \${data}
-
-listdata = ${QDOC_TSTCONFIG_LIST}
-csvlist = ${listdata,,}
diff --git a/tests/auto/qdoc/config/testdata/configs/includepaths.qdocconf b/tests/auto/qdoc/config/testdata/configs/includepaths.qdocconf
deleted file mode 100644
index 2d6ff22af..000000000
--- a/tests/auto/qdoc/config/testdata/configs/includepaths.qdocconf
+++ /dev/null
@@ -1,2 +0,0 @@
-project = IncludePaths
-include(../includepaths/includepaths.qdocconf)
diff --git a/tests/auto/qdoc/config/testdata/configs/includes/test.qdoc b/tests/auto/qdoc/config/testdata/configs/includes/test.qdoc
deleted file mode 100644
index 700f1e819..000000000
--- a/tests/auto/qdoc/config/testdata/configs/includes/test.qdoc
+++ /dev/null
@@ -1 +0,0 @@
-/*! nothing here */
diff --git a/tests/auto/qdoc/config/testdata/configs/paths.qdocconf b/tests/auto/qdoc/config/testdata/configs/paths.qdocconf
deleted file mode 100644
index 93f7b3586..000000000
--- a/tests/auto/qdoc/config/testdata/configs/paths.qdocconf
+++ /dev/null
@@ -1,5 +0,0 @@
-project = Paths
-include(../paths/paths.qdocconf)
-
-sourcedirs += .
-sourcedirs += includes
diff --git a/tests/auto/qdoc/config/testdata/configs/vars.qdocconf b/tests/auto/qdoc/config/testdata/configs/vars.qdocconf
deleted file mode 100644
index 1f5da6eb8..000000000
--- a/tests/auto/qdoc/config/testdata/configs/vars.qdocconf
+++ /dev/null
@@ -1,17 +0,0 @@
-project = Variables
-
-untrue = false
-true = "Sir Yes, Sir!"
-
-void =
-int = 1
-int += 1
-
-list = \
- testing line \
- "by\n" \
- "line"
-
-some.thing =
-some.where =
-some.time =
diff --git a/tests/auto/qdoc/config/testdata/exampletest/examples/test/empty/test.pro b/tests/auto/qdoc/config/testdata/exampletest/examples/test/empty/test.pro
deleted file mode 100644
index 556df42ea..000000000
--- a/tests/auto/qdoc/config/testdata/exampletest/examples/test/empty/test.pro
+++ /dev/null
@@ -1 +0,0 @@
-# nothing
diff --git a/tests/auto/qdoc/config/testdata/exampletest/examples/test/example1/example1.pro b/tests/auto/qdoc/config/testdata/exampletest/examples/test/example1/example1.pro
deleted file mode 100644
index 556df42ea..000000000
--- a/tests/auto/qdoc/config/testdata/exampletest/examples/test/example1/example1.pro
+++ /dev/null
@@ -1 +0,0 @@
-# nothing
diff --git a/tests/auto/qdoc/config/testdata/exampletest/examples/test/example2/example2.qmlproject b/tests/auto/qdoc/config/testdata/exampletest/examples/test/example2/example2.qmlproject
deleted file mode 100644
index 556df42ea..000000000
--- a/tests/auto/qdoc/config/testdata/exampletest/examples/test/example2/example2.qmlproject
+++ /dev/null
@@ -1 +0,0 @@
-# nothing
diff --git a/tests/auto/qdoc/config/testdata/exampletest/examples/test/example3/example3.pyproject b/tests/auto/qdoc/config/testdata/exampletest/examples/test/example3/example3.pyproject
deleted file mode 100644
index 556df42ea..000000000
--- a/tests/auto/qdoc/config/testdata/exampletest/examples/test/example3/example3.pyproject
+++ /dev/null
@@ -1 +0,0 @@
-# nothing
diff --git a/tests/auto/qdoc/config/testdata/exampletest/examples/test/example4/CMakeLists.txt b/tests/auto/qdoc/config/testdata/exampletest/examples/test/example4/CMakeLists.txt
deleted file mode 100644
index 556df42ea..000000000
--- a/tests/auto/qdoc/config/testdata/exampletest/examples/test/example4/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-# nothing
diff --git a/tests/auto/qdoc/config/testdata/includepaths/include/framework/ignore.h b/tests/auto/qdoc/config/testdata/includepaths/include/framework/ignore.h
deleted file mode 100644
index b2a4ba591..000000000
--- a/tests/auto/qdoc/config/testdata/includepaths/include/framework/ignore.h
+++ /dev/null
@@ -1 +0,0 @@
-# nothing here
diff --git a/tests/auto/qdoc/config/testdata/includepaths/include/more/ignore.h b/tests/auto/qdoc/config/testdata/includepaths/include/more/ignore.h
deleted file mode 100644
index b2a4ba591..000000000
--- a/tests/auto/qdoc/config/testdata/includepaths/include/more/ignore.h
+++ /dev/null
@@ -1 +0,0 @@
-# nothing here
diff --git a/tests/auto/qdoc/config/testdata/includepaths/include/purpose.h b/tests/auto/qdoc/config/testdata/includepaths/include/purpose.h
deleted file mode 100644
index 0f7af352b..000000000
--- a/tests/auto/qdoc/config/testdata/includepaths/include/purpose.h
+++ /dev/null
@@ -1 +0,0 @@
-#define PURPOSE "Pass butter"
diff --git a/tests/auto/qdoc/config/testdata/includepaths/include/system/ignore.h b/tests/auto/qdoc/config/testdata/includepaths/include/system/ignore.h
deleted file mode 100644
index b2a4ba591..000000000
--- a/tests/auto/qdoc/config/testdata/includepaths/include/system/ignore.h
+++ /dev/null
@@ -1 +0,0 @@
-# nothing here
diff --git a/tests/auto/qdoc/config/testdata/includepaths/includepaths.qdocconf b/tests/auto/qdoc/config/testdata/includepaths/includepaths.qdocconf
deleted file mode 100644
index 6288c4258..000000000
--- a/tests/auto/qdoc/config/testdata/includepaths/includepaths.qdocconf
+++ /dev/null
@@ -1,16 +0,0 @@
-includepaths = -I./include
-
-# without prefix but same path, should be identical
-# (Config should not remove duplicates)
-includepaths += include
-
-# space between prefix and path - incorrect but we allow it
-includepaths += -I include/more
-
-# system paths and framework paths
-includepaths += \
- -F./include/framework \
- -isysteminclude/system
-
-# nonexistent paths are to be ignored
-includepaths += invalid
diff --git a/tests/auto/qdoc/config/testdata/paths/includes/test.qdoc b/tests/auto/qdoc/config/testdata/paths/includes/test.qdoc
deleted file mode 100644
index 700f1e819..000000000
--- a/tests/auto/qdoc/config/testdata/paths/includes/test.qdoc
+++ /dev/null
@@ -1 +0,0 @@
-/*! nothing here */
diff --git a/tests/auto/qdoc/config/testdata/paths/paths.qdocconf b/tests/auto/qdoc/config/testdata/paths/paths.qdocconf
deleted file mode 100644
index d360f4c1e..000000000
--- a/tests/auto/qdoc/config/testdata/paths/paths.qdocconf
+++ /dev/null
@@ -1,2 +0,0 @@
-sourcedirs += does/not/exist
-sourcedirs = includes
diff --git a/tests/auto/qdoc/config/tst_config.cpp b/tests/auto/qdoc/config/tst_config.cpp
deleted file mode 100644
index dddfd0878..000000000
--- a/tests/auto/qdoc/config/tst_config.cpp
+++ /dev/null
@@ -1,205 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 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 "config.h"
-
-#include <QtCore/qdir.h>
-#include <QtCore/qfileinfo.h>
-#include <QtCore/qhash.h>
-#include <QtCore/qstringlist.h>
-#include <QtTest/QtTest>
-
-class tst_Config : public QObject
-{
- Q_OBJECT
-
-private slots:
- void classMembersInitializeToFalseOrEmpty();
- void includePathsFromCommandLine();
- void variables();
- void paths();
- void includepaths();
- void getExampleProjectFile();
- void expandVars();
-
-private:
- Config &initConfig(const QStringList &args = QStringList(),
- const char *qdocconf = nullptr);
- Config &initConfig(const char *qdocconf)
- {
- return initConfig(QStringList(), qdocconf);
- }
-};
-
-/*
- Initializes the Config with optional arguments and a .qdocconf file
- to load, and returns a reference to it.
-*/
-Config &tst_Config::initConfig(const QStringList &args, const char *qdocconf)
-{
- QStringList fullArgs = { QStringLiteral("./qdoc") };
- fullArgs << args;
- Config::instance().init("QDoc Test", fullArgs);
-
- if (qdocconf) {
- const auto configFile = QFINDTESTDATA(qdocconf);
- if (!configFile.isEmpty())
- Config::instance().load(configFile);
- }
-
- return Config::instance();
-}
-
-void tst_Config::classMembersInitializeToFalseOrEmpty()
-{
- auto &config = initConfig();
- QCOMPARE(config.showInternal(), false);
- QCOMPARE(config.singleExec(), false);
-
- QVERIFY(config.defines().isEmpty());
- QVERIFY(config.includePaths().isEmpty());
- QVERIFY(config.dependModules().isEmpty());
- QVERIFY(config.indexDirs().isEmpty());
- QVERIFY(config.currentDir().isEmpty());
- QVERIFY(config.previousCurrentDir().isEmpty());
-}
-
-void tst_Config::includePathsFromCommandLine()
-{
- const auto mockIncludePath1 = QString("-I" + QDir().absoluteFilePath("/qt5/qtdoc/doc/."));
- const auto mockIncludePath2 = QString("-I" + QDir().absoluteFilePath("/qt5/qtbase/mkspecs/linux-g++"));
- const QStringList commandLineArgs = { mockIncludePath1, mockIncludePath2 };
- auto &config = initConfig(commandLineArgs);
-
- const QStringList expected = { mockIncludePath1, mockIncludePath2 };
- const QStringList actual = config.includePaths();
-
- QCOMPARE(actual, expected);
-}
-
-// Tests different types of variables; string, string list, bool, int,
-// empty and undefined variables, and subvariables.
-void tst_Config::variables()
-{
- auto &config = initConfig("/testdata/configs/vars.qdocconf");
-
- const QStringList list = { "testing", "line", "by\n", "line" };
- QCOMPARE(config.getStringList("list"), list);
- QCOMPARE(config.getString("list"), "testing line by\nline");
- QCOMPARE(config.getBool("true"), true);
- QCOMPARE(config.getBool("untrue"), false);
- QCOMPARE(config.getInt("int"), 2);
- QCOMPARE(config.getString("void"), QString());
- QVERIFY(!config.getString("void").isNull());
- QCOMPARE(config.getString("void", "undefined"), QString());
- QCOMPARE(config.getString("undefined", "undefined"), "undefined");
- QVERIFY(config.getString("undefined").isNull());
-
- QSet<QString> subVars = { "thing", "where", "time" };
- QCOMPARE(config.subVars("some"), subVars);
-}
-
-// Tests whether paths or variables are resolved correctly.
-void tst_Config::paths()
-{
- auto &config = initConfig();
- const auto docConfig = QFINDTESTDATA("/testdata/configs/paths.qdocconf");
- if (!docConfig.isEmpty())
- config.load(docConfig);
-
- auto rootDir = QFileInfo(docConfig).dir();
- QVERIFY(rootDir.cdUp());
-
- const auto paths = config.getCanonicalPathList("sourcedirs");
- QVERIFY(paths.size() == 3);
-
- QCOMPARE(paths[0], rootDir.absoluteFilePath("paths/includes"));
- QCOMPARE(paths[1], rootDir.absoluteFilePath("configs"));
- QCOMPARE(paths[2], rootDir.absoluteFilePath("configs/includes"));
-}
-
-// Tests whether includepaths are resolved correctly
-void tst_Config::includepaths()
-{
- auto &config = initConfig();
- const auto docConfig = QFINDTESTDATA("/testdata/configs/includepaths.qdocconf");
- if (!docConfig.isEmpty())
- config.load(docConfig);
-
- auto rootDir = QFileInfo(docConfig).dir();
- QVERIFY(rootDir.cdUp());
-
- const auto paths = config.getCanonicalPathList("includepaths",
- Config::IncludePaths);
- QVERIFY(paths.size() == 5);
-
- QCOMPARE(paths[0], "-I" + rootDir.absoluteFilePath("includepaths/include"));
- QCOMPARE(paths[0], paths[1]);
- QCOMPARE(paths[2], "-I" + rootDir.absoluteFilePath("includepaths/include/more"));
- QCOMPARE(paths[3], "-F" + rootDir.absoluteFilePath("includepaths/include/framework"));
- QCOMPARE(paths[4], "-isystem" + rootDir.absoluteFilePath("includepaths/include/system"));
-}
-
-void::tst_Config::getExampleProjectFile()
-{
- auto &config = initConfig();
- const auto docConfig = QFINDTESTDATA("/testdata/configs/exampletest.qdocconf");
- if (!docConfig.isEmpty())
- config.load(docConfig);
-
- auto rootDir = QFileInfo(docConfig).dir();
- QVERIFY(rootDir.cd("../exampletest/examples/test"));
-
- QVERIFY(config.getExampleProjectFile("invalid").isEmpty());
- QVERIFY(config.getExampleProjectFile("test/empty").isEmpty());
-
- QCOMPARE(config.getExampleProjectFile("test/example1"),
- rootDir.absoluteFilePath("example1/example1.pro"));
- QCOMPARE(config.getExampleProjectFile("test/example2"),
- rootDir.absoluteFilePath("example2/example2.qmlproject"));
- QCOMPARE(config.getExampleProjectFile("test/example3"),
- rootDir.absoluteFilePath("example3/example3.pyproject"));
- QCOMPARE(config.getExampleProjectFile("test/example4"),
- rootDir.absoluteFilePath("example4/CMakeLists.txt"));
-}
-
-void::tst_Config::expandVars()
-{
- qputenv("QDOC_TSTCONFIG_LIST", QByteArray("a b c"));
- auto &config = initConfig("/testdata/configs/expandvars.qdocconf");
-
- QCOMPARE(config.getString("expanded1"), "foo");
- QCOMPARE(config.getString("expanded2"), "foo,bar");
- QCOMPARE(config.getString("expanded3"), "foobar foobar baz");
- QCOMPARE(config.getString("literally"), "$data ${data}");
- QCOMPARE(config.getString("csvlist"), "a,b,c");
-}
-
-QTEST_APPLESS_MAIN(tst_Config)
-
-#include "tst_config.moc"