diff options
author | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-06-12 16:13:55 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-06-13 04:11:24 +0200 |
commit | a280fa27f42eeb107148e64e27513e6d0d9ad195 (patch) | |
tree | d3aabfa9003ddcafd3c033df6524c74df68bad24 /tests | |
parent | a52f265fcd70b51acc15b0fc5000014f1b1fed29 (diff) |
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 <christian.kandeler@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 5 |
1 files 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 <tools/profile.h> #include <QLocale> +#include <QRegExp> #include <QTemporaryFile> #include <QScriptEngine> #include <QScriptValue> @@ -1525,7 +1526,7 @@ void TestBlackbox::erroneousFiles_data() { QTest::addColumn<QString>("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."); |