Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

Commit

Permalink
better console printing
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbintz committed May 13, 2011
1 parent 756f3d4 commit 4fdfd7b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ext/jasmine-webkit-specrunner/specrunner.cpp
Expand Up @@ -87,6 +87,7 @@ private slots:
bool showColors;
bool isFinished;
bool didFail;
bool consoleNotUsedThisRun;

void red();
void green();
Expand All @@ -102,6 +103,7 @@ HeadlessSpecRunner::HeadlessSpecRunner()
, showColors(false)
, isFinished(false)
, didFail(false)
, consoleNotUsedThisRun(false)
{
m_page.settings()->enablePersistentStorage();
connect(&m_page, SIGNAL(loadFinished(bool)), this, SLOT(watch(bool)));
Expand Down Expand Up @@ -162,6 +164,7 @@ void HeadlessSpecRunner::clear()

void HeadlessSpecRunner::specPassed()
{
consoleNotUsedThisRun = true;
green();
std::cout << '.';
clear();
Expand All @@ -170,6 +173,7 @@ void HeadlessSpecRunner::specPassed()

void HeadlessSpecRunner::specFailed()
{
consoleNotUsedThisRun = true;
didFail = true;
red();
std::cout << 'F';
Expand Down Expand Up @@ -202,6 +206,10 @@ void HeadlessSpecRunner::log(const QString &msg)
{
usedConsole = true;
green();
if (consoleNotUsedThisRun) {
std::cout << std::endl;
consoleNotUsedThisRun = false;
}
std::cout << "[console] ";
clear();
std::cout << qPrintable(msg);
Expand Down

0 comments on commit 4fdfd7b

Please sign in to comment.