From a2a524856d209dab92a78d25725ef09284aa3a07 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 20 Feb 2010 09:24:00 +0100 Subject: Autotest: make the licenseCheck test also check .qdoc files --- tests/auto/headers/tst_headers.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); -- cgit v0.12