From f57ca14b2c2eeac1f7fedd863dc503be4638bee2 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 31 Aug 2018 17:39:43 +0200 Subject: 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 --- .../not-always-updated/not-always-updated.qbs | 31 ++++++++++++++++++++++ tests/auto/blackbox/tst_blackbox.cpp | 7 +++++ tests/auto/blackbox/tst_blackbox.h | 1 + 3 files changed, 39 insertions(+) create mode 100644 tests/auto/blackbox/testdata/not-always-updated/not-always-updated.qbs (limited to 'tests') 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(); -- cgit v1.2.3