diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-07-09 13:40:31 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-07-10 08:28:10 +0000 |
commit | bf7cc41694a20f013adb6c4add0fb3c50d84a4e8 (patch) | |
tree | 0e9b03747eab6285008d1e856437cdfc6f1de575 | |
parent | 5e89502cd9af7175c380234472784c4d444debb5 (diff) | |
download | qbs-bf7cc41694a20f013adb6c4add0fb3c50d84a4e8.tar.gz |
Update the timestamps of file dependencies of rescued artifacts
Resetting the timestamps of file dependencies happens per artifact
before the rescue procedure, so any dependencies added there must get
their timestamp reset explicitly.
Task-number: QBS-1359
Change-Id: Iec22b105a4132ada65b52391d4212c3b9ba52a2a
Reviewed-by: Ola Røer Thorsen <ola@silentwings.no>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | src/lib/corelib/buildgraph/executor.cpp | 4 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata-qt/qrc/i.qbs | 2 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata-qt/qrc/test.cpp | 1 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackboxqt.cpp | 6 |
4 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp index 022929794..e18e9f699 100644 --- a/src/lib/corelib/buildgraph/executor.cpp +++ b/src/lib/corelib/buildgraph/executor.cpp @@ -823,7 +823,9 @@ void Executor::rescueOldBuildData(Artifact *artifact, bool *childrenAdded = 0) << "not in the project's list of dependencies anymore."; break; } - artifact->fileDependencies.insert(static_cast<FileDependency *>(*depIt)); + FileDependency * const dep = static_cast<FileDependency *>(*depIt); + dep->clearTimestamp(); + artifact->fileDependencies.insert(dep); } if (canRescue) { diff --git a/tests/auto/blackbox/testdata-qt/qrc/i.qbs b/tests/auto/blackbox/testdata-qt/qrc/i.qbs index 67b836dd4..b6aeb9c15 100644 --- a/tests/auto/blackbox/testdata-qt/qrc/i.qbs +++ b/tests/auto/blackbox/testdata-qt/qrc/i.qbs @@ -13,7 +13,7 @@ Project { files: [ "bla.cpp", "bla.qrc", - "stuff.txt" + //"test.cpp", ] } } diff --git a/tests/auto/blackbox/testdata-qt/qrc/test.cpp b/tests/auto/blackbox/testdata-qt/qrc/test.cpp new file mode 100644 index 000000000..7da700fd1 --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/qrc/test.cpp @@ -0,0 +1 @@ +void test() {} diff --git a/tests/auto/blackbox/tst_blackboxqt.cpp b/tests/auto/blackbox/tst_blackboxqt.cpp index c58b10720..3ab2c601c 100644 --- a/tests/auto/blackbox/tst_blackboxqt.cpp +++ b/tests/auto/blackbox/tst_blackboxqt.cpp @@ -367,6 +367,8 @@ void TestBlackboxQt::track_qrc() { QDir::setCurrent(testDataDir + "/qrc"); QCOMPARE(runQbs(QbsRunParameters("run")), 0); + QVERIFY2(m_qbsStdout.contains("rcc"), m_qbsStdout.constData()); + QVERIFY2(!m_qbsStdout.contains("compiling test.cpp"), m_qbsStdout.constData()); const QString fileName = relativeExecutableFilePath("i"); QVERIFY2(regularFileExists(fileName), qPrintable(fileName)); QDateTime dt = QFileInfo(fileName).lastModified(); @@ -378,8 +380,11 @@ void TestBlackboxQt::track_qrc() f.write("bla"); f.close(); } + REPLACE_IN_FILE("i.qbs", "//\"test.cpp\"", "\"test.cpp\""); waitForFileUnlock(); QCOMPARE(runQbs(QbsRunParameters("run")), 0); + QVERIFY2(m_qbsStdout.contains("rcc"), m_qbsStdout.constData()); + QVERIFY2(m_qbsStdout.contains("compiling test.cpp"), m_qbsStdout.constData()); QVERIFY(regularFileExists(fileName)); QVERIFY(dt < QFileInfo(fileName).lastModified()); WAIT_FOR_NEW_TIMESTAMP(); @@ -387,6 +392,7 @@ void TestBlackboxQt::track_qrc() QCOMPARE(runQbs(), 0); QVERIFY2(m_qbsStdout.contains("Resolving"), m_qbsStdout.constData()); QVERIFY2(!m_qbsStdout.contains("rcc"), m_qbsStdout.constData()); + QVERIFY2(!m_qbsStdout.contains("compiling test.cpp"), m_qbsStdout.constData()); } void TestBlackboxQt::unmocable() |