summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <qt-info@nokia.com>2009-09-21 12:44:08 (GMT)
committerAndy Shaw <qt-info@nokia.com>2009-09-21 12:44:08 (GMT)
commita9ee5b5dc3d0afc6ef522d60f68e1eb4ea7308b5 (patch)
treea05bc9f150edb5d7f24109d81801a44c6f54485a
parent3bc60c59bf967425afb9b2ef891b5c701a4f1f86 (diff)
parentd8cf39e05f3a608c122f546dc4e677d4ce68cb36 (diff)
downloadQt-a9ee5b5dc3d0afc6ef522d60f68e1eb4ea7308b5.zip
Qt-a9ee5b5dc3d0afc6ef522d60f68e1eb4ea7308b5.tar.gz
Qt-a9ee5b5dc3d0afc6ef522d60f68e1eb4ea7308b5.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
-rw-r--r--tests/auto/headers/tst_headers.cpp76
-rw-r--r--util/qlalr/compress.h2
-rw-r--r--util/qlalr/cppgenerator.cpp2
-rw-r--r--util/qlalr/cppgenerator.h2
-rw-r--r--util/qlalr/dotgraph.h2
-rw-r--r--util/qlalr/grammar_p.h2
-rw-r--r--util/qlalr/lalr.h2
-rw-r--r--util/qlalr/parsetable.h2
-rw-r--r--util/qlalr/recognizer.h2
9 files changed, 60 insertions, 32 deletions
diff --git a/tests/auto/headers/tst_headers.cpp b/tests/auto/headers/tst_headers.cpp
index 1b28648..d4f2ff4 100644
--- a/tests/auto/headers/tst_headers.cpp
+++ b/tests/auto/headers/tst_headers.cpp
@@ -132,23 +132,36 @@ void tst_Headers::allSourceFilesData()
{
QTest::addColumn<QString>("sourceFile");
- const QStringList sourceFiles(getSourceFiles(qtSrcDir));
+ QStringList sourceFiles;
+ static char const * const subdirs[] = {
+ "/config.tests",
+ "/demos",
+ "/doc",
+ "/examples",
+ "/mkspecs",
+ "/qmake",
+ "/src",
+ "/tests",
+ "/tools",
+ "/util"
+ };
+
+ for (int i = 0; i < sizeof(subdirs) / sizeof(subdirs[0]); ++i) {
+ sourceFiles << getSourceFiles(qtSrcDir + subdirs[i]);
+ sourceFiles << getHeaders(qtSrcDir + subdirs[i]);
+ }
foreach (QString sourceFile, sourceFiles) {
if (sourceFile.contains("/3rdparty/")
- || sourceFile.contains("/config.tests/")
- || sourceFile.contains("/snippets/")
- || sourceFile.contains("linguist/lupdate/testdata")
- || sourceFile.contains("testdata/bundle-spaces/main.cpp")
- || sourceFile.contains("demos/embedded/fluidlauncher/pictureflow.cpp")
- || sourceFile.contains("tools/porting/src/")
- || sourceFile.contains("/fulltextsearch/"))
- continue;
-
- // This test is crude, but if a file contains this string, we skip it.
- QFile file(sourceFile);
- QVERIFY(file.open(QIODevice::ReadOnly));
- if (file.readAll().contains("This file was generated by"))
+ || sourceFile.contains("/tests/auto/qmake/testdata/bundle-spaces/main.cpp")
+ || sourceFile.contains("/demos/embedded/fluidlauncher/pictureflow.cpp")
+ || sourceFile.contains("/tools/porting/src/")
+ || sourceFile.contains("/tools/assistant/lib/fulltextsearch/")
+ || sourceFile.endsWith("_pch.h.cpp")
+ || sourceFile.endsWith(".ui.h")
+ || sourceFile.endsWith("/src/corelib/global/qconfig.h")
+ || sourceFile.endsWith("/src/corelib/global/qconfig.cpp")
+ || sourceFile.endsWith("/src/tools/uic/qclass_lib_map.h"))
continue;
QTest::newRow(qPrintable(sourceFile)) << sourceFile;
@@ -163,7 +176,7 @@ void tst_Headers::allHeadersData()
QSKIP("can't find any headers in your $QTDIR/src", SkipAll);
foreach (QString hdr, headers) {
- if (hdr.contains("/3rdparty/") || hdr.endsWith("/qclass_lib_map.h"))
+ if (hdr.contains("/3rdparty/") || hdr.endsWith("/src/tools/uic/qclass_lib_map.h"))
continue;
QTest::newRow(qPrintable(hdr)) << hdr;
@@ -174,18 +187,26 @@ void tst_Headers::licenseCheck()
{
QFETCH(QString, sourceFile);
- if (sourceFile.endsWith("/qgifhandler.h")
- || sourceFile.endsWith("/qconfig.h")
- || sourceFile.endsWith("/qconfig.cpp"))
- return;
-
QFile f(sourceFile);
QVERIFY(f.open(QIODevice::ReadOnly));
QByteArray data = f.readAll();
- QStringList content = QString::fromLocal8Bit(data.replace('\r',"")).split("\n");
+ data.replace("\r\n", "\n"); // Windows
+ data.replace('\r', '\n'); // Mac OS9
+ QStringList content = QString::fromLocal8Bit(data).split("\n");
- if (content.first().contains("generated"))
+ if (content.first().contains("generated")) {
content.takeFirst();
+ if (content.first().isEmpty())
+ content.takeFirst();
+ }
+
+ if (sourceFile.endsWith("/tests/auto/linguist/lupdate/testdata/good/merge_ordering/foo.cpp")
+ || sourceFile.endsWith("/tests/auto/linguist/lupdate/testdata/good/mergecpp/finddialog.cpp"))
+ {
+ // These files are meant to start with empty lines.
+ while (content.first().isEmpty() || content.first().startsWith("//"))
+ content.takeFirst();
+ }
QVERIFY(licensePattern.exactMatch(content.value(8)) ||
licensePattern.exactMatch(content.value(5)));
@@ -196,8 +217,15 @@ void tst_Headers::licenseCheck()
QCOMPARE(content.at(i++), QString("/****************************************************************************"));
if (licenseType != "3RDPARTY") {
QCOMPARE(content.at(i++), QString("**"));
- // QVERIFY(copyrightPattern.exactMatch(content.at(i++)));
- i++;
+ if (sourceFile.endsWith("/tests/auto/qabstractitemmodel/dynamictreemodel.cpp")
+ || sourceFile.endsWith("/tests/auto/qabstractitemmodel/dynamictreemodel.h")
+ || sourceFile.endsWith("/src/network/kernel/qnetworkproxy_p.h"))
+ {
+ // These files are not copyrighted by Nokia.
+ ++i;
+ } else {
+ QVERIFY(copyrightPattern.exactMatch(content.at(i++)));
+ }
i++;
QCOMPARE(content.at(i++), QString("** Contact: Nokia Corporation (qt-info@nokia.com)"));
}
diff --git a/util/qlalr/compress.h b/util/qlalr/compress.h
index 5619afc..bf779cc 100644
--- a/util/qlalr/compress.h
+++ b/util/qlalr/compress.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QLALR project on Qt Labs.
+** This file is part of the utils of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/util/qlalr/cppgenerator.cpp b/util/qlalr/cppgenerator.cpp
index dfe3ff2..dd5be57 100644
--- a/util/qlalr/cppgenerator.cpp
+++ b/util/qlalr/cppgenerator.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QLALR project on Qt Labs.
+** This file is part of the utils of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/util/qlalr/cppgenerator.h b/util/qlalr/cppgenerator.h
index 64d1924..e36e8c0 100644
--- a/util/qlalr/cppgenerator.h
+++ b/util/qlalr/cppgenerator.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QLALR project on Qt Labs.
+** This file is part of the utils of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/util/qlalr/dotgraph.h b/util/qlalr/dotgraph.h
index df4d216..9a71769 100644
--- a/util/qlalr/dotgraph.h
+++ b/util/qlalr/dotgraph.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QLALR project on Qt Labs.
+** This file is part of the utils of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/util/qlalr/grammar_p.h b/util/qlalr/grammar_p.h
index 3f0c0d0..1794fe5 100644
--- a/util/qlalr/grammar_p.h
+++ b/util/qlalr/grammar_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QLALR project on Qt Labs.
+** This file is part of the utils of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/util/qlalr/lalr.h b/util/qlalr/lalr.h
index 7d7c692..1dd843f 100644
--- a/util/qlalr/lalr.h
+++ b/util/qlalr/lalr.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QLALR project on Qt Labs.
+** This file is part of the utils of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/util/qlalr/parsetable.h b/util/qlalr/parsetable.h
index f2cd264..6d5490a 100644
--- a/util/qlalr/parsetable.h
+++ b/util/qlalr/parsetable.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QLALR project on Qt Labs.
+** This file is part of the utils of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/util/qlalr/recognizer.h b/util/qlalr/recognizer.h
index fdc6448..667517e 100644
--- a/util/qlalr/recognizer.h
+++ b/util/qlalr/recognizer.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QLALR project on Qt Labs.
+** This file is part of the utils of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage