2 * This file is part of the KDE project
4 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
23 #ifndef TEST_REGRESSION_WINDOW_H
24 #define TEST_REGRESSION_WINDOW_H
29 #include <QtCore/QQueue>
30 #include <QtCore/QProcess>
32 #include "khtml_part.h"
33 #include "ui_test_regression_gui.h"
35 class TestRegressionWindow
: public QMainWindow
40 TestRegressionWindow(QWidget
*parent
= 0);
41 virtual ~TestRegressionWindow();
44 void toggleJSTests(bool checked
);
45 void toggleHTMLTests(bool checked
);
46 void toggleDebugOutput(bool checked
);
47 void toggleNoXvfbUse(bool checked
);
49 void setTestsDirectory();
50 void setKHTMLDirectory();
51 void setOutputDirectory();
53 void directoryListingResult(KIO::Job
*job
, const KIO::UDSEntryList
&list
);
54 void directoryListingFinished(KJob
*job
);
56 void pauseContinueButtonClicked();
57 void saveLogButtonClicked();
59 void treeWidgetContextMenuRequested(const QPoint
&pos
);
66 void testerExited(int exitCode
, QProcess::ExitStatus exitStatus
);
67 void testerReceivedData();
70 void removeFromIgnores();
84 void initOutputBrowser();
85 void initTestsDirectory();
86 void initRegressionTesting(const QString
&testFileName
);
87 void updateItemStatus(TestResult result
, QTreeWidgetItem
*item
, const QString
&testFileName
);
88 void updateLogOutput(const QString
&data
);
89 void updateProgressBarRange() const;
90 void parseRegressionTestingOutput(QString data
, TestResult result
, const QString
&cacheName
);
92 unsigned long countLogLines() const;
94 QString
extractTestNameFromData(QString
&data
, TestResult
&result
) const;
95 QStringList
readListFile(const QString
&fileName
) const;
96 void writeListFile(const QString
&fileName
, const QStringList
&content
) const;
97 void loadOutputHTML() const;
99 QString
pathFromItem(const QTreeWidgetItem
*item
) const;
112 Q_DECLARE_FLAGS(ProcessArguments
, ProcessArgument
)
117 ProcessArguments m_flags
;
122 unsigned long m_totalTests
;
123 unsigned long m_totalTestsJS
;
124 unsigned long m_totalTestsDOMTS
;
131 // Temporary variables
132 TestResult m_lastResult
;
136 QPixmap m_failPixmap
;
137 QPixmap m_failKnownPixmap
;
138 QPixmap m_passPixmap
;
139 QPixmap m_passUnexpectedPixmap
;
140 QPixmap m_crashPixmap
;
141 QPixmap m_ignorePixmap
;
142 QPixmap m_noBaselinePixmap
;
144 KHTMLPart
*m_browserPart
;
145 QProcess
*m_activeProcess
;
146 QTreeWidgetItem
*m_activeTreeItem
;
149 QMap
<QString
, QTreeWidgetItem
*> m_itemMap
;
151 QMap
<QString
, QStringList
> m_ignoreMap
;
152 QMap
<QString
, QStringList
> m_failureMap
;
153 QMap
<QString
, QStringList
> m_directoryMap
;
158 bool m_justProcessingQueue
;
159 QQueue
<QString
> m_processingQueue
;
162 Q_DECLARE_OPERATORS_FOR_FLAGS(TestRegressionWindow::ProcessArguments
)
166 // vim:ts=4:tw=4:noet