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

40 lines
1.3 KiB
C
Raw Normal View History

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 &note, const QString &msg);
void consoleLog(const QString &msg);
void logSpecFilename(const QString &name);
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();
void yellow();
void formatTestResults(const QString &totalTests, const QString &failedTests, const QString &duration);
2011-08-03 16:26:39 +00:00
};
}
#endif