aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/tst_blackbox.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2016-06-02 14:52:53 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2016-06-02 14:28:45 +0000
commitd8d7beb866b24793d9c04b6996276a4a8959bfa2 (patch)
tree73c378521d981a318ff006574ca4e85b4f23b59f /tests/auto/blackbox/tst_blackbox.cpp
parent161a751d53b97dd706ac0108432cdc71c4c05c70 (diff)
Executor: Do not assert on condition that can actually happen.v1.5.1
We asserted on the condition that a node's product must be in the list of products to build, meaning that it needs to belong to the set of user-selected products or one of their dependencies. However, there are at least two ways in which one can trigger this condition to be false: 1) The user provides a faulty project in which a "Depends" item is missing, but the respective artifact from the other product is still found (e.g. a generated header file via a project-global include path). 2) The project is actually okay, but our C++ scanner erroneously adds dependencies from a different product, e.g. because it does not know about #ifdefs. Instead of the assertion, we now simply mark the respective node as built and continue. Ideally, we'd log a warning, but we cannot do that because of point 2) above. Change-Id: I3549d732dea5cde84d1019132580a8e051c9db11 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/tst_blackbox.cpp')
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index e1f05b534..a46d02fe5 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -3880,6 +3880,21 @@ void TestBlackbox::lrelease()
QVERIFY(!regularFileExists(relativeProductBuildDir("lrelease-test") + "/hu.qm"));
}
+void TestBlackbox::missingDependency()
+{
+ QDir::setCurrent(testDataDir + "/missing-dependency");
+ QbsRunParameters params;
+ params.expectFailure = true;
+ params.arguments << "-p" << "theApp";
+ QVERIFY(runQbs(params) != 0);
+ QVERIFY2(!m_qbsStderr.contains("ASSERT"), m_qbsStderr.constData());
+ QCOMPARE(runQbs(QbsRunParameters(QStringList() << "-p" << "theDep")), 0);
+ params.expectFailure = false;
+ params.arguments << "-vv";
+ QCOMPARE(runQbs(params), 0);
+ QVERIFY(m_qbsStderr.contains("false positive"));
+}
+
void TestBlackbox::badInterpreter()
{
if (!HostOsInfo::isAnyUnixHost())