diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-08-10 13:28:53 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-14 02:37:30 +0200 |
commit | eea5f7496caa46a40fd609d13a327ae9c887e67e (patch) | |
tree | 90ab39dce8b803889491b1eb125aa6d1f092bc7f /tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp | |
parent | 32d692798fef2cb34a0894959b83b7eab95649dd (diff) | |
download | qtxmlpatterns-eea5f7496caa46a40fd609d13a327ae9c887e67e.tar.gz |
tests: explicitly put the path to xmlpatterns tools
Previously, these tests used whatever version of the xmlpatterns tools
happened to be first in PATH, which was quite error-prone. QLibraryInfo
can tell us exactly where the binaries are supposed to be located, so
use that instead.
Change-Id: I556ffe1819560afbe6a8bfa5272fcf2a760a14f7
Reviewed-on: http://codereview.qt-project.org/2799
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Diffstat (limited to 'tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp')
-rw-r--r-- | tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp b/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp index cb94bcf..29ed77e 100644 --- a/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp +++ b/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp @@ -41,6 +41,7 @@ #include <QFile> #include <QtTest/QtTest> +#include <QLibraryInfo> #include "../qxmlquery/TestFundament.h" #include "../network-settings.h" @@ -70,7 +71,7 @@ private: }; tst_XmlPatternsValidator::tst_XmlPatternsValidator() - : m_command(QLatin1String("xmlpatternsvalidator")) + : m_command(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/xmlpatternsvalidator")) , m_dontRun(false) { } @@ -83,9 +84,13 @@ void tst_XmlPatternsValidator::initTestCase() if(!process.waitForFinished()) { m_dontRun = true; - QEXPECT_FAIL("", "The command line tool is not in the path, most likely because Qt " - "has been partically built, such as only the sub-src rule. No tests will be run.", Abort); - QVERIFY(false); + QSKIP( + qPrintable(QString( + "The command line tool (%1) could not be run, possibly because Qt was " + "incompletely built or installed. No tests will be run." + ).arg(m_command)), + SkipAll + ); } } |