jasmine-headless-webkit/ext/jasmine-webkit-specrunner/Runner.h

65 lines
1.2 KiB
C
Raw Normal View History

2011-08-01 17:09:08 +00:00
#ifndef JHW_RUNNER
#define JHW_RUNNER
#include <QtGui>
#include <QtWebKit>
#include <QFile>
#include <QTextStream>
#include <iostream>
#include <fstream>
2011-08-01 17:09:08 +00:00
#include <QQueue>
#include "Page.h"
using namespace std;
class Runner: public QObject {
Q_OBJECT
public:
enum { TIMER_TICK = 200, MAX_LOOPS = 50 };
2011-09-06 15:37:29 +00:00
Runner();
void setColors(bool colors);
void reportFile(const QString &file);
void addFile(const QString &spec);
void go();
2011-10-26 02:22:29 +00:00
2011-10-25 15:25:02 +00:00
public slots:
2011-09-06 15:37:29 +00:00
void timerPause();
void timerDone();
void hasUsedConsole();
2011-10-26 02:22:29 +00:00
void hasError();
2011-11-05 18:19:41 +00:00
void hasSpecFailure();
void print(const QString &fh, const QString &content);
void finishSuite();
void ping();
2011-10-26 02:22:29 +00:00
2011-10-25 15:25:02 +00:00
private slots:
void watch(bool ok);
void addJHW();
2011-09-06 15:37:29 +00:00
void timerEvent();
void handleError(const QString & message, int lineNumber, const QString & sourceID);
2011-10-26 02:22:29 +00:00
private:
2011-10-26 02:22:29 +00:00
Page page;
QTimer ticker;
int runs;
bool hasErrors;
2011-11-05 18:19:41 +00:00
bool _hasSpecFailure;
bool usedConsole;
bool isFinished;
bool useColors;
QQueue<QString> runnerFiles;
QString reportFileName;
void loadSpec();
QQueue<QFile *> outputFiles;
QFile *outputFile;
};
2011-08-01 17:09:08 +00:00
#endif