summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAlan Alpert <416365416c@gmail.com>2013-09-13 13:57:21 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-15 06:36:44 +0100
commit7d72516b52b20b0782d972224a55a43e74b8ae5a (patch)
tree4e42237bfca0a0947bae04203e6c602e20ecddfb /tests/auto
parent63824d2e00de53ae61158547ad01e97038160137 (diff)
Change platform selectors to match qmake selectors
Previously matched Qt.platform.os, however that can only provide one string. Multiple selectors can be present at once, so we can provide both unix and linux instead of having to pick the most specialized one. Task-number: QTBUG-34796 Change-Id: I219517d740fa7385e923a9e09cb7e241378fbaee Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+android/test2 (renamed from tests/auto/corelib/io/qfileselector/platforms/+generic_unix/test)0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+blackberry/test20
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+ios/test20
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+linux/test20
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+mac/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+mac/test20
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+unix/+android/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+unix/+blackberry/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+unix/+ios/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+unix/+linux/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+unix/+mac/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+unix/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+wince/test20
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+windows/+wince/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+windows/test20
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/test20
-rw-r--r--tests/auto/corelib/io/qfileselector/qfileselector.qrc22
-rw-r--r--tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp30
18 files changed, 45 insertions, 7 deletions
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+generic_unix/test b/tests/auto/corelib/io/qfileselector/platforms/+android/test2
index e69de29bb2..e69de29bb2 100644
--- a/tests/auto/corelib/io/qfileselector/platforms/+generic_unix/test
+++ b/tests/auto/corelib/io/qfileselector/platforms/+android/test2
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+blackberry/test2 b/tests/auto/corelib/io/qfileselector/platforms/+blackberry/test2
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+blackberry/test2
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+ios/test2 b/tests/auto/corelib/io/qfileselector/platforms/+ios/test2
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+ios/test2
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+linux/test2 b/tests/auto/corelib/io/qfileselector/platforms/+linux/test2
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+linux/test2
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+mac/test b/tests/auto/corelib/io/qfileselector/platforms/+mac/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+mac/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+mac/test2 b/tests/auto/corelib/io/qfileselector/platforms/+mac/test2
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+mac/test2
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+android/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+android/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+unix/+android/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+blackberry/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+blackberry/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+unix/+blackberry/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+ios/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+ios/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+unix/+ios/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+linux/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+linux/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+unix/+linux/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+mac/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+mac/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+unix/+mac/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+unix/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+wince/test2 b/tests/auto/corelib/io/qfileselector/platforms/+wince/test2
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+wince/test2
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+windows/+wince/test b/tests/auto/corelib/io/qfileselector/platforms/+windows/+wince/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+windows/+wince/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+windows/test2 b/tests/auto/corelib/io/qfileselector/platforms/+windows/test2
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+windows/test2
diff --git a/tests/auto/corelib/io/qfileselector/platforms/test2 b/tests/auto/corelib/io/qfileselector/platforms/test2
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/test2
diff --git a/tests/auto/corelib/io/qfileselector/qfileselector.qrc b/tests/auto/corelib/io/qfileselector/qfileselector.qrc
index c644e41107..abfead2a55 100644
--- a/tests/auto/corelib/io/qfileselector/qfileselector.qrc
+++ b/tests/auto/corelib/io/qfileselector/qfileselector.qrc
@@ -11,13 +11,27 @@
<file>extras/+custom3/+custom5/test</file>
<file>extras/+custom5/+custom3/test</file>
<file>platforms/test</file>
+ <file>platforms/+unix/+android/test</file>
+ <file>platforms/+unix/+blackberry/test</file>
+ <file>platforms/+unix/+ios/test</file>
+ <file>platforms/+unix/+mac/test</file>
+ <file>platforms/+windows/+wince/test</file>
+ <file>platforms/+windows/test</file>
+ <file>platforms/+windows/test2</file>
+ <file>platforms/+unix/+linux/test</file>
+ <file>platforms/+unix/test</file>
+ <file>platforms/test2</file>
+ <file>platforms/+android/test2</file>
+ <file>platforms/+blackberry/test2</file>
+ <file>platforms/+ios/test2</file>
+ <file>platforms/+mac/test2</file>
+ <file>platforms/+linux/test2</file>
+ <file>platforms/+wince/test2</file>
<file>platforms/+android/test</file>
<file>platforms/+blackberry/test</file>
<file>platforms/+ios/test</file>
- <file>platforms/+osx/test</file>
- <file>platforms/+wince/test</file>
- <file>platforms/+windows/test</file>
+ <file>platforms/+mac/test</file>
<file>platforms/+linux/test</file>
- <file>platforms/+generic_unix/test</file>
+ <file>platforms/+wince/test</file>
</qresource>
</RCC>
diff --git a/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp b/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
index 2baebd0296..d6461c3aba 100644
--- a/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
+++ b/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
@@ -91,9 +91,33 @@ void tst_QFileSelector::basicTest_data()
QTest::addColumn<QString>("expectedPath");
QString test("/test");// '/' is here so dir string can also be selector string
- QTest::newRow("platform") << QString(":/platforms/test") << QStringList()
- << QString(":/platforms/") + QLatin1Char(selectorIndicator)
- + QFileSelectorPrivate::platformSelectors().first() + test;
+ QString test2("/test2");
+ QString expectedPlatform1File(":/platforms");
+ QString expectedPlatform2File(""); //Only the last selector
+#if defined(Q_OS_UNIX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_BLACKBERRY) && !defined(Q_OS_IOS) && !defined(Q_OS_LINUX) && !defined(Q_OS_MAC)
+ /* We are only aware of specific unixes, and do not have test files for any of the others.
+ However those unixes can get a selector added from the result of a uname call, so this will
+ lead to a case where we don't have that file so we can't expect the concatenation of platform
+ selectors to work. It should just find the +unix/test file.*/
+ expectedPlatform1File = QString(":/platforms/") + QLatin1Char(selectorIndicator)
+ + QString("unix/test");
+ expectedPlatform2File = QString(":/platforms/test2");
+#else
+ foreach (const QString &selector, QFileSelectorPrivate::platformSelectors()) {
+ expectedPlatform1File = expectedPlatform1File + QLatin1Char('/') + QLatin1Char(selectorIndicator)
+ + selector;
+ expectedPlatform2File = selector;
+ }
+ expectedPlatform1File += test;
+ expectedPlatform2File = QLatin1String(":/platforms/") + QLatin1Char(selectorIndicator)
+ + expectedPlatform2File + test2;
+#endif
+
+ QTest::newRow("platform1") << QString(":/platforms/test") << QStringList()
+ << expectedPlatform1File;
+
+ QTest::newRow("platform2") << QString(":/platforms/test2") << QStringList()
+ << expectedPlatform2File;
QString resourceTestPath(":/extras/test");
QString custom1("custom1");