aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-06-30 11:21:09 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2017-06-30 11:28:46 +0000
commit88a34df06cc0f216358da762dd7038bb3b593a6a (patch)
treefe27538a4408a6bf777311202fd3190ff394603f
parentfbf8249a897596dc584ac44ad6a8d705017799ad (diff)
Fix change tracking with Rule.requiresInputs == false
Change-Id: I65edd82bb70e19cdd00b9bba732e9db1aee36f9b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/lib/corelib/buildgraph/rulesapplicator.cpp2
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/corelib/buildgraph/rulesapplicator.cpp b/src/lib/corelib/buildgraph/rulesapplicator.cpp
index 297d01189..c40a86477 100644
--- a/src/lib/corelib/buildgraph/rulesapplicator.cpp
+++ b/src/lib/corelib/buildgraph/rulesapplicator.cpp
@@ -346,7 +346,7 @@ Artifact *RulesApplicator::createOutputArtifact(const QString &filePath, const F
(*inputArtifacts.cbegin())->filePath()));
throw error;
}
- if (m_rule->declaresInputs())
+ if (m_rule->declaresInputs() && m_rule->requiresInputs)
outputArtifact->clearTimestamp();
m_invalidatedArtifacts += outputArtifact;
} else {
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 959589813..b2c0a3be5 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -1615,6 +1615,12 @@ void TestBlackbox::ruleWithNonRequiredInputs()
QVERIFY2(outFile.open(QIODevice::ReadOnly), qPrintable(outFile.errorString()));
output = outFile.readAll();
QCOMPARE(output, QByteArray("(a.inp,b.inp,c.inp,)"));
+ QCOMPARE(runQbs(), 0);
+ QVERIFY2(!m_qbsStdout.contains("Generating"), m_qbsStdout.constData());
+ WAIT_FOR_NEW_TIMESTAMP();
+ touch("a.inp");
+ QCOMPARE(runQbs(), 0);
+ QVERIFY2(m_qbsStdout.contains("Generating"), m_qbsStdout.constData());
}
void TestBlackbox::smartRelinking()