summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativelanguage
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-10-08 03:47:17 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-10-08 03:50:01 (GMT)
commitc4cbd04275906b1bfa1a55147a0a4bb626033a20 (patch)
tree0689a5f311bc3f6d7d48300cd6a7859b6a166239 /tests/auto/declarative/qdeclarativelanguage
parent5447a9590dc0efa1a79fde6235fdcf76d3ae81fe (diff)
downloadQt-c4cbd04275906b1bfa1a55147a0a4bb626033a20.zip
Qt-c4cbd04275906b1bfa1a55147a0a4bb626033a20.tar.gz
Qt-c4cbd04275906b1bfa1a55147a0a4bb626033a20.tar.bz2
Check plugin and QML file case on Mac and Windows
This test should prevent the case where a QML app that is developed on a case insensitive filesystem (like on Mac or Windows) and then run on a case sensitive filesystem (like on Linux) fails to find module plugins, imports and QML files. Task-number: QTBUG-13517
Diffstat (limited to 'tests/auto/declarative/qdeclarativelanguage')
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp24
6 files changed, 40 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml b/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml
new file mode 100644
index 0000000..247f527
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+import com.Nokia.installedtest 1.0
+
+QtObject {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt
new file mode 100644
index 0000000..3813680
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt
@@ -0,0 +1,2 @@
+3:1:Type IncorrectCaseType unavailable
+-1:-1:File name case mismatch
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt
new file mode 100644
index 0000000..abed1a7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt
@@ -0,0 +1 @@
+3:1:IncorrectCaseType is not a type
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml
new file mode 100644
index 0000000..d11000b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+IncorrectCaseType {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml
new file mode 100644
index 0000000..cf32b45
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+QtObject {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index bb1312b..2aac27e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -144,6 +144,7 @@ private slots:
void importsInstalled();
void importsOrder_data();
void importsOrder();
+ void importIncorrectCase();
void qmlAttachedPropertiesObjectMethod();
void customOnProperty();
@@ -382,6 +383,13 @@ void tst_qdeclarativelanguage::errors_data()
QTest::newRow("notAvailable") << "notAvailable.qml" << "notAvailable.errors.txt" << false;
QTest::newRow("singularProperty") << "singularProperty.qml" << "singularProperty.errors.txt" << false;
QTest::newRow("singularProperty.2") << "singularProperty.2.qml" << "singularProperty.2.errors.txt" << false;
+ QTest::newRow("incorrectCase") << "incorrectCase.qml"
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
+ << "incorrectCase.errors.insensitive.txt"
+#else
+ << "incorrectCase.errors.sensitive.txt"
+#endif
+ << false;
}
@@ -1724,6 +1732,22 @@ void tst_qdeclarativelanguage::importsOrder()
testType(qml,type,error);
}
+void tst_qdeclarativelanguage::importIncorrectCase()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("importIncorrectCase.qml"));
+
+ QList<QDeclarativeError> errors = component.errors();
+ QCOMPARE(errors.count(), 1);
+
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
+ QString expectedError = QLatin1String("cannot load module \"com.Nokia.installedtest\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("data/lib/com/Nokia/installedtest/qmldir") + QLatin1String("\"");
+#else
+ QString expectedError = QLatin1String("module \"com.Nokia.installedtest\" is not installed");
+#endif
+
+ QCOMPARE(errors.at(0).description(), expectedError);
+}
+
void tst_qdeclarativelanguage::qmlAttachedPropertiesObjectMethod()
{
QObject object;