diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-11 16:30:34 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-14 09:10:59 +0000 |
commit | fe79dab20ef733216aa9fa724acd4c12017ceb52 (patch) | |
tree | 75ec7b1bb750d19b71eb6ef3f2d244679ff89382 /tests/auto/blackbox/testdata-qt | |
parent | 86a00a13dcf2b107b2aca66b565e0d6151f6bd07 (diff) |
Fix edge case in change tracking
If we have a moc'able header file whose moc output is included by the
cpp file, then it is an error not to list that header in the project
file, because moc will not run on it and the included moc_cpp file won't
be present, causing a compiler error. However, if the header was
originally listed in the project file and removed from it after
building, then the next attempt to build would still succeed, because
the generated artifact would only be removed from disk at the end of the
build process.
Fix this by amending the code that checks for removed child artifacts to
remove them from disk immediately, making sure a rebuild will not
accidentally succeed.
Change-Id: I4f69560cc899dbc61938acc1c697aa93407dc03c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata-qt')
3 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/file.cpp b/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/file.cpp new file mode 100644 index 000000000..aba40ccd6 --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/file.cpp @@ -0,0 +1,10 @@ +#include "file.h" + +MyObject::MyObject() {} + +int main() +{ + MyObject o1; +} + +#include <moc_file.cpp> diff --git a/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/file.h b/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/file.h new file mode 100644 index 000000000..4333b64a6 --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/file.h @@ -0,0 +1,13 @@ +#pragma once + +#include <QObject> + +class MyObject : public QObject +{ + Q_OBJECT + public: + MyObject(); + + signals: + void someSignal(); +}; diff --git a/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/remove-moc-header-from-file-list.qbs b/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/remove-moc-header-from-file-list.qbs new file mode 100644 index 000000000..120f10b0d --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/remove-moc-header-from-file-list.qbs @@ -0,0 +1,9 @@ +import qbs + +QtApplication { + name: "p" + files: [ + "file.h", + "file.cpp" + ] +} |