qt cleanup
This commit is contained in:
parent
60713fc88f
commit
22577e0fdc
@ -0,0 +1,14 @@
|
||||
#ifndef JHW_CONSOLE_REPORTER
|
||||
#define JHW_CONSOLE_REPORTER
|
||||
|
||||
namespace HeadlessSpecRunner {
|
||||
class ConsoleReporter : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ConsoleReporter();
|
||||
void passed(const QString &specDetail);
|
||||
void failed(const QString &specDetail);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
79
ext/jasmine-webkit-specrunner/Page_test.moc
Normal file
79
ext/jasmine-webkit-specrunner/Page_test.moc
Normal file
@ -0,0 +1,79 @@
|
||||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'Page_test.cpp'
|
||||
**
|
||||
** Created: Tue Aug 2 10:10:26 2011
|
||||
** by: The Qt Meta Object Compiler version 62 (Qt 4.7.3)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION)
|
||||
#error "The header file 'Page_test.cpp' doesn't include <QObject>."
|
||||
#elif Q_MOC_OUTPUT_REVISION != 62
|
||||
#error "This file was generated using the moc from 4.7.3. It"
|
||||
#error "cannot be used with the include files from this version of Qt."
|
||||
#error "(The moc has changed too much.)"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_MOC_NAMESPACE
|
||||
static const uint qt_meta_data_HeadlessSpecRunner__PageTestHelper[] = {
|
||||
|
||||
// content:
|
||||
5, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
1, 14, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
0, // flags
|
||||
0, // signalCount
|
||||
|
||||
// slots: signature, parameters, type, tag, flags
|
||||
45, 36, 35, 35, 0x0a,
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
static const char qt_meta_stringdata_HeadlessSpecRunner__PageTestHelper[] = {
|
||||
"HeadlessSpecRunner::PageTestHelper\0\0"
|
||||
"note,msg\0internalLog(QString,QString)\0"
|
||||
};
|
||||
|
||||
const QMetaObject HeadlessSpecRunner::PageTestHelper::staticMetaObject = {
|
||||
{ &QObject::staticMetaObject, qt_meta_stringdata_HeadlessSpecRunner__PageTestHelper,
|
||||
qt_meta_data_HeadlessSpecRunner__PageTestHelper, 0 }
|
||||
};
|
||||
|
||||
#ifdef Q_NO_DATA_RELOCATION
|
||||
const QMetaObject &HeadlessSpecRunner::PageTestHelper::getStaticMetaObject() { return staticMetaObject; }
|
||||
#endif //Q_NO_DATA_RELOCATION
|
||||
|
||||
const QMetaObject *HeadlessSpecRunner::PageTestHelper::metaObject() const
|
||||
{
|
||||
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
|
||||
}
|
||||
|
||||
void *HeadlessSpecRunner::PageTestHelper::qt_metacast(const char *_clname)
|
||||
{
|
||||
if (!_clname) return 0;
|
||||
if (!strcmp(_clname, qt_meta_stringdata_HeadlessSpecRunner__PageTestHelper))
|
||||
return static_cast<void*>(const_cast< PageTestHelper*>(this));
|
||||
return QObject::qt_metacast(_clname);
|
||||
}
|
||||
|
||||
int HeadlessSpecRunner::PageTestHelper::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
_id = QObject::qt_metacall(_c, _id, _a);
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
switch (_id) {
|
||||
case 0: internalLog((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2]))); break;
|
||||
default: ;
|
||||
}
|
||||
_id -= 1;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
QT_END_MOC_NAMESPACE
|
36
ext/jasmine-webkit-specrunner/Test/Page_test.cpp
Normal file
36
ext/jasmine-webkit-specrunner/Test/Page_test.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
#include <QtGui>
|
||||
#include <QtWebKit>
|
||||
#include <unit++.h>
|
||||
|
||||
#include "HeadlessSpecRunner/Page.h"
|
||||
#include "Test/Page_test.h"
|
||||
|
||||
using namespace unitpp;
|
||||
|
||||
namespace HeadlessSpecRunner {
|
||||
PageTestHelper::PageTestHelper() : QObject(), internalLogCalled(false) {}
|
||||
|
||||
void PageTestHelper::addPage(HeadlessSpecRunner::Page &page) {
|
||||
connect(&page, SIGNAL(internalLog(QString, QString)), this, SLOT(internalLog(QString, QString)));
|
||||
}
|
||||
|
||||
void PageTestHelper::internalLog(const QString ¬e, const QString &msg) {
|
||||
internalLogCalled = true;
|
||||
}
|
||||
|
||||
PageTest::PageTest() : suite("suite") {
|
||||
add("test", testcase(this, "test", &HeadlessSpecRunner::PageTest::testJavaScriptConfirmWithLog));
|
||||
suite::main().add("test", this);
|
||||
}
|
||||
|
||||
void PageTest::testJavaScriptConfirmWithLog() {
|
||||
helper.addPage(page);
|
||||
helper.internalLogCalled = false;
|
||||
|
||||
page.mainFrame()->setHtml("<script>confirm('test')</script>");
|
||||
assert_true("internal log called", helper.internalLogCalled);
|
||||
}
|
||||
}
|
||||
|
||||
HeadlessSpecRunner::PageTest *one = new HeadlessSpecRunner::PageTest();
|
||||
|
34
ext/jasmine-webkit-specrunner/Test/Page_test.h
Normal file
34
ext/jasmine-webkit-specrunner/Test/Page_test.h
Normal file
@ -0,0 +1,34 @@
|
||||
#ifndef JHW_TEST_PAGE
|
||||
#define JHW_TEST_PAGE
|
||||
|
||||
#include <QtGui>
|
||||
#include <QtWebKit>
|
||||
#include <unit++.h>
|
||||
|
||||
#include "HeadlessSpecRunner/Page.h"
|
||||
|
||||
using namespace unitpp;
|
||||
|
||||
namespace HeadlessSpecRunner {
|
||||
class PageTestHelper : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
PageTestHelper();
|
||||
bool internalLogCalled;
|
||||
void addPage(HeadlessSpecRunner::Page &page);
|
||||
|
||||
public slots:
|
||||
void internalLog(const QString ¬e, const QString &msg);
|
||||
};
|
||||
|
||||
class PageTest : public suite {
|
||||
public:
|
||||
PageTest();
|
||||
HeadlessSpecRunner::Page page;
|
||||
HeadlessSpecRunner::PageTestHelper helper;
|
||||
|
||||
void testJavaScriptConfirmWithLog();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
BIN
ext/jasmine-webkit-specrunner/jasmine-webkit-specrunner-test
Executable file
BIN
ext/jasmine-webkit-specrunner/jasmine-webkit-specrunner-test
Executable file
Binary file not shown.
18
ext/jasmine-webkit-specrunner/specrunner_test.pro
Normal file
18
ext/jasmine-webkit-specrunner/specrunner_test.pro
Normal file
@ -0,0 +1,18 @@
|
||||
TEMPLATE = app
|
||||
CONFIG -= app_bundle
|
||||
TARGET = jasmine-webkit-specrunner-test
|
||||
SOURCES = HeadlessSpecRunner/Page.cpp \
|
||||
HeadlessSpecRunner/Runner.cpp \
|
||||
Test/Page_test.cpp
|
||||
|
||||
HEADERS = HeadlessSpecRunner/Page.h \
|
||||
HeadlessSpecRunner/Runner.h \
|
||||
Test/Page_test.h
|
||||
|
||||
QT += network webkit
|
||||
QMAKE_INFO_PLIST = Info.plist
|
||||
QMAKESPEC = macx-gcc
|
||||
|
||||
LIBS += -L/Users/john/Projects/unit++/lib -lunit++
|
||||
INCLUDEPATH += /Users/john/Projects/unit++/include
|
||||
|
Loading…
Reference in New Issue
Block a user