diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-20 08:24:00 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-20 08:24:00 (GMT) |
commit | a2a524856d209dab92a78d25725ef09284aa3a07 (patch) | |
tree | 635f534a0cb6b55bc093f455eb72c6e2d5c0f2ae /tests | |
parent | 30b45ba2b11342a9e7cc06b68237b68a68955213 (diff) | |
download | Qt-a2a524856d209dab92a78d25725ef09284aa3a07.zip Qt-a2a524856d209dab92a78d25725ef09284aa3a07.tar.gz Qt-a2a524856d209dab92a78d25725ef09284aa3a07.tar.bz2 |
Autotest: make the licenseCheck test also check .qdoc files
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/headers/tst_headers.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/headers/tst_headers.cpp b/tests/auto/headers/tst_headers.cpp index bf7ec3f..3745767 100644 --- a/tests/auto/headers/tst_headers.cpp +++ b/tests/auto/headers/tst_headers.cpp @@ -65,6 +65,7 @@ private: const QRegExp &exclude); static QStringList getHeaders(const QString &path); static QStringList getSourceFiles(const QString &path); + static QStringList getQDocFiles(const QString &path); void allSourceFilesData(); void allHeadersData(); @@ -111,6 +112,11 @@ QStringList tst_Headers::getSourceFiles(const QString &path) return getFiles(path, QStringList("*.cpp"), QRegExp("^(?!(moc_|qrc_))")); } +QStringList tst_Headers::getQDocFiles(const QString &path) +{ + return getFiles(path, QStringList("*.qdoc"), QRegExp(".")); +} + void tst_Headers::initTestCase() { qtSrcDir = QString::fromLocal8Bit(qgetenv("QTSRCDIR").isEmpty() @@ -149,6 +155,7 @@ void tst_Headers::allSourceFilesData() for (int i = 0; i < sizeof(subdirs) / sizeof(subdirs[0]); ++i) { sourceFiles << getSourceFiles(qtSrcDir + subdirs[i]); sourceFiles << getHeaders(qtSrcDir + subdirs[i]); + sourceFiles << getQDocFiles(qtSrcDir + subdirs[i]); } foreach (QString sourceFile, sourceFiles) { @@ -209,6 +216,11 @@ void tst_Headers::licenseCheck() content.takeFirst(); } + if (sourceFile.endsWith("/doc/src/classes/phonon-api.qdoc")) { + // This is an external file + return; + } + QVERIFY(licensePattern.exactMatch(content.value(8)) || licensePattern.exactMatch(content.value(5))); QString licenseType = licensePattern.cap(1); |