1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the test suite of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
42 #ifndef PatternistSDK_TestSuite_H
43 #define PatternistSDK_TestSuite_H
48 #include "TestContainer.h"
58 namespace QPatternistSDK
61 class TestSuiteResult;
64 * @short Represents a test suite in the W3C XML Query Test Suite format.
66 * TestSuite contains the test suite's test cases and meta data.
68 * @ingroup PatternistSDK
69 * @author Frans Englich <frans.englich@nokia.com>
71 class Q_PATTERNISTSDK_EXPORT TestSuite : public TestContainer
75 * Describes the type of test suite.
79 XQuerySuite, ///< The test suite for XQuery
80 XsltSuite, ///< The test suite for XSLT
81 XsdSuite ///< The test suite for XML Schema
86 virtual QVariant data(const Qt::ItemDataRole role, int column) const;
89 * The version of the catalog test suite. For example, "0.8.0".
91 QString version() const;
94 * When the catalog was designed, last modified.
96 QDate designDate() const;
98 void setVersion(const QString &version);
99 void setDesignDate(const QDate &version);
102 * @return always @c null
104 virtual TestContainer *parent() const;
107 * Creates and returns a pointer to a TestSuite instance, which
108 * was instantiated from the XQuery Test Suite catalog file @p catalogFile.
110 * If loading went wrong, @c null is returned and @p errorMsg is set with a
111 * human readable message string. However, @p catalogFile is not validated;
112 * if the XML file is not valid against the XQTS task force's W3C XML Schema, the
113 * behavior and result for this function is undefined.
115 * This function blocks. Currently is only local files supported.
117 static TestSuite *openCatalog(const QUrl &catalogFile,
119 const bool useExclusionList,
122 void toXML(XMLWriter &receiver, TestCase *const tc) const;
125 * Evaluates all the test cases in this TestSuite, and returns
126 * it all in a TestSuiteResult.
128 TestSuiteResult *runSuite();
132 * Essentially similar to open(const QUrl &, QString &errorMsg),
133 * with the difference that it takes directly a QIODevice as input,
134 * as opposed to a file name locating the catalog file to read.
136 * @param input the test suite catalog
137 * @param fileName this URI is used for resolving relative paths inside
138 * the catalog file into absolute.
139 * @param errorMsg if an error occurs, this QString is set to contain the message.
140 * Whether an error occurred can therefore be determined by checking if this variable
141 * still is @c null after the call
142 * @param useExclusionList whether the excludeTestGroups.txt file should be used
143 * to exclude test groups for this catalog
145 static TestSuite *openCatalog(QIODevice *input,
147 const QUrl &fileName,
148 const bool useExclusionList,
160 // vim: et:ts=4:sw=4:sts=4