diff options
| author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-08-18 11:30:14 +0200 |
|---|---|---|
| committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-08-19 08:29:15 +0000 |
| commit | 604b370e5ca9d35a8b77a29a56111bde50c7ed4f (patch) | |
| tree | b21c1f7903346a30f435dd2400827ae77b3377f1 | |
| parent | a8b906085d488719a9431014820e64ff3b53bd54 (diff) | |
| download | qbs-604b370e5ca9d35a8b77a29a56111bde50c7ed4f.tar.gz | |
archiver: Don't continue when the zip tool is unknown.
Without this patch, we simply run the unknown executable without any
arguments, which can hang forever if it takes its input from stdin by
default.
Change-Id: I846821c3bb7321435b84d6fae5e26d97254b20bd
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
| -rw-r--r-- | share/qbs/modules/archiver/archiver.qbs | 2 | ||||
| -rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 10 | ||||
| -rw-r--r-- | tests/auto/blackbox/tst_blackbox.h | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/share/qbs/modules/archiver/archiver.qbs b/share/qbs/modules/archiver/archiver.qbs index d39303c11..cdcf1d9b5 100644 --- a/share/qbs/modules/archiver/archiver.qbs +++ b/share/qbs/modules/archiver/archiver.qbs @@ -177,6 +177,8 @@ Module { } args.push("-r", output.filePath, ".", "-i@" + input.filePath); + } else { + throw "Unknown zip tool '" + binaryName + "'"; } args = args.concat(product.moduleProperty("archiver", "flags")); diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 3079ee741..209cfd0cc 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -337,6 +337,16 @@ void TestBlackbox::zip_data() QTest::newRow("jar") << "jar"; } +void TestBlackbox::zipInvalid() +{ + QDir::setCurrent(testDataDir + "/archiver"); + QbsRunParameters params(QStringList() << "archiver.type:zip" + << "archiver.command:/bin/something"); + params.expectFailure = true; + QVERIFY(runQbs(params) != 0); + QVERIFY2(m_qbsStderr.contains("Unknown zip tool 'something'"), m_qbsStderr.constData()); +} + void TestBlackbox::android() { QFETCH(QString, projectDir); diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index 0b8245386..3c05e7d0a 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -183,6 +183,7 @@ private slots: void wildcardRenaming(); void zip(); void zip_data(); + void zipInvalid(); private: QString findArchiver(const QString &fileName, int *status = nullptr); |
