|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef TESTRUNNER_H |
|
19 #define TESTRUNNER_H |
|
20 |
|
21 #include <QXmlDefaultHandler> |
|
22 |
|
23 |
|
24 class TestRunner : public QXmlDefaultHandler |
|
25 { |
|
26 public: // Constructors and destructor |
|
27 TestRunner(const QString& name); |
|
28 ~TestRunner(); |
|
29 |
|
30 public: // New functions |
|
31 |
|
32 int runTests(QObject& testObject); |
|
33 void printResults(); |
|
34 |
|
35 protected: // From QXmlContentHandler |
|
36 bool startElement( |
|
37 const QString& namespaceURI, |
|
38 const QString& localName, |
|
39 const QString& qName, |
|
40 const QXmlAttributes& atts); |
|
41 |
|
42 bool endElement( |
|
43 const QString& namespaceURI, |
|
44 const QString& localName, |
|
45 const QString& qName); |
|
46 |
|
47 bool characters(const QString& ch); |
|
48 |
|
49 private: // New functions |
|
50 |
|
51 void parse(const QString& fileName); |
|
52 |
|
53 private: // Data |
|
54 QStringList mTestRunParams; |
|
55 QString mHomeDir; |
|
56 int mTestCount; |
|
57 QStringList mErrors; |
|
58 bool mParsingIncidentElement; |
|
59 bool mParsingDescriptionElement; |
|
60 bool mCurrentTestFailed; |
|
61 QString mCurrentTestName; |
|
62 QString mCurrentTestFile; |
|
63 int mCurrentTestFailureLine; |
|
64 }; |
|
65 |
|
66 |
|
67 #endif // TESTRUNNER_H |