aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2014-01-08 09:05:53 -0500
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-01-09 15:59:14 +0100
commit90c05134c795391b4af72837462948d67a9507ec (patch)
tree93f4bdea608d82c6691e91e418e6680d8773a604 /tests/auto
parent4b9ce244fe215468f2fce11ce6ea029e983a1ed7 (diff)
Add support for embedding Info.plist into unbundled executable products.
Task-number: QBS-468 Change-Id: I0b2cbb1b0aba3f73baf17d703eac5ecb687f54a0 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/blackbox/testdata/embedInfoPlist/embedInfoPlist.qbs13
-rw-r--r--tests/auto/blackbox/testdata/embedInfoPlist/main.m9
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp16
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
4 files changed, 39 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/embedInfoPlist/embedInfoPlist.qbs b/tests/auto/blackbox/testdata/embedInfoPlist/embedInfoPlist.qbs
new file mode 100644
index 000000000..32f7f7292
--- /dev/null
+++ b/tests/auto/blackbox/testdata/embedInfoPlist/embedInfoPlist.qbs
@@ -0,0 +1,13 @@
+import qbs
+
+CppApplication {
+ condition: qbs.targetOS.contains("darwin")
+ type: ["application"]
+ files: ["main.m"]
+ cpp.frameworks: ["Foundation"]
+ cpp.infoPlist: {
+ return {
+ "QBS": "org.qt-project.qbs.testdata.embedInfoPlist"
+ };
+ }
+}
diff --git a/tests/auto/blackbox/testdata/embedInfoPlist/main.m b/tests/auto/blackbox/testdata/embedInfoPlist/main.m
new file mode 100644
index 000000000..b3f362223
--- /dev/null
+++ b/tests/auto/blackbox/testdata/embedInfoPlist/main.m
@@ -0,0 +1,9 @@
+#import <Foundation/Foundation.h>
+
+int main()
+{
+ NSDictionary *infoPlist = [[NSBundle mainBundle] infoDictionary];
+ BOOL success = [[infoPlist objectForKey:@"QBS"] isEqualToString:@"org.qt-project.qbs.testdata.embedInfoPlist"];
+ fprintf(success ? stdout : stderr, "%s\n", [[infoPlist description] UTF8String]);
+ return success ? 0 : 1;
+}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index ab6cec81c..3de3e98b7 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -1678,4 +1678,20 @@ void TestBlackbox::testNsis()
QVERIFY(!QFile::exists(defaultInstallRoot + "/you-should-not-see-a-file-with-this-name.exe"));
}
+void TestBlackbox::testEmbedInfoPlist()
+{
+ if (!HostOsInfo::isOsxHost())
+ SKIP_TEST("only applies on OS X");
+
+ QDir::setCurrent(testDataDir + QLatin1String("/embedInfoPlist"));
+
+ QbsRunParameters params;
+ params.command = QLatin1String("run");
+ QCOMPARE(runQbs(params), 0);
+
+ params.arguments = QStringList(QLatin1String("cpp.embedInfoPlist:false"));
+ params.expectFailure = true;
+ QVERIFY(runQbs(params) != 0);
+}
+
QTEST_MAIN(TestBlackbox)
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index b9f0b6ddc..613eef925 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -158,6 +158,7 @@ private slots:
void missingProfile();
void testAssembly();
void testNsis();
+ void testEmbedInfoPlist();
private:
QByteArray m_qbsStderr;