summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/tools')
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp15
-rw-r--r--tests/auto/tools/qmake/tst_qmake.cpp2
-rw-r--r--tests/auto/tools/rcc/data/depfile/simple.d.expected1
-rw-r--r--tests/auto/tools/rcc/data/depfile/simple.qrc6
-rw-r--r--tests/auto/tools/rcc/data/depfile/specialchar$file.txt1
-rw-r--r--tests/auto/tools/rcc/data/depfile/specialchar.d.expected1
-rw-r--r--tests/auto/tools/rcc/data/depfile/specialchar.qrc6
-rw-r--r--tests/auto/tools/rcc/tst_rcc.cpp48
-rw-r--r--tests/auto/tools/uic/baseline/dialog.ui2
-rw-r--r--tests/auto/tools/uic/baseline/dialog.ui.h2
10 files changed, 80 insertions, 4 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index ec4a44e672..b88d929ca9 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -149,6 +149,17 @@ namespace TestQNamespace {
Q_FLAG_NS(TestFlag2)
}
+
+#define TESTEXPORTMACRO Q_DECL_EXPORT
+
+namespace TestExportNamespace {
+ Q_NAMESPACE_EXPORT(TESTEXPORTMACRO)
+ enum class MyEnum {
+ Key1, Key2
+ };
+ Q_ENUM_NS(MyEnum)
+}
+
QT_USE_NAMESPACE
template <bool b> struct QTBUG_31218 {};
@@ -3893,6 +3904,10 @@ void tst_Moc::testQNamespace()
QCOMPARE(meta.enclosingMetaObject(), &TestQNamespace::staticMetaObject);
QCOMPARE(meta.keyCount(), 2);
+ QCOMPARE(TestExportNamespace::staticMetaObject.enumeratorCount(), 1);
+ checkEnum(TestExportNamespace::staticMetaObject.enumerator(0), "MyEnum",
+ {{"Key1", 0}, {"Key2", 1}});
+
QCOMPARE(FooNamespace::staticMetaObject.enumeratorCount(), 1);
QCOMPARE(FooNamespace::FooNestedNamespace::staticMetaObject.enumeratorCount(), 2);
QCOMPARE(FooNamespace::FooNestedNamespace::FooMoreNestedNamespace::staticMetaObject.enumeratorCount(), 1);
diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp
index cacee30c86..1df31904d6 100644
--- a/tests/auto/tools/qmake/tst_qmake.cpp
+++ b/tests/auto/tools/qmake/tst_qmake.cpp
@@ -422,7 +422,7 @@ void tst_qmake::prompt()
{
#if 0
QProcess qmake;
- qmake.setReadChannelMode(QProcess::MergedChannels);
+ qmake.setProcessChannelMode(QProcess::MergedChannels);
qmake.setWorkingDirectory(QLatin1String("testdata/prompt"));
qmake.start(QLatin1String("qmake CONFIG-=debug_and_release CONFIG-=debug CONFIG+=release"),
QIODevice::Text | QIODevice::ReadWrite);
diff --git a/tests/auto/tools/rcc/data/depfile/simple.d.expected b/tests/auto/tools/rcc/data/depfile/simple.d.expected
new file mode 100644
index 0000000000..a89b61bdc7
--- /dev/null
+++ b/tests/auto/tools/rcc/data/depfile/simple.d.expected
@@ -0,0 +1 @@
+simple.qrc.cpp: ../images/images/circle.png ../images/images/square.png
diff --git a/tests/auto/tools/rcc/data/depfile/simple.qrc b/tests/auto/tools/rcc/data/depfile/simple.qrc
new file mode 100644
index 0000000000..521dc4d4a0
--- /dev/null
+++ b/tests/auto/tools/rcc/data/depfile/simple.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>../images/images/circle.png</file>
+ <file>../images/images/square.png</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/tools/rcc/data/depfile/specialchar$file.txt b/tests/auto/tools/rcc/data/depfile/specialchar$file.txt
new file mode 100644
index 0000000000..5da849b5c6
--- /dev/null
+++ b/tests/auto/tools/rcc/data/depfile/specialchar$file.txt
@@ -0,0 +1 @@
+ABC
diff --git a/tests/auto/tools/rcc/data/depfile/specialchar.d.expected b/tests/auto/tools/rcc/data/depfile/specialchar.d.expected
new file mode 100644
index 0000000000..9dd1af0958
--- /dev/null
+++ b/tests/auto/tools/rcc/data/depfile/specialchar.d.expected
@@ -0,0 +1 @@
+specialchar.qrc.cpp: specialchar$$file.txt ../images/images/subdir/triangle.png
diff --git a/tests/auto/tools/rcc/data/depfile/specialchar.qrc b/tests/auto/tools/rcc/data/depfile/specialchar.qrc
new file mode 100644
index 0000000000..133cbc7655
--- /dev/null
+++ b/tests/auto/tools/rcc/data/depfile/specialchar.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>../images/images/subdir/triangle.png</file>
+ <file>specialchar$file.txt</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/tools/rcc/tst_rcc.cpp b/tests/auto/tools/rcc/tst_rcc.cpp
index 24fd79cf19..42a4134e5f 100644
--- a/tests/auto/tools/rcc/tst_rcc.cpp
+++ b/tests/auto/tools/rcc/tst_rcc.cpp
@@ -89,6 +89,9 @@ private slots:
void readback_data();
void readback();
+ void depFileGeneration_data();
+ void depFileGeneration();
+
void python();
void cleanupTestCase();
@@ -416,6 +419,49 @@ void tst_rcc::readback()
QCOMPARE(resourceData, fileSystemData);
}
+void tst_rcc::depFileGeneration_data()
+{
+ QTest::addColumn<QString>("qrcfile");
+ QTest::addColumn<QString>("depfile");
+ QTest::addColumn<QString>("expected");
+
+ QTest::newRow("simple") << "simple.qrc" << "simple.d" << "simple.d.expected";
+ QTest::newRow("specialchar") << "specialchar.qrc" << "specialchar.d" << "specialchar.d.expected";
+}
+
+void tst_rcc::depFileGeneration()
+{
+ QFETCH(QString, qrcfile);
+ QFETCH(QString, depfile);
+ QFETCH(QString, expected);
+ const QString directory = m_dataPath + QLatin1String("/depfile");
+
+ QProcess process;
+ process.setWorkingDirectory(directory);
+ process.start(m_rcc, { "-d", depfile, "-o", qrcfile + ".cpp", qrcfile });
+ QVERIFY2(process.waitForStarted(), msgProcessStartFailed(process).constData());
+ if (!process.waitForFinished()) {
+ process.kill();
+ QFAIL(msgProcessTimeout(process).constData());
+ }
+ QVERIFY2(process.exitStatus() == QProcess::NormalExit,
+ msgProcessCrashed(process).constData());
+ QVERIFY2(process.exitCode() == 0,
+ msgProcessFailed(process).constData());
+
+ QFile depFileOutput(directory + QLatin1String("/") + depfile);
+ QVERIFY(depFileOutput.open(QIODevice::ReadOnly | QIODevice::Text));
+ QByteArray depFileData = depFileOutput.readAll();
+ depFileOutput.close();
+
+ QFile depFileExpected(directory + QLatin1String("/") + expected);
+ QVERIFY(depFileExpected.open(QIODevice::ReadOnly | QIODevice::Text));
+ QByteArray expectedData = depFileExpected.readAll();
+ depFileExpected.close();
+
+ QCOMPARE(depFileData, expectedData);
+}
+
void tst_rcc::python()
{
const QString path = m_dataPath + QLatin1String("/sizes");
@@ -450,6 +496,8 @@ void tst_rcc::cleanupTestCase()
{
QDir dataDir(m_dataPath + QLatin1String("/binary"));
QFileInfoList entries = dataDir.entryInfoList(QStringList() << QLatin1String("*.rcc"));
+ QDir dataDepDir(m_dataPath + QLatin1String("/depfile"));
+ entries += dataDepDir.entryInfoList({QLatin1String("*.d"), QLatin1String("*.qrc.cpp")});
foreach (const QFileInfo &entry, entries)
QFile::remove(entry.absoluteFilePath());
}
diff --git a/tests/auto/tools/uic/baseline/dialog.ui b/tests/auto/tools/uic/baseline/dialog.ui
index e99d6fb3c4..936cc2eee8 100644
--- a/tests/auto/tools/uic/baseline/dialog.ui
+++ b/tests/auto/tools/uic/baseline/dialog.ui
@@ -1,4 +1,4 @@
-<ui version="4.0" >
+<ui version="4.0" connectslotsbyname="false">
<class>Dialog</class>
<widget class="QDialog" name="Dialog" >
<property name="geometry" >
diff --git a/tests/auto/tools/uic/baseline/dialog.ui.h b/tests/auto/tools/uic/baseline/dialog.ui.h
index aeed71d058..cd6449873e 100644
--- a/tests/auto/tools/uic/baseline/dialog.ui.h
+++ b/tests/auto/tools/uic/baseline/dialog.ui.h
@@ -52,8 +52,6 @@ public:
retranslateUi(Dialog);
-
- QMetaObject::connectSlotsByName(Dialog);
} // setupUi
void retranslateUi(QDialog *Dialog)