From a280fa27f42eeb107148e64e27513e6d0d9ad195 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 12 Jun 2014 16:13:55 +0200 Subject: fix TestBlackbox::erroneousFiles on *nix The error message will contain '/bin/ls' and not just 'ls' unlike on Windows. The test now understands regular expressions. Change-Id: Ib37201744d192d6cd53c350107985532c3633532 Reviewed-by: Christian Kandeler --- tests/auto/blackbox/tst_blackbox.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index d185dbdde..3d06bb40f 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -1525,7 +1526,7 @@ void TestBlackbox::erroneousFiles_data() { QTest::addColumn("errorMessage"); QTest::newRow("nonexistentWorkingDir") - << "The working directory '/does/not/exist' for process 'ls' is invalid."; + << "The working directory '/does/not/exist' for process '.*ls' is invalid."; } void TestBlackbox::erroneousFiles() @@ -1536,7 +1537,7 @@ void TestBlackbox::erroneousFiles() params.expectFailure = true; QVERIFY(runQbs(params) != 0); QString err = QString::fromLocal8Bit(m_qbsStderr); - if (!err.contains(errorMessage)) { + if (!err.contains(QRegExp(errorMessage))) { qDebug() << "Output: " << err; qDebug() << "Expected: " << errorMessage; QFAIL("Unexpected error message."); -- cgit v1.2.3