diff --git a/tests/auto/testlib/selftests/expected_expectfail.lightxml b/tests/auto/testlib/selftests/expected_expectfail.lightxml
index 7668dc00fe..79e5827caa 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.lightxml
+++ b/tests/auto/testlib/selftests/expected_expectfail.lightxml
@@ -9,7 +9,7 @@
-
+
@@ -21,36 +21,36 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -59,6 +59,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/auto/testlib/selftests/expected_expectfail.txt b/tests/auto/testlib/selftests/expected_expectfail.txt
index bee54c6f4d..b31245151d 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.txt
+++ b/tests/auto/testlib/selftests/expected_expectfail.txt
@@ -3,28 +3,33 @@ Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE
PASS : tst_ExpectFail::initTestCase()
QDEBUG : tst_ExpectFail::expectAndContinue() begin
XFAIL : tst_ExpectFail::expectAndContinue() This should xfail
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(68)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(70)]
QDEBUG : tst_ExpectFail::expectAndContinue() after
PASS : tst_ExpectFail::expectAndContinue()
QDEBUG : tst_ExpectFail::expectAndAbort() begin
XFAIL : tst_ExpectFail::expectAndAbort() This should xfail
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(76)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(78)]
PASS : tst_ExpectFail::expectAndAbort()
FAIL! : tst_ExpectFail::expectTwice() Already expecting a fail
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(85)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(87)]
XFAIL : tst_ExpectFail::xfailWithQString() A string
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(95)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(97)]
XFAIL : tst_ExpectFail::xfailWithQString() Bug 5 (The message)
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(100)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(102)]
PASS : tst_ExpectFail::xfailWithQString()
XPASS : tst_ExpectFail::xpass() 'true' returned FALSE. ()
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(106)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(108)]
XFAIL : tst_ExpectFail::dataDrivenTest(Abort) This test should xfail
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(139)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(141)]
XFAIL : tst_ExpectFail::dataDrivenTest(Continue) This test should xfail
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(139)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(141)]
PASS : tst_ExpectFail::dataDrivenTest()
PASS : tst_ExpectFail::expectOnWrongRow()
+XFAIL : tst_ExpectFail::expectOnAnyRow(first row) This test should xfail
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(176)]
+XFAIL : tst_ExpectFail::expectOnAnyRow(second row) This test should xfail
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(176)]
+PASS : tst_ExpectFail::expectOnAnyRow()
PASS : tst_ExpectFail::cleanupTestCase()
-Totals: 7 passed, 2 failed, 0 skipped
+Totals: 8 passed, 2 failed, 0 skipped
********* Finished testing of tst_ExpectFail *********
diff --git a/tests/auto/testlib/selftests/expected_expectfail.xml b/tests/auto/testlib/selftests/expected_expectfail.xml
index 5764d6dc8b..676a030b3f 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.xml
+++ b/tests/auto/testlib/selftests/expected_expectfail.xml
@@ -11,7 +11,7 @@
-
+
@@ -23,36 +23,36 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -61,6 +61,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/auto/testlib/selftests/expected_expectfail.xunitxml b/tests/auto/testlib/selftests/expected_expectfail.xunitxml
index 511b522c8b..328bb6433b 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.xunitxml
+++ b/tests/auto/testlib/selftests/expected_expectfail.xunitxml
@@ -1,5 +1,5 @@
-
+
@@ -29,6 +29,10 @@
+
+
+
+
@@ -39,6 +43,8 @@
+
+
diff --git a/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp b/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
index 4b9f3600ac..79325a3bfc 100644
--- a/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+++ b/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
@@ -59,6 +59,8 @@ private slots:
void dataDrivenTest() const;
void expectOnWrongRow_data() const;
void expectOnWrongRow() const;
+ void expectOnAnyRow_data() const;
+ void expectOnAnyRow() const;
};
void tst_ExpectFail::expectAndContinue() const
@@ -158,5 +160,21 @@ void tst_ExpectFail::expectOnWrongRow() const
QVERIFY(true);
}
+void tst_ExpectFail::expectOnAnyRow_data() const
+{
+ QTest::addColumn("dummy");
+
+ QTest::newRow("first row") << 0;
+ QTest::newRow("second row") << 1;
+}
+
+void tst_ExpectFail::expectOnAnyRow() const
+{
+ // In a data-driven test, passing an empty first parameter to QEXPECT_FAIL
+ // should mean that the failure is expected for all data rows.
+ QEXPECT_FAIL("", "This test should xfail", Abort);
+ QVERIFY(false);
+}
+
QTEST_MAIN(tst_ExpectFail)
#include "tst_expectfail.moc"