aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata/disable-product/project.qbs5
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp15
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/disable-product/project.qbs b/tests/auto/blackbox/testdata/disable-product/project.qbs
new file mode 100644
index 000000000..3aa7afd50
--- /dev/null
+++ b/tests/auto/blackbox/testdata/disable-product/project.qbs
@@ -0,0 +1,5 @@
+import qbs
+
+Product {
+ // condition: false
+}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 50ec294f7..3ca70b7bd 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -1429,6 +1429,21 @@ void TestBlackbox::disabledProject()
QCOMPARE(runQbs(), 0);
}
+void TestBlackbox::disableProduct()
+{
+ QDir::setCurrent(testDataDir + "/disable-product");
+ QCOMPARE(runQbs(), 0);
+ waitForNewTimestamp();
+ QFile projectFile("project.qbs");
+ QVERIFY(projectFile.open(QIODevice::ReadWrite));
+ QByteArray content = projectFile.readAll();
+ content.replace("// condition: false", "condition: false");
+ projectFile.resize(0);
+ projectFile.write(content);
+ projectFile.close();
+ QCOMPARE(runQbs(), 0);
+}
+
void TestBlackbox::duplicateProductNames()
{
QDir::setCurrent(testDataDir + "/duplicateProductNames");
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index e0d6600eb..87008e266 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -108,6 +108,7 @@ private slots:
void dependenciesProperty();
void disabledProduct();
void disabledProject();
+ void disableProduct();
void duplicateProductNames();
void duplicateProductNames_data();
void dynamicLibs();