aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/corelib/buildgraph/projectbuilddata.cpp3
-rw-r--r--tests/auto/blackbox/testdata/renameDependency/after/lib2.cpp7
-rw-r--r--tests/auto/blackbox/testdata/renameDependency/after/lib2.h1
-rw-r--r--tests/auto/blackbox/testdata/renameDependency/before/lib.cpp7
-rw-r--r--tests/auto/blackbox/testdata/renameDependency/before/lib.h1
-rw-r--r--tests/auto/blackbox/testdata/renameDependency/before/main.cpp8
-rw-r--r--tests/auto/blackbox/testdata/renameDependency/before/renameDependency.qbs5
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp20
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
9 files changed, 52 insertions, 1 deletions
diff --git a/src/lib/corelib/buildgraph/projectbuilddata.cpp b/src/lib/corelib/buildgraph/projectbuilddata.cpp
index 4f62bae3e..e2518636d 100644
--- a/src/lib/corelib/buildgraph/projectbuilddata.cpp
+++ b/src/lib/corelib/buildgraph/projectbuilddata.cpp
@@ -253,11 +253,12 @@ void ProjectBuildData::removeArtifactAndExclusiveDependents(Artifact *artifact,
if (removeParent) {
removeArtifactAndExclusiveDependents(parent, logger, removeFromProduct,
removedArtifacts);
+ } else {
+ parent->clearTimestamp();
}
}
const bool removeFromDisk = artifact->artifactType == Artifact::Generated;
removeArtifact(artifact, logger, removeFromDisk, removeFromProduct);
-
}
void ProjectBuildData::removeArtifact(Artifact *artifact,
diff --git a/tests/auto/blackbox/testdata/renameDependency/after/lib2.cpp b/tests/auto/blackbox/testdata/renameDependency/after/lib2.cpp
new file mode 100644
index 000000000..cf45da25a
--- /dev/null
+++ b/tests/auto/blackbox/testdata/renameDependency/after/lib2.cpp
@@ -0,0 +1,7 @@
+#include "lib2.h"
+#include <iostream>
+
+void print_two_numbers(int a, int b, int c)
+{
+ std::cout << "a=" << a << ", b=" << b << ", c=" << c << std::endl;
+}
diff --git a/tests/auto/blackbox/testdata/renameDependency/after/lib2.h b/tests/auto/blackbox/testdata/renameDependency/after/lib2.h
new file mode 100644
index 000000000..30e6c55fb
--- /dev/null
+++ b/tests/auto/blackbox/testdata/renameDependency/after/lib2.h
@@ -0,0 +1 @@
+void print_two_numbers(int a, int b, int c);
diff --git a/tests/auto/blackbox/testdata/renameDependency/before/lib.cpp b/tests/auto/blackbox/testdata/renameDependency/before/lib.cpp
new file mode 100644
index 000000000..9ad8f3857
--- /dev/null
+++ b/tests/auto/blackbox/testdata/renameDependency/before/lib.cpp
@@ -0,0 +1,7 @@
+#include "lib.h"
+#include <iostream>
+
+void print_two_numbers(int a, int b/*, int c*/)
+{
+ std::cout << "a=" << a << ", b=" << b /*<< ", c=" << c */ << std::endl;
+}
diff --git a/tests/auto/blackbox/testdata/renameDependency/before/lib.h b/tests/auto/blackbox/testdata/renameDependency/before/lib.h
new file mode 100644
index 000000000..b98a95484
--- /dev/null
+++ b/tests/auto/blackbox/testdata/renameDependency/before/lib.h
@@ -0,0 +1 @@
+void print_two_numbers(int a, int b/*, int c*/);
diff --git a/tests/auto/blackbox/testdata/renameDependency/before/main.cpp b/tests/auto/blackbox/testdata/renameDependency/before/main.cpp
new file mode 100644
index 000000000..d78950ee9
--- /dev/null
+++ b/tests/auto/blackbox/testdata/renameDependency/before/main.cpp
@@ -0,0 +1,8 @@
+#include <iostream>
+#include "lib.h"
+
+int main()
+{
+ print_two_numbers(2, 3);
+ return 0;
+}
diff --git a/tests/auto/blackbox/testdata/renameDependency/before/renameDependency.qbs b/tests/auto/blackbox/testdata/renameDependency/before/renameDependency.qbs
new file mode 100644
index 000000000..e6f3cf66b
--- /dev/null
+++ b/tests/auto/blackbox/testdata/renameDependency/before/renameDependency.qbs
@@ -0,0 +1,5 @@
+import qbs
+
+CppApplication {
+ files: ["*.cpp", "*.h"]
+}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index f998f8b95..30cf99cd1 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -662,6 +662,26 @@ void TestBlackbox::rc()
QCOMPARE(rcFileWasCompiled, HostOsInfo::isWindowsHost());
}
+void TestBlackbox::renameDependency()
+{
+ QDir::setCurrent(testDataDir + "/renameDependency");
+ if (QFile::exists("work"))
+ rmDirR("work");
+ QDir().mkdir("work");
+ ccp("before", "work");
+ QDir::setCurrent(testDataDir + "/renameDependency/work");
+ QCOMPARE(runQbs(), 0);
+
+ waitForNewTimestamp();
+ QFile::remove("lib.h");
+ QFile::remove("lib.cpp");
+ ccp("../after", ".");
+ QbsRunParameters params;
+ params.expectFailure = true;
+ QVERIFY(runQbs(params) != 0);
+ QVERIFY(m_qbsStdout.contains("compiling main.cpp"));
+}
+
void TestBlackbox::renameProduct()
{
QDir::setCurrent(testDataDir + "/renameProduct");
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index aa8310a28..c975a9815 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -147,6 +147,7 @@ private slots:
void exportWithRecursiveDepends();
void fileTagger();
void rc();
+ void renameDependency();
void renameProduct();
void renameTargetArtifact();
void softDependency();