aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/tst_blackbox.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-06-05 11:20:20 +0200
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-06-10 11:47:48 +0200
commita52f265fcd70b51acc15b0fc5000014f1b1fed29 (patch)
tree2dcc91c295b676a873cbaf8099dea12b11843086 /tests/auto/blackbox/tst_blackbox.cpp
parent026cc4bead2e982966990221e5a84068799c13bd (diff)
yield error if Command.workingDirectory doesn't exist
Otherwise some command might clutter the user's current working dir. Task-number: QBS-607 Change-Id: Id263481d1a615b9c66753e11b271441d4bd004b1 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'tests/auto/blackbox/tst_blackbox.cpp')
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index cc68a57d4..d185dbdde 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -1521,6 +1521,28 @@ void TestBlackbox::dynamicRuleOutputs()
QVERIFY(!QFile::exists(sourceFile2));
}
+void TestBlackbox::erroneousFiles_data()
+{
+ QTest::addColumn<QString>("errorMessage");
+ QTest::newRow("nonexistentWorkingDir")
+ << "The working directory '/does/not/exist' for process 'ls' is invalid.";
+}
+
+void TestBlackbox::erroneousFiles()
+{
+ QFETCH(QString, errorMessage);
+ QDir::setCurrent(testDataDir + "/erroneous/" + QTest::currentDataTag());
+ QbsRunParameters params;
+ params.expectFailure = true;
+ QVERIFY(runQbs(params) != 0);
+ QString err = QString::fromLocal8Bit(m_qbsStderr);
+ if (!err.contains(errorMessage)) {
+ qDebug() << "Output: " << err;
+ qDebug() << "Expected: " << errorMessage;
+ QFAIL("Unexpected error message.");
+ }
+}
+
void TestBlackbox::explicitlyDependsOn()
{
QDir::setCurrent(testDataDir + "/explicitlyDependsOn");