diff --git a/ext/jasmine-webkit-specrunner/ConsoleOutput.cpp b/ext/jasmine-webkit-specrunner/ConsoleOutput.cpp deleted file mode 100644 index c686599..0000000 --- a/ext/jasmine-webkit-specrunner/ConsoleOutput.cpp +++ /dev/null @@ -1,149 +0,0 @@ -#include "ConsoleOutput.h" - -ConsoleOutput::ConsoleOutput() : QObject(), - showColors(false), - consoleLogUsed(false) { - outputIO = &std::cout; - } - -void ConsoleOutput::passed(const QString &specDetail) { - green(); - *outputIO << '.'; - clear(); - outputIO->flush(); - - consoleLogUsed = false; - successes.push(specDetail); -} - -void ConsoleOutput::failed(const QString &specDetail) { - red(); - *outputIO << 'F'; - clear(); - outputIO->flush(); - - consoleLogUsed = false; - failures.push(specDetail); -} - -void ConsoleOutput::green() { - if (showColors) std::cout << "\033[0;32m"; -} - -void ConsoleOutput::clear() { - if (showColors) std::cout << "\033[m"; -} - -void ConsoleOutput::red() { - if (showColors) std::cout << "\033[0;31m"; -} - -void ConsoleOutput::yellow() -{ - if (showColors) std::cout << "\033[0;33m"; -} - -void ConsoleOutput::errorLog(const QString &msg, int lineNumber, const QString &sourceID) { - red(); - *outputIO << "[error] "; - clear(); - *outputIO << qPrintable(sourceID) << ":" << lineNumber << " : " << qPrintable(msg); - *outputIO << std::endl; -} - -void ConsoleOutput::internalLog(const QString ¬e, const QString &msg) { - red(); - *outputIO << "[" << qPrintable(note) << "] "; - clear(); - *outputIO << qPrintable(msg); - *outputIO << std::endl; -} - -void ConsoleOutput::consoleLog(const QString &msg) { - if (!consoleLogUsed) { - *outputIO << std::endl; - consoleLogUsed = true; - } - - green(); - *outputIO << "[console] "; - if (msg.contains("\n")) - *outputIO << std::endl; - clear(); - *outputIO << qPrintable(msg); - *outputIO << std::endl; -} - -void ConsoleOutput::logSpecFilename(const QString &name) { - *outputIO << std::endl << std::endl; - red(); - *outputIO << qPrintable(name) << std::endl; - clear(); -} - -void ConsoleOutput::logSpecResult(const QString &result) { - QStringList lines = result.split("\n"); - QStringListIterator linesIterator(lines); - - red(); - while (linesIterator.hasNext()) { - QString line = linesIterator.next(); - if (!linesIterator.hasNext()) - yellow(); - *outputIO << " " << qPrintable(line) << std::endl; - } - - clear(); -} - -void ConsoleOutput::reportFailure(const QString &totalTests, const QString &failedTests, const QString &duration) { - red(); - *outputIO << std::endl << "FAIL: "; - formatTestResults(totalTests, failedTests, duration); - *outputIO << std::endl; - clear(); -} - -void ConsoleOutput::reportSuccess(const QString &totalTests, const QString &failedTests, const QString &duration) { - green(); - *outputIO << std::endl << "PASS: "; - formatTestResults(totalTests, failedTests, duration); - *outputIO << std::endl; - clear(); -} - -void ConsoleOutput::reportSuccessWithJSErrors(const QString &totalTests, const QString &failedTests, const QString &duration) { - yellow(); - *outputIO << std::endl << "PASS with JS errors: "; - formatTestResults(totalTests, failedTests, duration); - *outputIO << std::endl; - clear(); -} - -void ConsoleOutput::formatTestResults(const QString &totalTests, const QString &failedTests, const QString &duration) { - *outputIO << qPrintable(totalTests) << " "; - if (totalTests == "1") { - *outputIO << "test"; - } else { - *outputIO << "tests"; - } - - *outputIO << ", "; - - *outputIO << qPrintable(failedTests) << " "; - if (failedTests == "1") { - *outputIO << "failure"; - } else { - *outputIO << "failures"; - } - - *outputIO << ", "; - - *outputIO << qPrintable(duration) << " "; - if (duration == "1") { - *outputIO << "sec."; - } else { - *outputIO << "secs."; - } -} - diff --git a/ext/jasmine-webkit-specrunner/ConsoleOutput.h b/ext/jasmine-webkit-specrunner/ConsoleOutput.h deleted file mode 100644 index b15004b..0000000 --- a/ext/jasmine-webkit-specrunner/ConsoleOutput.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef JHW_CONSOLE_OUTPUT -#define JHW_CONSOLE_OUTPUT - -#include -#include -#include -#include - -class ConsoleOutput : public QObject { - public: - ConsoleOutput(); - - void passed(const QString &specDetail); - void failed(const QString &specDetail); - void errorLog(const QString &msg, int lineNumber, const QString &sourceID); - void internalLog(const QString ¬e, 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); - - std::ostream *outputIO; - QStack successes; - QStack failures; - - bool showColors; - bool consoleLogUsed; - private: - void green(); - void clear(); - void red(); - void yellow(); - void formatTestResults(const QString &totalTests, const QString &failedTests, const QString &duration); -}; - -#endif diff --git a/ext/jasmine-webkit-specrunner/ConsoleOutput_test.cpp b/ext/jasmine-webkit-specrunner/ConsoleOutput_test.cpp deleted file mode 100644 index dccdd52..0000000 --- a/ext/jasmine-webkit-specrunner/ConsoleOutput_test.cpp +++ /dev/null @@ -1,129 +0,0 @@ -#include - -#include "ConsoleOutput.h" -#include "ConsoleOutput_test.h" - -using namespace std; - - ConsoleOutputTest::ConsoleOutputTest() : QObject() {} - - void ConsoleOutputTest::testPassed() { - stringstream buffer; - ConsoleOutput output; - - output.consoleLogUsed = true; - output.outputIO = &buffer; - output.passed("test"); - QVERIFY(buffer.str() == "."); - QVERIFY(output.successes.size() == 1); - QVERIFY(output.failures.size() == 0); - QVERIFY(output.consoleLogUsed == false); - } - - void ConsoleOutputTest::testFailed() { - stringstream buffer; - ConsoleOutput output; - - output.consoleLogUsed = true; - output.outputIO = &buffer; - output.failed("test"); - QVERIFY(buffer.str() == "F"); - QVERIFY(output.successes.size() == 0); - QVERIFY(output.failures.size() == 1); - QVERIFY(output.consoleLogUsed == false); - } - - void ConsoleOutputTest::testErrorLog() { - stringstream buffer; - ConsoleOutput output; - - output.outputIO = &buffer; - output.errorLog("message", 1, "source"); - QVERIFY(buffer.str() == "[error] source:1 : message\n"); - } - - void ConsoleOutputTest::testInternalLog() { - stringstream buffer; - ConsoleOutput output; - - output.outputIO = &buffer; - output.internalLog("note", "message"); - QVERIFY(buffer.str() == "[note] message\n"); - } - - void ConsoleOutputTest::testConsoleLog() { - stringstream buffer; - ConsoleOutput output; - - output.consoleLogUsed = false; - output.outputIO = &buffer; - output.consoleLog("log"); - QVERIFY(buffer.str() == "\n[console] log\n"); - } - - void ConsoleOutputTest::testConsoleLogUsed() { - stringstream buffer; - ConsoleOutput output; - - output.consoleLogUsed = true; - output.outputIO = &buffer; - output.consoleLog("log"); - QVERIFY(buffer.str() == "[console] log\n"); - } - - void ConsoleOutputTest::testLogSpecFilename() { - stringstream buffer; - ConsoleOutput output; - - output.outputIO = &buffer; - output.logSpecFilename("whatever"); - QVERIFY(buffer.str() == "\n\nwhatever\n"); - } - - void ConsoleOutputTest::testLogSpecResult() { - stringstream buffer; - ConsoleOutput output; - - output.outputIO = &buffer; - output.logSpecResult("whatever"); - QVERIFY(buffer.str() == " whatever\n"); - } - - void ConsoleOutputTest::testReportResultsFailedSingular() { - stringstream buffer; - ConsoleOutput output; - - output.outputIO = &buffer; - output.reportFailure("1", "1", "1"); - QVERIFY(buffer.str() == "\nFAIL: 1 test, 1 failure, 1 sec.\n"); - } - - void ConsoleOutputTest::testReportResultsFailedPlural() { - stringstream buffer; - ConsoleOutput output; - - output.outputIO = &buffer; - output.reportFailure("2", "2", "2"); - QVERIFY(buffer.str() == "\nFAIL: 2 tests, 2 failures, 2 secs.\n"); - } - - void ConsoleOutputTest::testReportResultsSucceeded() { - stringstream buffer; - ConsoleOutput output; - - output.outputIO = &buffer; - output.reportSuccess("2", "2", "2"); - QVERIFY(buffer.str() == "\nPASS: 2 tests, 2 failures, 2 secs.\n"); - } - - void ConsoleOutputTest::testReportResultsSucceededWithJSErrors() { - stringstream buffer; - ConsoleOutput output; - - output.outputIO = &buffer; - output.reportSuccessWithJSErrors("2", "2", "2"); - QVERIFY(buffer.str() == "\nPASS with JS errors: 2 tests, 2 failures, 2 secs.\n"); - } - -QTEST_MAIN(ConsoleOutputTest); - diff --git a/ext/jasmine-webkit-specrunner/ConsoleOutput_test.h b/ext/jasmine-webkit-specrunner/ConsoleOutput_test.h deleted file mode 100644 index 246e231..0000000 --- a/ext/jasmine-webkit-specrunner/ConsoleOutput_test.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef JHW_TEST_CONSOLE_OUTPUT -#define JHW_TEST_CONSOLE_OUTPUT - -#include -#include -#include -#include - -#include "ConsoleOutput.h" - -class ConsoleOutputTest : public QObject { - Q_OBJECT - public: - ConsoleOutputTest(); - - private slots: - void testPassed(); - void testFailed(); - void testErrorLog(); - void testInternalLog(); - void testConsoleLog(); - void testConsoleLogUsed(); - void testLogSpecFilename(); - void testLogSpecResult(); - - void testReportResultsFailedSingular(); - void testReportResultsFailedPlural(); - void testReportResultsSucceeded(); - void testReportResultsSucceededWithJSErrors(); -}; - -#endif diff --git a/ext/jasmine-webkit-specrunner/ConsoleOutput_test.pro b/ext/jasmine-webkit-specrunner/ConsoleOutput_test.pro deleted file mode 100644 index 7b09285..0000000 --- a/ext/jasmine-webkit-specrunner/ConsoleOutput_test.pro +++ /dev/null @@ -1,7 +0,0 @@ -include(common.pri) -include(test.pri) - -SOURCES += ConsoleOutput_test.cpp -HEADERS += ConsoleOutput_test.h - - diff --git a/ext/jasmine-webkit-specrunner/ReportFileOutput.cpp b/ext/jasmine-webkit-specrunner/ReportFileOutput.cpp deleted file mode 100644 index b215e47..0000000 --- a/ext/jasmine-webkit-specrunner/ReportFileOutput.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "ReportFileOutput.h" - -using namespace std; - -ReportFileOutput::ReportFileOutput() : QObject() { - reset(); -} - -void ReportFileOutput::reset() { - buffer = new stringstream(); - - outputIO = buffer; -} - -void ReportFileOutput::passed(const QString &specDetail) { - *outputIO << "PASS||" << qPrintable(specDetail) << std::endl; - successes.push(specDetail); -} - -void ReportFileOutput::failed(const QString &specDetail) { - *outputIO << "FAIL||" << qPrintable(specDetail) << std::endl; - failures.push(specDetail); -} - -void ReportFileOutput::errorLog(const QString &msg, int lineNumber, const QString &sourceID) { - *outputIO << "ERROR||" << qPrintable(msg) << "||" << qPrintable(sourceID) << ":" << lineNumber << std::endl; -} - -void ReportFileOutput::consoleLog(const QString &msg) { - *outputIO << "CONSOLE||" << qPrintable(msg) << std::endl; -} - -void ReportFileOutput::internalLog(const QString &, const QString &) {} -void ReportFileOutput::logSpecFilename(const QString &) {} -void ReportFileOutput::logSpecResult(const QString &) {} - -void ReportFileOutput::reportFailure(const QString &totalTests, const QString &failedTests, const QString &duration) { - reportTotals(totalTests, failedTests, duration, false); -} - -void ReportFileOutput::reportSuccess(const QString &totalTests, const QString &failedTests, const QString &duration) { - reportTotals(totalTests, failedTests, duration, false); -} - -void ReportFileOutput::reportSuccessWithJSErrors(const QString &totalTests, const QString &failedTests, const QString &duration) { - reportTotals(totalTests, failedTests, duration, true); -} - -void ReportFileOutput::reportTotals(const QString &totalTests, const QString &failedTests, const QString &duration, bool hasJavaScriptError) { - *outputIO << "TOTAL||" << qPrintable(totalTests) << "||" << qPrintable(failedTests) << "||" << qPrintable(duration) << "||"; - *outputIO << (hasJavaScriptError ? "T" : "F"); - *outputIO << std::endl; -} - diff --git a/ext/jasmine-webkit-specrunner/ReportFileOutput.h b/ext/jasmine-webkit-specrunner/ReportFileOutput.h deleted file mode 100644 index 30b4f02..0000000 --- a/ext/jasmine-webkit-specrunner/ReportFileOutput.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef JHW_REPORT_FILE_OUTPUT -#define JHW_REPORT_FILE_OUTPUT - -#include -#include -#include -#include - -using namespace std; - -class ReportFileOutput : public QObject { - public: - ReportFileOutput(); - - void passed(const QString &specDetail); - void failed(const QString &specDetail); - void errorLog(const QString &msg, int lineNumber, const QString &sourceID); - void internalLog(const QString ¬e, 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); - - void reset(); - - stringstream *buffer; - stringstream *outputIO; - QStack successes; - QStack failures; - private: - void reportTotals(const QString &totalTests, const QString &failedTests, const QString &duration, bool hasJavaScriptError); -}; - -#endif diff --git a/ext/jasmine-webkit-specrunner/ReportFileOutput_test.cpp b/ext/jasmine-webkit-specrunner/ReportFileOutput_test.cpp deleted file mode 100644 index bc5b9e4..0000000 --- a/ext/jasmine-webkit-specrunner/ReportFileOutput_test.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include - -#include "ReportFileOutput.h" -#include "ReportFileOutput_test.h" - -using namespace std; - -ReportFileOutputTest::ReportFileOutputTest() : QObject() {} - -void ReportFileOutputTest::testPassed() { - stringstream buffer; - ReportFileOutput output; - - output.outputIO = &buffer; - output.passed("test||done||file.js:23"); - QVERIFY(buffer.str() == "PASS||test||done||file.js:23\n"); - QVERIFY(output.successes.size() == 1); - QVERIFY(output.failures.size() == 0); -} - -void ReportFileOutputTest::testFailed() { - stringstream buffer; - ReportFileOutput output; - - output.outputIO = &buffer; - output.failed("test||done||file.js:23"); - QVERIFY(buffer.str() == "FAIL||test||done||file.js:23\n"); - QVERIFY(output.successes.size() == 0); - QVERIFY(output.failures.size() == 1); -} - -void ReportFileOutputTest::testErrorLog() { - stringstream buffer; - ReportFileOutput output; - - output.outputIO = &buffer; - output.errorLog("JS Error", 23, "file.js"); - QVERIFY(buffer.str() == "ERROR||JS Error||file.js:23\n"); -} - -void ReportFileOutputTest::testConsoleLog() { - stringstream buffer; - ReportFileOutput output; - - output.outputIO = &buffer; - output.consoleLog("Console"); - QVERIFY(buffer.str() == "CONSOLE||Console\n"); -} - -void ReportFileOutputTest::testStubMethods() { - stringstream buffer; - ReportFileOutput output; - - output.outputIO = &buffer; - output.internalLog("Internal", "Log"); - output.logSpecFilename("Filename"); - output.logSpecResult("REsult"); -} - -void ReportFileOutputTest::testReportFailure() { - stringstream buffer; - ReportFileOutput output; - - output.outputIO = &buffer; - output.reportFailure("5", "2", "1.5"); - QVERIFY(buffer.str() == "TOTAL||5||2||1.5||F\n"); -} - -void ReportFileOutputTest::testReportSuccess() { - stringstream buffer; - ReportFileOutput output; - - output.outputIO = &buffer; - output.reportSuccess("5", "0", "1.5"); - QVERIFY(buffer.str() == "TOTAL||5||0||1.5||F\n"); -} - -void ReportFileOutputTest::testReportSuccessWithJSErrors() { - stringstream buffer; - ReportFileOutput output; - - output.outputIO = &buffer; - output.reportSuccessWithJSErrors("5", "0", "1.5"); - QVERIFY(buffer.str() == "TOTAL||5||0||1.5||T\n"); -} - -QTEST_MAIN(ReportFileOutputTest); - diff --git a/ext/jasmine-webkit-specrunner/ReportFileOutput_test.h b/ext/jasmine-webkit-specrunner/ReportFileOutput_test.h deleted file mode 100644 index 8b46a60..0000000 --- a/ext/jasmine-webkit-specrunner/ReportFileOutput_test.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef JHW_TEST_REPORT_FILE_OUTPUT -#define JHW_TEST_REPORT_FILE_OUTPUT - -#include -#include -#include -#include - -#include "ReportFileOutput.h" - -class ReportFileOutputTest : public QObject { - Q_OBJECT - public: - ReportFileOutputTest(); - private slots: - void testPassed(); - void testFailed(); - void testErrorLog(); - void testConsoleLog(); - void testStubMethods(); - void testReportFailure(); - void testReportSuccess(); - void testReportSuccessWithJSErrors(); -}; - -#endif diff --git a/ext/jasmine-webkit-specrunner/ReportFileOutput_test.pro b/ext/jasmine-webkit-specrunner/ReportFileOutput_test.pro deleted file mode 100644 index 12485f0..0000000 --- a/ext/jasmine-webkit-specrunner/ReportFileOutput_test.pro +++ /dev/null @@ -1,7 +0,0 @@ -include(common.pri) -include(test.pri) - -SOURCES += ReportFileOutput_test.cpp -HEADERS += ReportFileOutput_test.h - - diff --git a/ext/jasmine-webkit-specrunner/Runner.cpp b/ext/jasmine-webkit-specrunner/Runner.cpp index bf32dc2..0a67f8c 100644 --- a/ext/jasmine-webkit-specrunner/Runner.cpp +++ b/ext/jasmine-webkit-specrunner/Runner.cpp @@ -92,6 +92,10 @@ void Runner::setColors(bool colors) { useColors = colors; } +void Runner::hasUsedConsole() { + usedConsole = true; +} + void Runner::reportFile(const QString &file) { reportFileName = file; } diff --git a/ext/jasmine-webkit-specrunner/Runner.h b/ext/jasmine-webkit-specrunner/Runner.h index 5b0f2eb..1a98d1d 100644 --- a/ext/jasmine-webkit-specrunner/Runner.h +++ b/ext/jasmine-webkit-specrunner/Runner.h @@ -27,6 +27,8 @@ class Runner: public QObject { void timerPause(); void timerDone(); + void hasUsedConsole(); + void print(const QString &fh, const QString &content); void finishSuite(); @@ -35,8 +37,6 @@ class Runner: public QObject { void addJHW(); void timerEvent(); void handleError(const QString & message, int lineNumber, const QString & sourceID); - protected: - bool hasElement(const char *select); private: Page m_page; QTimer m_ticker; @@ -48,7 +48,6 @@ class Runner: public QObject { bool useColors; QQueue runnerFiles; - QStack failedSpecs; QString reportFileName; diff --git a/ext/jasmine-webkit-specrunner/_old/Page_test.cpp b/ext/jasmine-webkit-specrunner/_old/Page_test.cpp deleted file mode 100644 index 7cc213a..0000000 --- a/ext/jasmine-webkit-specrunner/_old/Page_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include - -#include "Page.h" -#include "Page_test.h" - - PageTest::PageTest() : QObject(), internalLogCalled(false) { - } - - void PageTest::internalLog(const QString &, const QString &) { - internalLogCalled = true; - } - - void PageTest::consoleLog(const QString &, int, const QString &) { - consoleLogCalled = true; - } - - void PageTest::testJavaScriptConfirmWithLog() { - connect(&page, SIGNAL(internalLog(QString, QString)), this, SLOT(internalLog(QString, QString))); - internalLogCalled = false; - - page.mainFrame()->setHtml(""); - QVERIFY(internalLogCalled); - } - - void PageTest::testJavaScriptConfirmWithoutLog() { - connect(&page, SIGNAL(internalLog(QString, QString)), this, SLOT(internalLog(QString, QString))); - internalLogCalled = false; - - page.oneFalseConfirm(); - page.mainFrame()->setHtml(""); - QVERIFY(!internalLogCalled); - } - - void PageTest::testJavaScriptConsoleMessage() { - connect(&page, SIGNAL(consoleLog(QString, int, QString)), this, SLOT(consoleLog(QString, int, QString))); - consoleLogCalled = false; - - page.mainFrame()->setHtml(""); - QVERIFY(consoleLogCalled); - } - -QTEST_MAIN(PageTest); - diff --git a/ext/jasmine-webkit-specrunner/_old/Page_test.h b/ext/jasmine-webkit-specrunner/_old/Page_test.h deleted file mode 100644 index dcd7872..0000000 --- a/ext/jasmine-webkit-specrunner/_old/Page_test.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef JHW_TEST_PAGE -#define JHW_TEST_PAGE - -#include - -#include "Page.h" - - class PageTest : public QObject { - Q_OBJECT - public: - PageTest(); - - private: - bool internalLogCalled; - bool consoleLogCalled; - Page page; - - private slots: - void internalLog(const QString ¬e, const QString &msg); - void consoleLog(const QString &message, int lineNumber, const QString &source); - void testJavaScriptConfirmWithLog(); - void testJavaScriptConfirmWithoutLog(); - void testJavaScriptConsoleMessage(); - }; - -#endif - diff --git a/ext/jasmine-webkit-specrunner/_old/Page_test.pro b/ext/jasmine-webkit-specrunner/_old/Page_test.pro deleted file mode 100644 index 9482e83..0000000 --- a/ext/jasmine-webkit-specrunner/_old/Page_test.pro +++ /dev/null @@ -1,6 +0,0 @@ -include(common.pri) -include(test.pri) - -SOURCES += Page_test.cpp -HEADERS += Page_test.h - diff --git a/ext/jasmine-webkit-specrunner/test.pri b/ext/jasmine-webkit-specrunner/test.pri deleted file mode 100644 index 4804421..0000000 --- a/ext/jasmine-webkit-specrunner/test.pri +++ /dev/null @@ -1,3 +0,0 @@ -TARGET = jhw-test -QT += testlib - diff --git a/ext/jasmine-webkit-specrunner/test.rb b/ext/jasmine-webkit-specrunner/test.rb deleted file mode 100644 index 0caf700..0000000 --- a/ext/jasmine-webkit-specrunner/test.rb +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env ruby - -require 'fileutils' - -system %{make clean} - -$: << File.expand_path("../../../lib", __FILE__) -require 'qt/qmake' - -result = 0 - -Dir['*_test.pro'].each do |test| - FileUtils.rm_f('jhw-test') - - Qt::Qmake.make!('jasmine-headless-webkit', test) - - if File.file?('jhw-test') - system %{./jhw-test} - if $?.exitstatus != 0 - result = 1 - break - end - else - result = 1 - break - end -end - -Qt::Qmake.make!('jasmine-headless-webkit', 'specrunner.pro') - -exit result diff --git a/jasmine/jasmine.headless-reporter.coffee b/jasmine/jasmine.headless-reporter.coffee index 22fd83f..ac3c0cb 100644 --- a/jasmine/jasmine.headless-reporter.coffee +++ b/jasmine/jasmine.headless-reporter.coffee @@ -7,7 +7,7 @@ class jasmine.HeadlessReporter @results = [] @failedCount = 0 @length = 0 - @_hasError = false + reportRunnerResults: (runner) -> return if this.hasError() diff --git a/jasmine/jasmine.headless-reporter.js b/jasmine/jasmine.headless-reporter.js index 1adb21a..9027453 100644 --- a/jasmine/jasmine.headless-reporter.js +++ b/jasmine/jasmine.headless-reporter.js @@ -8,7 +8,6 @@ this.results = []; this.failedCount = 0; this.length = 0; - this._hasError = false; } HeadlessReporter.prototype.reportRunnerResults = function(runner) { var result, resultLine, runtime, _i, _len, _ref; diff --git a/spec/javascripts/jasmine.headless-reporter_spec.coffee b/spec/javascripts/jasmine.headless-reporter_spec.coffee index edc5099..f70203e 100644 --- a/spec/javascripts/jasmine.headless-reporter_spec.coffee +++ b/spec/javascripts/jasmine.headless-reporter_spec.coffee @@ -30,7 +30,7 @@ describe 'jasmine.HeadlessReporter', -> reporter.reportSpecStarting(spec) - expect(spec.finish).not.toHaveBeenCalled() + expect(spec.finish).toHaveBeenCalled() expect(suite.finish).toHaveBeenCalled() describe 'jasmine.Suite.prototype.getSuiteSplitName', ->