aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-08-31 17:39:43 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-09-03 09:53:13 +0000
commitf57ca14b2c2eeac1f7fedd863dc503be4638bee2 (patch)
tree6ccc4a935d4e38eaeac6a29360f45ed3b4eae843 /tests
parent106a2b5877a26a4cd7a1c9e9542e0dc392cb2437 (diff)
Executor: Fix invalid assertion
An artifact whose alwaysUpdated property is false does not need to exist and is therefore not required to have a valid timestamp. Change-Id: I642349c49a53e6e45d6b09d1acc87f4c9a0edae9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata/not-always-updated/not-always-updated.qbs31
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp7
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
3 files changed, 39 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/not-always-updated/not-always-updated.qbs b/tests/auto/blackbox/testdata/not-always-updated/not-always-updated.qbs
new file mode 100644
index 000000000..8d6c1f5da
--- /dev/null
+++ b/tests/auto/blackbox/testdata/not-always-updated/not-always-updated.qbs
@@ -0,0 +1,31 @@
+import qbs.TextFile
+
+Product {
+ type: "p"
+ Rule {
+ multiplex: true
+ Artifact { filePath: "dummy.txt"; fileTags: "t1"; alwaysUpdated: false }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = "creating dummy";
+ cmd.sourceCode = function() {};
+ return cmd;
+ }
+ }
+ Rule {
+ inputs: "t1"
+ Artifact { filePath: "o.txt"; fileTags: "p" }
+ prepare: {
+ var cmd = new JavaScriptCommand;
+ cmd.description = "creating final";
+ 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 8068aee48..0a846ede7 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -4337,6 +4337,13 @@ void TestBlackbox::nonDefaultProduct()
QVERIFY2(QFile::exists(nonDefaultAppExe), qPrintable(nonDefaultAppExe));
}
+void TestBlackbox::notAlwaysUpdated()
+{
+ QDir::setCurrent(testDataDir + "/not-always-updated");
+ QCOMPARE(runQbs(), 0);
+ QCOMPARE(runQbs(), 0);
+}
+
static void switchProfileContents(qbs::Profile &p, qbs::Settings *s, bool on)
{
const QString scalarKey = "leaf.scalarProp";
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index 0dcfc5b31..58cc8f6fb 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -183,6 +183,7 @@ private slots:
void nodejs();
void nonBrokenFilesInBrokenProduct();
void nonDefaultProduct();
+ void notAlwaysUpdated();
void nsis();
void nsisDependencies();
void outOfDateMarking();