summaryrefslogtreecommitdiff
path: root/tests/auto/xmlpatterns
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-10-14 20:06:10 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-10-14 20:06:10 +0200
commitd570274da3ba262d85cf9a32de34678c85c1af9e (patch)
tree8e67de1cc937e835d3507a38a415ac4aa579608b /tests/auto/xmlpatterns
parent14afeb8512bb4c4614256ebd227c06df2a1c8103 (diff)
parent688b29fc5aeab0eafbb457a0fa6953856eeac928 (diff)
downloadqtxmlpatterns-d570274da3ba262d85cf9a32de34678c85c1af9e.tar.gz
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: tests/auto/xmlpatterns/tst_xmlpatterns.cpp Change-Id: Ib93b62f45d796dd3ed2d5d03f602699295f62705
Diffstat (limited to 'tests/auto/xmlpatterns')
-rw-r--r--tests/auto/xmlpatterns/queries/literalsequence.xq1
-rw-r--r--tests/auto/xmlpatterns/stderrBaselines/QTBUG35897literalsequence.txt0
-rw-r--r--tests/auto/xmlpatterns/tst_xmlpatterns.cpp23
3 files changed, 22 insertions, 2 deletions
diff --git a/tests/auto/xmlpatterns/queries/literalsequence.xq b/tests/auto/xmlpatterns/queries/literalsequence.xq
new file mode 100644
index 0000000..3420df0
--- /dev/null
+++ b/tests/auto/xmlpatterns/queries/literalsequence.xq
@@ -0,0 +1 @@
+("someString", tokenize("a,b",","))
diff --git a/tests/auto/xmlpatterns/stderrBaselines/QTBUG35897literalsequence.txt b/tests/auto/xmlpatterns/stderrBaselines/QTBUG35897literalsequence.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/auto/xmlpatterns/stderrBaselines/QTBUG35897literalsequence.txt
diff --git a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
index e43bd68..0a189db 100644
--- a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
+++ b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
@@ -117,6 +117,17 @@ void tst_XmlPatterns::initTestCase()
#endif // QT_NO_PROCESS
}
+#ifndef QT_NO_PROCESS
+static QByteArray msgProcessError(const char *what, const QProcess &process)
+{
+ QString result = QLatin1String(what) + QLatin1Char(' ')
+ + QDir::toNativeSeparators(process.program())
+ + QLatin1Char(' ') + process.arguments().join(QLatin1Char(' '))
+ + QLatin1String(": ") + process.errorString();
+ return result.toLocal8Bit();
+}
+#endif // !QT_NO_PROCESS
+
void tst_XmlPatterns::xquerySupport()
{
if (QTest::currentDataTag() == QByteArray("Load query via FTP")
@@ -143,9 +154,10 @@ void tst_XmlPatterns::xquerySupport()
process.setWorkingDirectory(inputFile(cwd));
process.start(m_command, arguments);
+ QVERIFY2(process.waitForStarted(), msgProcessError("Failed to start", process).constData());
+ QVERIFY2(process.waitForFinished(), msgProcessError("Timeout running", process).constData());
QCOMPARE(process.exitStatus(), QProcess::NormalExit);
- QVERIFY(process.waitForFinished());
if(process.exitCode() != expectedExitCode)
QTextStream(stderr) << "stderr:" << process.readAllStandardError();
@@ -755,6 +767,13 @@ void tst_XmlPatterns::xquerySupport_data() const
<< QString()
<< QString();
+ QTest::newRow("QTBUG-35897: literal sequence")
+ << 0
+ << QByteArray("someString a b\n")
+ << QStringList((path + QStringLiteral("literalsequence.xq")))
+ << QString()
+ << QString();
+
// TODO https?
// TODO pass external variables that allows space around the equal sign.
// TODO run fn:trace()
@@ -804,7 +823,7 @@ void tst_XmlPatterns::removeNonWritable(QFile &outFile)
void tst_XmlPatterns::stdoutFailure() const
{
#ifdef QT_NO_PROCESS
- QSKIP("No QProcess available");
+ QSKIP("Skipping test due to not having process support");
#else
return; // TODO It's really hard to write testing code for this.