aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weickelt <richard@weickelt.de>2020-05-08 13:23:53 +0200
committerRichard Weickelt <richard@weickelt.de>2020-05-11 08:39:38 +0000
commit0bbc9cddde0a5fdb54412d12397fd96d560b83d0 (patch)
tree2348558ac40a21f247d7dcaca3dd70b03ef5adc8
parenta3c97374d0e06e0e2a23b22c10450ede48bcb478 (diff)
Add testcase for building projects with internal profiles
When a project contains a Profile item, it should be possible to use this profile for all products without explicitly selecting it in the product items. Task-number: QTCREATORBUG-23985 Change-Id: Ifba53d26dc302cedd4be7a906ef2fd6fb3e6eb9d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--tests/auto/language/testdata/use-internal-profile.qbs13
-rw-r--r--tests/auto/language/tst_language.cpp15
-rw-r--r--tests/auto/language/tst_language.h1
3 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/language/testdata/use-internal-profile.qbs b/tests/auto/language/testdata/use-internal-profile.qbs
new file mode 100644
index 000000000..c2e20ff19
--- /dev/null
+++ b/tests/auto/language/testdata/use-internal-profile.qbs
@@ -0,0 +1,13 @@
+Project {
+ name: "theproject"
+
+ Profile {
+ name: "theprofile"
+ dummy.defines: name
+ }
+
+ Product {
+ name: "theproduct"
+ Depends { name: "dummy" }
+ }
+} \ No newline at end of file
diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp
index 25e549d18..20d607320 100644
--- a/tests/auto/language/tst_language.cpp
+++ b/tests/auto/language/tst_language.cpp
@@ -3024,6 +3024,21 @@ void TestLanguage::fileTags()
QCOMPARE(fileTags, expectedFileTags);
}
+void TestLanguage::useInternalProfile()
+{
+ const QString profile(QStringLiteral("theprofile"));
+ SetupProjectParameters params = defaultParameters;
+ params.setProjectFilePath(testProject("use-internal-profile.qbs"));
+ params.setTopLevelProfile(profile);
+ TopLevelProjectConstPtr project = loader->loadProject(params);
+ QVERIFY(!!project);
+ QCOMPARE(project->profile(), profile);
+ QCOMPARE(project->products.size(), size_t(1));
+ const ResolvedProductConstPtr product = project->products[0];
+ QCOMPARE(product->profile(), profile);
+ QCOMPARE(product->moduleProperties->moduleProperty("dummy", "defines").toString(), profile);
+}
+
void TestLanguage::wildcards_data()
{
QTest::addColumn<bool>("useGroup");
diff --git a/tests/auto/language/tst_language.h b/tests/auto/language/tst_language.h
index 3fe6d8f2a..55591da1f 100644
--- a/tests/auto/language/tst_language.h
+++ b/tests/auto/language/tst_language.h
@@ -176,6 +176,7 @@ private slots:
void qualifiedId();
void recursiveProductDependencies();
void rfc1034Identifier();
+ void useInternalProfile();
void versionCompare();
void wildcards_data();
void wildcards();