summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-05-24 03:09:43 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-05-24 03:09:43 (GMT)
commitff27b0e6a7161db17335dc4aa8724cae75cec39c (patch)
treee6fe4b5938c3a4a40c66301b16794d0b16c4e5f9
parentce63c369d7d4c96c202fbc81443e1d44d82e4de0 (diff)
downloadQt-ff27b0e6a7161db17335dc4aa8724cae75cec39c.zip
Qt-ff27b0e6a7161db17335dc4aa8724cae75cec39c.tar.gz
Qt-ff27b0e6a7161db17335dc4aa8724cae75cec39c.tar.bz2
Check QML files for license headers too.
(but not test data - no test data has license headers)
-rw-r--r--tests/auto/headers/tst_headers.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/auto/headers/tst_headers.cpp b/tests/auto/headers/tst_headers.cpp
index 12c5843..0538607 100644
--- a/tests/auto/headers/tst_headers.cpp
+++ b/tests/auto/headers/tst_headers.cpp
@@ -64,7 +64,8 @@ private:
const QStringList dirFilters,
const QRegExp &exclude);
static QStringList getHeaders(const QString &path);
- static QStringList getSourceFiles(const QString &path);
+ static QStringList getQmlFiles(const QString &path);
+ static QStringList getCppFiles(const QString &path);
static QStringList getQDocFiles(const QString &path);
void allSourceFilesData();
@@ -107,11 +108,16 @@ QStringList tst_Headers::getHeaders(const QString &path)
return getFiles(path, QStringList("*.h"), QRegExp("^(?!ui_)"));
}
-QStringList tst_Headers::getSourceFiles(const QString &path)
+QStringList tst_Headers::getCppFiles(const QString &path)
{
return getFiles(path, QStringList("*.cpp"), QRegExp("^(?!(moc_|qrc_))"));
}
+QStringList tst_Headers::getQmlFiles(const QString &path)
+{
+ return getFiles(path, QStringList("*.qml"), QRegExp("."));
+}
+
QStringList tst_Headers::getQDocFiles(const QString &path)
{
return getFiles(path, QStringList("*.qdoc"), QRegExp("."));
@@ -153,7 +159,9 @@ void tst_Headers::allSourceFilesData()
};
for (int i = 0; i < sizeof(subdirs) / sizeof(subdirs[0]); ++i) {
- sourceFiles << getSourceFiles(qtSrcDir + subdirs[i]);
+ sourceFiles << getCppFiles(qtSrcDir + subdirs[i]);
+ if (subdirs[i] != QLatin1String("/tests"))
+ sourceFiles << getQmlFiles(qtSrcDir + subdirs[i]);
sourceFiles << getHeaders(qtSrcDir + subdirs[i]);
sourceFiles << getQDocFiles(qtSrcDir + subdirs[i]);
}