| 1 | /**************************************************************************** | 
| 2 | ** | 
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | 
| 4 | ** Contact: https://www.qt.io/licensing/ | 
| 5 | ** | 
| 6 | ** This file is part of the test suite of the Qt Toolkit. | 
| 7 | ** | 
| 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ | 
| 9 | ** Commercial License Usage | 
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | 
| 11 | ** accordance with the commercial license agreement provided with the | 
| 12 | ** Software or, alternatively, in accordance with the terms contained in | 
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | 
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | 
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | 
| 16 | ** | 
| 17 | ** GNU General Public License Usage | 
| 18 | ** Alternatively, this file may be used under the terms of the GNU | 
| 19 | ** General Public License version 3 as published by the Free Software | 
| 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT | 
| 21 | ** included in the packaging of this file. Please review the following | 
| 22 | ** information to ensure the GNU General Public License requirements will | 
| 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. | 
| 24 | ** | 
| 25 | ** $QT_END_LICENSE$ | 
| 26 | ** | 
| 27 | ****************************************************************************/ | 
| 28 |  | 
| 29 |  | 
| 30 | #ifndef Q_tst_SuiteTest | 
| 31 | #define Q_tst_SuiteTest | 
| 32 |  | 
| 33 | #include <QtCore/QObject> | 
| 34 | #include "../qxmlquery/TestFundament.h" | 
| 35 |  | 
| 36 | /*! | 
| 37 |  \class tst_SuiteTest | 
| 38 |  \internal | 
| 39 |  \since 4.5 | 
| 40 |  \brief Base class for tst_XmlPatternsXQTS, tst_XmlPatternsXSLTS and tst_XmlPatternsXSDTS. | 
| 41 |  */ | 
| 42 | class tst_SuiteTest : public QObject | 
| 43 |                     , private TestFundament | 
| 44 | { | 
| 45 |     Q_OBJECT | 
| 46 |  | 
| 47 | public: | 
| 48 |     enum SuiteType | 
| 49 |     { | 
| 50 |         XQuerySuite, | 
| 51 |         XsltSuite, | 
| 52 |         XsdSuite | 
| 53 |     }; | 
| 54 |  | 
| 55 | protected: | 
| 56 |     /** | 
| 57 |      * @p isXSLT is @c true if the catalog opened is an | 
| 58 |      * XSL-T test suite. | 
| 59 |      * | 
| 60 |      * @p alwaysRun is @c true if the test should always be run, | 
| 61 |      * regardless of if the file runTests exists. | 
| 62 |      */ | 
| 63 |     tst_SuiteTest(SuiteType type, | 
| 64 |                   const bool alwaysRun = false); | 
| 65 |  | 
| 66 |     /** | 
| 67 |      * The reason why we pass in a mutable reference and have void as return | 
| 68 |      * value instead of simply returning the string, is that we in some | 
| 69 |      * implementations use QTestLib's macros such as QVERIFY, which contains | 
| 70 |      * return statements. Yay for QTestLib. | 
| 71 |      */ | 
| 72 |     virtual void catalogPath(QString &write) const = 0; | 
| 73 |  | 
| 74 |     bool dontRun() const; | 
| 75 |  | 
| 76 | private Q_SLOTS: | 
| 77 |     void initTestCase(); | 
| 78 |     void runTestSuite() const; | 
| 79 |     void checkTestSuiteResult() const; | 
| 80 |  | 
| 81 | protected: | 
| 82 |     /** | 
| 83 |      * An absolute path to the catalog. | 
| 84 |      */ | 
| 85 |     QString         m_catalogPath; | 
| 86 |     QString   m_existingBaseline; | 
| 87 |     const QString   m_candidateBaseline; | 
| 88 |     const bool      m_abortRun; | 
| 89 |     const SuiteType m_suiteType; | 
| 90 | }; | 
| 91 |  | 
| 92 | #endif | 
| 93 |  | 
| 94 | // vim: et:ts=4:sw=4:sts=4 | 
| 95 |  |