2011-08-03 16:26:39 +00:00
|
|
|
#ifndef JHW_CONSOLE_OUTPUT
|
|
|
|
#define JHW_CONSOLE_OUTPUT
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <iostream>
|
|
|
|
#include <QStack>
|
|
|
|
|
|
|
|
namespace HeadlessSpecRunner {
|
|
|
|
class ConsoleOutput : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
ConsoleOutput();
|
|
|
|
void passed(const QString &specDetail);
|
|
|
|
void failed(const QString &specDetail);
|
2011-08-26 15:18:04 +00:00
|
|
|
void errorLog(const QString &msg, int lineNumber, const QString &sourceID);
|
2011-08-29 17:35:36 +00:00
|
|
|
void internalLog(const QString ¬e, const QString &msg);
|
|
|
|
void consoleLog(const QString &msg);
|
|
|
|
void logSpecFilename(const QString &name);
|
2011-08-30 15:56:35 +00:00
|
|
|
void logSpecResult(const QString &result);
|
|
|
|
|
|
|
|
void reportFailure(const QString &totalTests, const QString &failedTests, const QString &duration);
|
|
|
|
void reportSuccess(const QString &totalTests, const QString &failedTests, const QString &duration);
|
|
|
|
void reportSuccessWithJSErrors(const QString &totalTests, const QString &failedTests, const QString &duration);
|
2011-08-29 17:35:36 +00:00
|
|
|
|
2011-08-03 16:26:39 +00:00
|
|
|
std::ostream *outputIO;
|
|
|
|
QStack<QString> successes;
|
|
|
|
QStack<QString> failures;
|
|
|
|
bool showColors;
|
2011-08-29 17:35:36 +00:00
|
|
|
bool consoleLogUsed;
|
2011-08-23 23:49:47 +00:00
|
|
|
private:
|
2011-08-03 16:26:39 +00:00
|
|
|
void green();
|
|
|
|
void clear();
|
|
|
|
void red();
|
2011-08-30 15:56:35 +00:00
|
|
|
void yellow();
|
|
|
|
void formatTestResults(const QString &totalTests, const QString &failedTests, const QString &duration);
|
2011-08-03 16:26:39 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|