summaryrefslogtreecommitdiff
path: root/tests/auto/xmlpatternssdk/TestCase.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-10-28 09:33:00 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-10-28 09:33:00 +0100
commit94136d42805abeaf3dd9d6ded7b74e3d27fd3777 (patch)
treee6add08b343d76fe45d076a6a604e890b547daae /tests/auto/xmlpatternssdk/TestCase.cpp
parentddf3cf7acf8e80b2e4c8018c1c8d6b6d297cc853 (diff)
parent7367d313378fb548449feda3bb0f437d29f20e8b (diff)
downloadqtxmlpatterns-94136d42805abeaf3dd9d6ded7b74e3d27fd3777.tar.gz
Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: I41beab20e4de378725e3e2efd929ddd83460d9d8
Diffstat (limited to 'tests/auto/xmlpatternssdk/TestCase.cpp')
-rw-r--r--tests/auto/xmlpatternssdk/TestCase.cpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/auto/xmlpatternssdk/TestCase.cpp b/tests/auto/xmlpatternssdk/TestCase.cpp
index d84ac06..9ae86ad 100644
--- a/tests/auto/xmlpatternssdk/TestCase.cpp
+++ b/tests/auto/xmlpatternssdk/TestCase.cpp
@@ -38,6 +38,7 @@
#include <QXmlResultItems>
#include <QXmlSerializer>
#include <private/qxmlquery_p.h>
+#include <algorithm>
#include "DebugExpressionFactory.h"
#include "ExternalSourceLoader.h"
@@ -62,9 +63,23 @@ TestCase::~TestCase()
delete m_result;
}
+static bool lessThan(const char *a, const char *b)
+{
+ return qstrcmp(a, b) < 0;
+}
+
TestResult::List TestCase::execute(const ExecutionStage stage,
TestSuite *)
{
+ ++TestCase::executions;
+
+ if ((TestCase::executions < TestCase::executeRange.first) || (TestCase::executions > TestCase::executeRange.second)) {
+ qDebug("Skipping test case #%6d", TestCase::executions);
+ return TestResult::List();
+ }
+
+ const QByteArray nm = name().toAscii();
+
if(name() == QLatin1String("Constr-cont-document-3"))
{
TestResult::List result;
@@ -95,9 +110,28 @@ TestResult::List TestCase::execute(const ExecutionStage stage,
result.append(createTestResult(TestResult::Fail, QLatin1String("Skipped this test, we crash on it.")));
return result;
}
+ else {
+ // Should be sorted in the order that std::binary_search expects
+ static const char *crashes[] = {"Constr-attr-content-4",
+ "K2-DirectConElem-12",
+ "K2-DirectConElem-50",
+ "K2-DirectConElemAttr-10",
+ "K2-DirectConElemAttr-18",
+ "K2-DirectConElemAttr-19",
+ "K2-DirectConElemAttr-20",
+ "K2-DirectConElemAttr-21"
+ };
+
+ const bool skip = std::binary_search(&crashes[0], &crashes[sizeof(crashes)/sizeof(crashes[0])], nm.constData(), lessThan);
+ if (skip) {
+ TestResult::List result;
+ result.append(createTestResult(TestResult::Fail, QLatin1String("Skipped this test, we crash on it.")));
+ return result;
+ }
+ }
- qDebug() << "Running test case: " << name();
+ qDebug("Running test case #%6d: %s", TestCase::executions, nm.constData());
return execute(stage);
Q_ASSERT(false);