From 3202ab1eb1beea0b9f73a005ef46c450f1d3248a Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Sat, 1 Apr 2023 23:18:57 +0200 Subject: [PATCH] QXmlStream: run the test suite from a method other than initTestCase() Only unzip the test suite in initTestCase(), but run the tests from runTestSuite(). This is mainly useful when running specific a unittest locally, no need to wait for the whole zipped test suite to run. Change-Id: I518a2de716d3d07fb5a78298f1bd3ab2759e744b Reviewed-by: Thiago Macieira --- .../serialization/qxmlstream/tst_qxmlstream.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp b/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp index 52025f7e23..022c81a6ec 100644 --- a/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp +++ b/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp @@ -542,6 +542,7 @@ public: private slots: void initTestCase(); void cleanupTestCase(); + void runTestSuite(); void reportFailures() const; void reportFailures_data(); void checkBaseline() const; @@ -624,7 +625,14 @@ void tst_QXmlStream::initTestCase() QFile::remove(destinationPath); // copy will fail if file exists QVERIFY(QFile::copy(fileInfo.filePath(), destinationPath)); } +} +void tst_QXmlStream::cleanupTestCase() +{ +} + +void tst_QXmlStream::runTestSuite() +{ QFile file(m_tempDir.filePath(catalogFile)); QVERIFY2(file.open(QIODevice::ReadOnly), qPrintable(QString::fromLatin1("Failed to open the test suite catalog; %1").arg(file.fileName()))); @@ -632,10 +640,6 @@ void tst_QXmlStream::initTestCase() QVERIFY(m_handler.runTests(&file)); } -void tst_QXmlStream::cleanupTestCase() -{ -} - void tst_QXmlStream::reportFailures() const { QFETCH(bool, isError);