Changeset View
Changeset View
Standalone View
Standalone View
autotests/documentdirstest.cpp
- This file was added.
1 | #include <QDebug> | ||||
---|---|---|---|---|---|
2 | #include <QRegularExpression> | ||||
3 | #include <QTest> | ||||
4 | | ||||
5 | #include "../src/docbookxslt.h" | ||||
6 | #include "config-kdoctools.h" | ||||
7 | #include "loggingcategory.h" | ||||
8 | | ||||
9 | using namespace KDocTools; | ||||
10 | | ||||
11 | class documentDirsTest: public QObject | ||||
12 | { | ||||
13 | Q_OBJECT | ||||
14 | private Q_SLOTS: | ||||
15 | void testDirsContent(); | ||||
16 | }; | ||||
17 | | ||||
18 | void documentDirsTest::testDirsContent() | ||||
19 | { | ||||
20 | const QStringList docDirs = documentationDirs(); | ||||
21 | QVERIFY(docDirs.size() >= 1); | ||||
22 | /* DOCBUNDLEDIR (one of its matches) must be the first element */ | ||||
23 | QVERIFY(docDirs[0].indexOf(QRegularExpression(QStringLiteral(KDOCTOOLS_DOCBUNDLEDIR))) >= 0); | ||||
24 | /* Check all the other items that should be there; | ||||
25 | check the last occurrence, as each locateAll can return more items | ||||
26 | and also some of them may match KDOCTOOLS_DOCBUNDLEDIR */ | ||||
27 | int position_dir_doc_HTML = docDirs.lastIndexOf(QRegularExpression(QStringLiteral(".*/doc/HTML$"))); | ||||
28 | QVERIFY(position_dir_doc_HTML >= 0); | ||||
29 | int position_dir_help = docDirs.lastIndexOf(QRegularExpression(QStringLiteral(".*/help$"))); | ||||
30 | QVERIFY(position_dir_help >= 0); | ||||
31 | } | ||||
32 | | ||||
33 | QTEST_MAIN(documentDirsTest) | ||||
34 | #include "documentdirstest.moc" |