aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-05-17 14:03:01 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-05-18 07:05:41 +0000
commitd8f1a1b01ed947a1d70c7635945b845a6236f64e (patch)
treeaea5b37a956b0e32286fc75dabb2c0d05e09b822 /tests
parent9008034adf19176c399853ddd04e36ea3473e26e (diff)
Mark parent artifacts explicitly as out of date
... after a transformer finishes. This makes our "out of date" check independent of the local clock resolution for generated artifacts that do not have source artifacts as children. Change-Id: If3d47f1fd859c30846806fabaddf3b47a840a6d3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata/out-of-date-marking/main.c3
-rw-r--r--tests/auto/blackbox/testdata/out-of-date-marking/out-of-date-marking.qbs22
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp10
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
4 files changed, 36 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/out-of-date-marking/main.c b/tests/auto/blackbox/testdata/out-of-date-marking/main.c
new file mode 100644
index 000000000..7b4a384a7
--- /dev/null
+++ b/tests/auto/blackbox/testdata/out-of-date-marking/main.c
@@ -0,0 +1,3 @@
+#include <myheader.h>
+
+int main() { return 0; }
diff --git a/tests/auto/blackbox/testdata/out-of-date-marking/out-of-date-marking.qbs b/tests/auto/blackbox/testdata/out-of-date-marking/out-of-date-marking.qbs
new file mode 100644
index 000000000..1ef57bae7
--- /dev/null
+++ b/tests/auto/blackbox/testdata/out-of-date-marking/out-of-date-marking.qbs
@@ -0,0 +1,22 @@
+import qbs
+import qbs.TextFile
+
+CppApplication {
+ name: "app"
+ files: "main.c"
+ cpp.includePaths: buildDirectory
+ Rule {
+ multiplex: true
+ alwaysRun: true
+ Artifact { filePath: "myheader.h"; fileTags: "hpp" }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = "generating " + output.fileName;
+ cmd.sourceCode = function() {
+ var f = new TextFile(output.filePath, TextFile.WriteOnly);
+ f.close();
+ };
+ return cmd;
+ }
+ }
+}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 93387e2f6..2cf0c5003 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -5066,6 +5066,16 @@ void TestBlackbox::nsisDependencies()
QCOMPARE(m_qbsStdout.contains("compiling hello.nsi"), targetIsWindows);
}
+void TestBlackbox::outOfDateMarking()
+{
+ QDir::setCurrent(testDataDir + "/out-of-date-marking");
+ for (int i = 0; i < 25; ++i) {
+ QCOMPARE(runQbs(), 0);
+ QVERIFY2(m_qbsStdout.contains("generating myheader.h"), qPrintable(QString::number(i)));
+ QVERIFY2(m_qbsStdout.contains("compiling main.c"), qPrintable(QString::number(i)));
+ }
+}
+
void TestBlackbox::enableExceptions()
{
QFETCH(QString, file);
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index 2646704f9..f55158be5 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -178,6 +178,7 @@ private slots:
void nonDefaultProduct();
void nsis();
void nsisDependencies();
+ void outOfDateMarking();
void outputArtifactAutoTagging();
void overrideProjectProperties();
void pchChangeTracking();