test_regression.cpp 66.5 KB
Newer Older
George Staikos's avatar
George Staikos committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
 * This file is part of the KDE project
 *
 * Copyright (C) 2001,2003 Peter Kelly (pmk@post.com)
 * Copyright (C) 2003,2004 Stephan Kulow (coolo@kde.org)
 * Copyright (C) 2004 Dirk Mueller ( mueller@kde.org )
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 */

Alex Merry's avatar
Alex Merry committed
25
26
#include "test_regression.h"

George Staikos's avatar
George Staikos committed
27
28
29
30
31
32
33
34
35
36
#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <pwd.h>
#include <signal.h>
#include <unistd.h>

#include <kapplication.h>
#include <kacceleratormanager.h>
37
#include <kstandarddirs.h>
Dirk Mueller's avatar
Dirk Mueller committed
38
39
#include <QtGui/QImage>
#include <QtCore/QFile>
Germain Garand's avatar
Germain Garand committed
40
#include <QtCore/QEventLoop>
George Staikos's avatar
George Staikos committed
41
42
43
44
45
46
47
#include <stdio.h>

#include "css/cssstyleselector.h"
#include <dom_string.h>
#include "rendering/render_style.h"
#include "rendering/render_layer.h"
#include "khtmldefaults.h"
Dirk Mueller's avatar
Dirk Mueller committed
48
49
50
#include <QtCore/QProcess>
#include <QtGui/QWindowsStyle>
#include <QtGui/QStyleOption>
George Staikos's avatar
George Staikos committed
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

#include <dom/dom_node.h>
#include <dom/dom_element.h>
#include <dom/dom_text.h>
#include <dom/dom_xml.h>

//We don't use the default fonts, though, but traditional testregression ones
#undef HTML_DEFAULT_VIEW_FONT
#undef HTML_DEFAULT_VIEW_FIXED_FONT
#undef HTML_DEFAULT_VIEW_SERIF_FONT
#undef HTML_DEFAULT_VIEW_SANSSERIF_FONT
#undef HTML_DEFAULT_VIEW_CURSIVE_FONT
#undef HTML_DEFAULT_VIEW_FANTASY_FONT
#define HTML_DEFAULT_VIEW_FONT "helvetica"
#define HTML_DEFAULT_VIEW_FIXED_FONT "courier"
#define HTML_DEFAULT_VIEW_SERIF_FONT "times"
#define HTML_DEFAULT_VIEW_SANSSERIF_FONT "helvetica"
#define HTML_DEFAULT_VIEW_CURSIVE_FONT "helvetica"
#define HTML_DEFAULT_VIEW_FANTASY_FONT "helvetica"

#ifdef __GNUC__
#warning "Kill this at some point"
#endif



struct PalInfo
{
    QPalette::ColorRole role;
    quint32            color;
};

PalInfo palInfo[] =
{
    {QPalette::Foreground, 0xff000000},
    {QPalette::Button, 0xffc0c0c0},
    {QPalette::Light, 0xffffffff},
    {QPalette::Midlight, 0xffdfdfdf},
    {QPalette::Dark, 0xff808080},
    {QPalette::Mid, 0xffa0a0a4},
    {QPalette::Text, 0xff000000},
    {QPalette::BrightText, 0xffffffff},
    {QPalette::ButtonText, 0xff000000},
    {QPalette::Base, 0xffffffff},
    {QPalette::Background, 0xffc0c0c0},
    {QPalette::Shadow, 0xff000000},
    {QPalette::Highlight, 0xff000080},
    {QPalette::HighlightedText, 0xffffffff},
    {QPalette::Link, 0xff0000ff},
    {QPalette::LinkVisited, 0xffff00ff},
    {QPalette::LinkVisited, 0}
};

PalInfo disPalInfo[] =
{
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
    {QPalette::Foreground, 0xff808080},
    {QPalette::Button, 0xffc0c0c0},
    {QPalette::Light, 0xffffffff},
    {QPalette::Midlight, 0xffdfdfdf},
    {QPalette::Dark, 0xff808080},
    {QPalette::Mid, 0xffa0a0a4},
    {QPalette::Text, 0xff808080},
    {QPalette::BrightText, 0xffffffff},
    {QPalette::ButtonText, 0xff808080},
    {QPalette::Base, 0xffc0c0c0},
    {QPalette::Background, 0xffc0c0c0},
    {QPalette::Shadow, 0xff000000},
    {QPalette::Highlight, 0xff000080},
    {QPalette::HighlightedText, 0xffffffff},
    {QPalette::Link, 0xff0000ff},
    {QPalette::LinkVisited, 0xffff00ff},
George Staikos's avatar
George Staikos committed
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
    {QPalette::LinkVisited, 0}
};



class TestStyle: public QWindowsStyle
{
public:
    TestStyle()
    {}

    virtual void drawControl(ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget) const
    {
        switch (element)
        {
        case CE_ScrollBarSubLine:
        case CE_ScrollBarAddLine:
        case CE_ScrollBarSubPage:
        case CE_ScrollBarAddPage:
        case CE_ScrollBarFirst:
        case CE_ScrollBarLast:
        case CE_ScrollBarSlider:
        {
            const QStyleOptionSlider* sbOpt = qstyleoption_cast<const QStyleOptionSlider*>(option);

            if (sbOpt->minimum == sbOpt->maximum)
            {
                const_cast<QStyleOptionSlider*>(sbOpt)->state ^= QStyle::State_Enabled;
                if (element == CE_ScrollBarSlider)
                    element = CE_ScrollBarAddPage;
            }

            if (element == CE_ScrollBarAddPage || element == CE_ScrollBarSubPage)
            {
                //Fun. in Qt4, the brush offset seems to be sensitive to window position??
                painter->setBrushOrigin(0,1);
            }
            break;
        }
        default: //shaddup
            break;
        }

        QWindowsStyle::drawControl(element, option, painter, widget);
    }

    virtual QRect subControlRect(ComplexControl control, const QStyleOptionComplex* option,
                                 SubControl subControl, const QWidget* widget) const
    {
        QRect rect = QWindowsStyle::subControlRect(control, option, subControl, widget);

        switch (control)
        {
        case CC_ComboBox:
            if (subControl == SC_ComboBoxEditField)
                return rect.translated(3,0);
            else
                return rect;
        default:
            return rect;
        }
    }

    virtual QSize sizeFromContents(ContentsType type, const QStyleOption* option, const QSize& contentsSize, const QWidget* widget) const
    {
        QSize size = QWindowsStyle::sizeFromContents(type, option, contentsSize, widget);

        switch (type)
        {
        case CT_PushButton:
David Faure's avatar
David Faure committed
192
            return QSize(size.width(), size.height() - 1);
George Staikos's avatar
George Staikos committed
193
        case CT_LineEdit:
Germain Garand's avatar
Germain Garand committed
194
	    if (widget && widget->parentWidget() && !qstricmp(widget->parentWidget()->metaObject()->className(), "KUrlRequester"))
195
		return QSize(size.width() + 1, size.height());
George Staikos's avatar
George Staikos committed
196
197
198
199
            return QSize(size.width() + 2, size.height() + 2);
        case CT_ComboBox:
        {
            const QStyleOptionComboBox* cbOpt = qstyleoption_cast<const QStyleOptionComboBox*>(option);
200
			Q_UNUSED(cbOpt); // is 'cbOpt' needed at all here?
George Staikos's avatar
George Staikos committed
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
            return QSize(qMax(43, size.width() + 6), size.height());
        }
        default:
            return size;
        }

    }

    virtual int pixelMetric(PixelMetric metric, const QStyleOption* option, const QWidget* widget) const
    {
        if (metric == PM_ButtonMargin)
            return 7;
        return QWindowsStyle::pixelMetric(metric, option, widget);
    }

};

218
219
220
221
const char* imageMissingIcon =
"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAzrAAAM6wHl1kTSAAAB2ElEQVQ4jZWTMWsiQRTHfxlDCln2iFhIClksRUIQC6t8BkurzTewEBGx2GKrICmsUsg218rBWV2xdQqLRVJYhUQkBCKLeN6iixB5d0WyYOKGcP9mmHm83/u/NzMHvOobcMz/6Tfw5/Btc+z7/oWIoJRCKQWwt0ZSSqHr+vddACLyZck44GFc8OnpiX6/z3Q6RSmFYRhUq1UMw9gDqF2AUorRaES73WYymVAsFsnlcnieR6PRwPO8dy3uAcIwxHEcADRNo1qt0mq16PV6ZDIZut0uYRh+Dri7u2O1WlGr1QCwLIsgCMhkMlQqFebzOePx+P1cdgG+7wNQKpWwbRsRodlsslgsOD8/R0R4fHyMdwBwcnKCiHBzc0M6neby8hIRoV6vMxwOERGy2eznDvL5PJqmMRgMmM1mpFIprq6uEBFs20bXdc7OzkgkEvvXGA2uVqth2zamaVIul9E0jeVyiVKKdrtNMplkvV7HAwDK5TLX19c4jsN4PEZEKBQKmKbJdrvl/v4e13UfgAXAwVueEYbhRdwzTiQSvLy8cHt7y+npKZ1O59myrB8RQH10EKcgCDg6OoqSf/L6keJbiNNms8F13QfLsn69Jf+NYlELGpD+grMAgo+H/wARELhn1VB8lwAAAABJRU5ErkJggg==";
//r 727816 of oxygen's image-missing, base64'd PNG

George Staikos's avatar
George Staikos committed
222
223
224
225
#include <kaction.h>
#include <kcmdlineargs.h>
#include <kio/job.h>
#include <kmainwindow.h>
226
#include <kconfig.h>
George Staikos's avatar
George Staikos committed
227
228
#include <kglobalsettings.h>

Dirk Mueller's avatar
Dirk Mueller committed
229
230
231
#include <QtGui/QColor>
#include <QtGui/QCursor>
#include <QtCore/QDir>
Dirk Mueller's avatar
Dirk Mueller committed
232
#include <QtCore/QObject>
Dirk Mueller's avatar
Dirk Mueller committed
233
#include <QtGui/QPushButton>
Dirk Mueller's avatar
Dirk Mueller committed
234
#include <QtCore/QString>
Dirk Mueller's avatar
Dirk Mueller committed
235
#include <QtCore/QTextStream>
Dirk Mueller's avatar
Dirk Mueller committed
236
237
#include <QtCore/QFileInfo>
#include <QtCore/QTimer>
George Staikos's avatar
George Staikos committed
238
239
#include <kstatusbar.h>

Harri Porten's avatar
compile    
Harri Porten committed
240
#include "localization/kencodingdetector.h"
George Staikos's avatar
George Staikos committed
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#include "dom/dom2_range.h"
#include "dom/dom_exception.h"
#include "dom/html_document.h"
#include "html/htmltokenizer.h"
#include "khtml_part.h"
#include "khtmlpart_p.h"
#include <kparts/browserextension.h>

#include "khtmlview.h"
#include "rendering/render_replaced.h"
#include "xml/dom_docimpl.h"
#include "html/html_baseimpl.h"
#include "dom/dom_doc.h"
#include "misc/loader.h"
#include "ecma/kjs_binding.h"
#include "ecma/kjs_dom.h"
#include "ecma/kjs_window.h"
#include "ecma/kjs_proxy.h"

using namespace khtml;
using namespace DOM;
using namespace KJS;

264
265
static bool visual = false;
static pid_t xvfb;
George Staikos's avatar
George Staikos committed
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283

// -------------------------------------------------------------------------

PartMonitor *PartMonitor::sm_highestMonitor = NULL;

PartMonitor::PartMonitor(KHTMLPart *_part)
{
    m_part = _part;
    m_completed = false;
    connect(m_part,SIGNAL(completed()),this,SLOT(partCompleted()));
    m_timer_waits = 200;
    m_timeout_timer = new QTimer(this);
}

PartMonitor::~PartMonitor()
{
   if (this == sm_highestMonitor)
	sm_highestMonitor = 0;
284
285
   while (!m_eventLoopStack.isEmpty())
       exitLoop();
George Staikos's avatar
George Staikos committed
286
287
288
289
290
291
292
293
294
295
296
297
}


void PartMonitor::waitForCompletion()
{
    if (!m_completed) {

        if (sm_highestMonitor)
		return;

	sm_highestMonitor = this;

Germain Garand's avatar
Germain Garand committed
298
        enterLoop();
George Staikos's avatar
George Staikos committed
299
300
301
302
303
304

        //connect(m_timeout_timer, SIGNAL(timeout()), this, SLOT( timeout() ) );
        //m_timeout_timer->stop();
	//m_timeout_timer->start( visual ? 100 : 2, true );
    }
    QTimer::singleShot( 0, this, SLOT( finishTimers() ) );
Germain Garand's avatar
Germain Garand committed
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
    enterLoop();
}

void PartMonitor::enterLoop()
{
    if (m_eventLoopStack.isEmpty() || m_eventLoopStack.top()->isRunning())
        m_eventLoopStack.push(new QEventLoop());
    m_eventLoopStack.top()->exec();
}

void PartMonitor::exitLoop()
{
    while (!m_eventLoopStack.isEmpty() && !m_eventLoopStack.top()->isRunning())
        delete m_eventLoopStack.pop();
    if (!m_eventLoopStack.isEmpty())
        m_eventLoopStack.top()->exit();
George Staikos's avatar
George Staikos committed
321
322
323
324
}

void PartMonitor::timeout()
{
Germain Garand's avatar
Germain Garand committed
325
    exitLoop();
George Staikos's avatar
George Staikos committed
326
327
328
329
}

void PartMonitor::finishTimers()
{
330

George Staikos's avatar
George Staikos committed
331
332
    KJS::Window *w = KJS::Window::retrieveWindow( m_part );
    --m_timer_waits;
333
    if ( m_timer_waits && ((w && w->winq->hasTimers()) || m_part->inProgress())) {
George Staikos's avatar
George Staikos committed
334
335
336
337
        // wait a bit
        QTimer::singleShot( 10, this, SLOT(finishTimers() ) );
        return;
    }
Germain Garand's avatar
Germain Garand committed
338
    exitLoop();
George Staikos's avatar
George Staikos committed
339
340
341
342
343
344
345
}

void PartMonitor::partCompleted()
{
    m_completed = true;
    m_timeout_timer->stop();
    connect(m_timeout_timer, SIGNAL(timeout()),this, SLOT( timeout() ) );
346
347
	m_timeout_timer->setSingleShot(true);
	m_timeout_timer->start(visual ? 100 : 2);
George Staikos's avatar
George Staikos committed
348
349
350
    disconnect(m_part,SIGNAL(completed()),this,SLOT(partCompleted()));
}

351
static void signal_handler( int )
George Staikos's avatar
George Staikos committed
352
{
353
354
355
356
357
    printf( "timeout - this should *NOT* happen, it is likely the part's completed() signal was not emitted - FIXME!!\n" );
    if (PartMonitor::sm_highestMonitor)
        PartMonitor::sm_highestMonitor->exitLoop();
    else
        abort();
George Staikos's avatar
George Staikos committed
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
}
// -------------------------------------------------------------------------

RegTestObject::RegTestObject(ExecState *exec, RegressionTest *_regTest)
{
    m_regTest = _regTest;
    putDirect("print",new RegTestFunction(exec,m_regTest,RegTestFunction::Print,1), DontEnum);
    putDirect("reportResult",new RegTestFunction(exec,m_regTest,RegTestFunction::ReportResult,3), DontEnum);
    putDirect("checkOutput",new RegTestFunction(exec,m_regTest,RegTestFunction::CheckOutput,1), DontEnum);
    // add "quit" for compatibility with the mozilla js shell
    putDirect("quit", new RegTestFunction(exec,m_regTest,RegTestFunction::Quit,1), DontEnum );
}

RegTestFunction::RegTestFunction(ExecState* /*exec*/, RegressionTest *_regTest, int _id, int length)
{
    m_regTest = _regTest;
    id = _id;
    putDirect("length",length);
}

bool RegTestFunction::implementsCall() const
{
    return true;
}

Germain Garand's avatar
Germain Garand committed
383
JSValue* RegTestFunction::callAsFunction(ExecState *exec, JSObject* /*thisObj*/, const List &args)
George Staikos's avatar
George Staikos committed
384
{
Germain Garand's avatar
Germain Garand committed
385
    JSValue* result = jsUndefined();
George Staikos's avatar
George Staikos committed
386
387
388
389
390
391
    if ( m_regTest->ignore_errors )
        return result;

    switch (id) {
	case Print: {
	    UString str = args[0]->toString(exec);
392
            if ( str.qstring().toLower().indexOf( "failed!" ) >= 0 )
George Staikos's avatar
George Staikos committed
393
394
                m_regTest->saw_failure = true;
            QString res = str.qstring().replace('\007', "");
395
            m_regTest->m_currentOutput += res + "\n";	//krazy:exclude=duoblequote_chars DOM demands chars
George Staikos's avatar
George Staikos committed
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
	    break;
	}
	case ReportResult: {
            bool passed = args[0]->toBoolean(exec);
            QString description = args[1]->toString(exec).qstring();
            if (args[1]->type() == UndefinedType || args[1]->type() == NullType)
                description.clear();
            m_regTest->reportResult(passed,description);
            if ( !passed )
                m_regTest->saw_failure = true;
            break;
        }
	case CheckOutput: {
            DOM::DocumentImpl* docimpl = static_cast<DOM::DocumentImpl*>( m_regTest->m_part->document().handle() );
            if ( docimpl && docimpl->view() && docimpl->renderer() )
            {
                docimpl->updateRendering();
            }
            QString filename = args[0]->toString(exec).qstring();
415
            filename = RegressionTest::curr->m_currentCategory+"/"+filename;	//krazy:exclude=duoblequote_chars DOM demands chars
George Staikos's avatar
George Staikos committed
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
            int failures = RegressionTest::NoFailure;
            if ( m_regTest->m_genOutput ) {
                if ( !m_regTest->reportResult( m_regTest->checkOutput(filename+"-dom"),
                                               "Script-generated " + filename + "-dom") )
                    failures |= RegressionTest::DomFailure;
                if ( !m_regTest->reportResult( m_regTest->checkOutput(filename+"-render"),
                                         "Script-generated " + filename + "-render") )
                    failures |= RegressionTest::RenderFailure;
            } else {
                // compare with output file
                if ( !m_regTest->reportResult( m_regTest->checkOutput(filename+"-dom"), "DOM") )
                    failures |= RegressionTest::DomFailure;
                if ( !m_regTest->reportResult( m_regTest->checkOutput(filename+"-render"), "RENDER") )
                    failures |= RegressionTest::RenderFailure;
            }
            RegressionTest::curr->doFailureReport( filename, failures );
            break;
        }
        case Quit:
            m_regTest->reportResult(true,
				    "Called quit" );
            if ( !m_regTest->saw_failure )
                m_regTest->ignore_errors = true;
            break;
    }

    return result;
}

// -------------------------------------------------------------------------

KHTMLPartObject::KHTMLPartObject(ExecState *exec, KHTMLPart *_part)
{
    m_part = _part;
    putDirect("openPage", new KHTMLPartFunction(exec,m_part,KHTMLPartFunction::OpenPage,1), DontEnum);
    putDirect("openPageAsUrl", new KHTMLPartFunction(exec,m_part,KHTMLPartFunction::OpenPageAsUrl,1), DontEnum);
    putDirect("begin",     new KHTMLPartFunction(exec,m_part,KHTMLPartFunction::Begin,1), DontEnum);
    putDirect("write",    new KHTMLPartFunction(exec,m_part,KHTMLPartFunction::Write,1), DontEnum);
    putDirect("end",    new KHTMLPartFunction(exec,m_part,KHTMLPartFunction::End,0), DontEnum);
    putDirect("executeScript", new KHTMLPartFunction(exec,m_part,KHTMLPartFunction::ExecuteScript,0), DontEnum);
    putDirect("processEvents", new KHTMLPartFunction(exec,m_part,KHTMLPartFunction::ProcessEvents,0), DontEnum);
}

Germain Garand's avatar
Germain Garand committed
459
KJS::JSValue *KHTMLPartObject::winGetter(KJS::ExecState *, KJS::JSObject*, const KJS::Identifier&, const KJS::PropertySlot& slot)
George Staikos's avatar
George Staikos committed
460
461
462
463
464
{
    KHTMLPartObject* thisObj = static_cast<KHTMLPartObject*>(slot.slotBase());
    return KJS::Window::retrieveWindow(thisObj->m_part);
}

Germain Garand's avatar
Germain Garand committed
465
KJS::JSValue *KHTMLPartObject::docGetter(KJS::ExecState *exec, KJS::JSObject*, const KJS::Identifier&, const KJS::PropertySlot& slot)
George Staikos's avatar
George Staikos committed
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
{
    KHTMLPartObject* thisObj = static_cast<KHTMLPartObject*>(slot.slotBase());
    return getDOMNode(exec, thisObj->m_part->document().handle());
}


bool KHTMLPartObject::getOwnPropertySlot(KJS::ExecState *exec, const KJS::Identifier& propertyName, KJS::PropertySlot& slot)
{
    if (propertyName == "document") {
        slot.setCustom(this, docGetter);
        return true;
    }
    else if (propertyName == "window") {
        slot.setCustom(this, winGetter);
        return true;
    }
Germain Garand's avatar
Germain Garand committed
482
    return JSObject::getOwnPropertySlot(exec, propertyName, slot);
George Staikos's avatar
George Staikos committed
483
484
485
486
487
488
489
490
491
492
493
494
495
496
}

KHTMLPartFunction::KHTMLPartFunction(ExecState */*exec*/, KHTMLPart *_part, int _id, int length)
{
    m_part = _part;
    id = _id;
    putDirect("length",length);
}

bool KHTMLPartFunction::implementsCall() const
{
    return true;
}

Germain Garand's avatar
Germain Garand committed
497
JSValue* KHTMLPartFunction::callAsFunction(ExecState *exec, JSObject*/*thisObj*/, const List &args)
George Staikos's avatar
George Staikos committed
498
{
Germain Garand's avatar
Germain Garand committed
499
    JSValue* result = jsUndefined();
George Staikos's avatar
George Staikos committed
500
501
502
503
504

    switch (id) {
        case OpenPage: {
	    if (args[0]->type() == NullType || args[0]->type() == NullType) {
		exec->setException(Error::create(exec, GeneralError,"No filename specified"));
505
		return jsUndefined();
George Staikos's avatar
George Staikos committed
506
507
508
	    }

            QString filename = args[0]->toString(exec).qstring();
509
            QString fullFilename = QFileInfo(RegressionTest::curr->m_currentBase+"/"+filename).absoluteFilePath();	//krazy:exclude=duoblequote_chars DOM demands chars
510
            KUrl url;
George Staikos's avatar
George Staikos committed
511
512
513
            url.setProtocol("file");
            url.setPath(fullFilename);
            PartMonitor pm(m_part);
514
            m_part->openUrl(url);
George Staikos's avatar
George Staikos committed
515
            pm.waitForCompletion();
516
	    kapp->processEvents(QEventLoop::AllEvents);
George Staikos's avatar
George Staikos committed
517
518
519
520
521
            break;
        }
	case OpenPageAsUrl: {
	    if (args[0]->type() == NullType || args[0]->type() == UndefinedType) {
		exec->setException(Error::create(exec, GeneralError,"No filename specified"));
522
		return jsUndefined();
George Staikos's avatar
George Staikos committed
523
524
525
	    }
	    if (args[1]->type() == NullType || args[1]->type() == UndefinedType) {
		exec->setException(Error::create(exec, GeneralError,"No url specified"));
526
		return jsUndefined();
George Staikos's avatar
George Staikos committed
527
528
529
530
	    }

            QString filename = args[0]->toString(exec).qstring();
            QString url = args[1]->toString(exec).qstring();
531
            QFile file(RegressionTest::curr->m_currentBase+"/"+filename);	//krazy:exclude=duoblequote_chars DOM demands chars
George Staikos's avatar
George Staikos committed
532
533
	    if (!file.open(QIODevice::ReadOnly)) {
		exec->setException(Error::create(exec, GeneralError,
534
						 qPrintable(QString("Error reading " + filename))));
George Staikos's avatar
George Staikos committed
535
536
537
538
539
540
541
	    }
	    else {
		QByteArray fileData;
		QDataStream stream(&fileData,QIODevice::WriteOnly);
		char buf[1024];
		int bytesread;
		while (!file.atEnd()) {
542
543
		    bytesread = file.read(buf,1024);
		    stream.writeRawData(buf,bytesread);
George Staikos's avatar
George Staikos committed
544
545
546
547
		}
		file.close();
		QString contents(fileData);
		PartMonitor pm(m_part);
548
		m_part->begin(KUrl( url ));
George Staikos's avatar
George Staikos committed
549
550
551
552
		m_part->write(contents);
		m_part->end();
		pm.waitForCompletion();
	    }
553
	    kapp->processEvents(QEventLoop::AllEvents);
George Staikos's avatar
George Staikos committed
554
555
556
557
	    break;
	}
	case Begin: {
            QString url = args[0]->toString(exec).qstring();
558
            m_part->begin(KUrl( url ));
George Staikos's avatar
George Staikos committed
559
560
561
562
563
564
565
566
567
            break;
        }
        case Write: {
            QString str = args[0]->toString(exec).qstring();
            m_part->write(str);
            break;
        }
        case End: {
            m_part->end();
568
	    kapp->processEvents(QEventLoop::AllEvents);
George Staikos's avatar
George Staikos committed
569
570
571
572
573
574
575
576
577
            break;
        }
	case ExecuteScript: {
	    QString code = args[0]->toString(exec).qstring();
	    Completion comp;
	    KJSProxy *proxy = m_part->jScript();
	    proxy->evaluate("",0,code,0,&comp);
	    if (comp.complType() == Throw)
		exec->setException(comp.value());
578
	    kapp->processEvents(QEventLoop::AllEvents);
George Staikos's avatar
George Staikos committed
579
580
581
	    break;
	}
	case ProcessEvents: {
582
	    kapp->processEvents(QEventLoop::AllEvents);
George Staikos's avatar
George Staikos committed
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
	    break;
	}
    }

    return result;
}

// -------------------------------------------------------------------------

int main(int argc, char *argv[])
{
    // forget about any settings
    passwd* pw = getpwuid( getuid() );
    if (!pw) {
        fprintf(stderr, "dang, I don't even know who I am.\n");
        exit(1);
    }

    QString kh("/var/tmp/%1_non_existant");
    kh = kh.arg( pw->pw_name );
603
    setenv( "KDEHOME", kh.toLatin1(), 1 );
George Staikos's avatar
George Staikos committed
604
605
    setenv( "LC_ALL", "C", 1 );
    setenv( "LANG", "C", 1 );
David Faure's avatar
David Faure committed
606
607

    // We want KIO to be in the slave-forking mode since
608
609
610
611
    // then it'll ask KProtocolInfo::exec for the binary to run,
    // and we intercept that, limiting the I/O to file://
    // and the magic data://. See Slave::createSlave in KIO's slave.cpp
    setenv( "KDE_FORK_SLAVES", "true", 1);
George Staikos's avatar
George Staikos committed
612
613
    signal( SIGALRM, signal_handler );

614
615
616
    // workaround various Qt crashes by always enforcing a TrueColor visual
    QApplication::setColorSpec( QApplication::ManyColor );

617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
    KCmdLineOptions options;
    options.add("b");
    options.add("base <base_dir>", ki18n("Directory containing tests, basedir and output directories."));
    options.add("d");
    options.add("debug", ki18n("Do not suppress debug output"));
    options.add("g");
    options.add("genoutput", ki18n("Regenerate baseline (instead of checking)"));
    options.add("s");
    options.add("noshow", ki18n("Do not show the window while running tests"));
    options.add("t");
    options.add("test <filename>", ki18n("Only run a single test. Multiple options allowed."));
    options.add("js", ki18n("Only run .js tests"));
    options.add("html", ki18n("Only run .html tests"));
    options.add("noxvfb", ki18n("Do not use Xvfb"));
    options.add("o");
632
    options.add("output <directory>", ki18n("Put output in &lt;directory&gt; instead of &lt;base_dir&gt;/output"));
633
    options.add("r");
634
    options.add("reference <directory>", ki18n("Use &lt;directory&gt; as reference instead of &lt;base_dir&gt;/baseline"));
Malcolm Hunter's avatar
Malcolm Hunter committed
635
    options.add("+[base_dir]", ki18n("Directory containing tests, basedir and output directories. Only regarded if -b is not specified."));
636
637
638
639
    options.add("+[testcases]", ki18n("Relative path to testcase, or directory of testcases to be run (equivalent to -t)."));

    KCmdLineArgs::init(argc, argv, "testregression", 0, ki18n("TestRegression"),
                       "1.0", ki18n("Regression tester for khtml"));
George Staikos's avatar
George Staikos committed
640
641
642
643
    KCmdLineArgs::addCmdLineOptions(options);

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs( );

644
    QString baseDir = args->getOption("base");
George Staikos's avatar
George Staikos committed
645
646
647
648
649
650
651
652
653
654

    if ( args->count() < 1 && baseDir.isEmpty() ) {
	KCmdLineArgs::usage();
	::exit( 1 );
    }

    int testcase_index = 0;
    if (baseDir.isEmpty()) baseDir = args->arg(testcase_index++);

    QFileInfo bdInfo(baseDir);
655
656
657
    // font pathes passed to Xvfb must be absolute
    if (bdInfo.isRelative())
        baseDir = bdInfo.dir().absolutePath();
George Staikos's avatar
George Staikos committed
658
659
660

    const char *subdirs[] = {"tests", "baseline", "output", "resources"};
    for ( int i = 0; i < 3; i++ ) {
Maks Orlovich's avatar
Maks Orlovich committed
661
        QFileInfo sourceDir(baseDir + QLatin1Char('/') + QLatin1String(subdirs[i]));
George Staikos's avatar
George Staikos committed
662
        if ( !sourceDir.exists() || !sourceDir.isDir() ) {
Maks Orlovich's avatar
Maks Orlovich committed
663
            fprintf(stderr,"ERROR: Source directory \"%s\": no such directory.\n", sourceDir.filePath().toLocal8Bit().data());
George Staikos's avatar
George Staikos committed
664
665
666
667
            exit(1);
        }
    }

668
669
    if (args->isSet("xvfb"))
    {
670
671
672
673
674
        QString xvfbPath = KStandardDirs::findExe("Xvfb");
        if ( xvfbPath.isEmpty() ) {
            fprintf( stderr, "ERROR: We need Xvfb to be installed for reliable results\n" );
            exit( 1 );
        }
David Faure's avatar
David Faure committed
675

676
677
678
679
680
681
682
683
684
685
        QByteArray xvfbPath8 = QFile::encodeName(xvfbPath);
        QStringList fpaths;
        fpaths.append(baseDir+"/resources");

        const char* const fontdirs[] = { "75dpi", "misc", "Type1" };
        const char* const fontpaths[] =  {"/usr/share/fonts/", "/usr/X11/lib/X11/fonts/",
            "/usr/lib/X11/fonts/", "/usr/share/fonts/X11/" };

        for (size_t fp=0; fp < sizeof(fontpaths)/sizeof(*fontpaths); ++fp)
            for (size_t fd=0; fd < sizeof(fontdirs)/sizeof(*fontdirs); ++fd)
686
                if (QFile::exists(QLatin1String(fontpaths[fp])+QLatin1String(fontdirs[fd]))) {
687
688
689
690
                    if (strcmp(fontdirs[fd] , "Type1"))
                        fpaths.append(QLatin1String(fontpaths[fp])+QLatin1String(fontdirs[fd])+":unscaled");
                    else
                        fpaths.append(QLatin1String(fontpaths[fp])+QLatin1String(fontdirs[fd]));
691
		}
George Staikos's avatar
George Staikos committed
692
693
694

        xvfb = fork();
        if ( !xvfb ) {
695
696
697
            QByteArray buffer = fpaths.join(",").toLatin1();
            execl( xvfbPath8.data(), xvfbPath8.data(), "-once", "-dpi", "100", "-screen", "0",
                    "1024x768x16", "-ac", "-fp", buffer.data(), ":47", (char*)NULL );
George Staikos's avatar
George Staikos committed
698
699
700
701
702
703
        }

        setenv( "DISPLAY", ":47", 1 );
    }

    KApplication a;
704
//    a.disableAutoDcopRegistration();
George Staikos's avatar
George Staikos committed
705
    a.setStyle( new TestStyle );
706
    KConfig sc1( "cryptodefaults", KConfig::SimpleConfig );
707
708
    KConfigGroup grp = sc1.group("Warnings");
    grp.writeEntry( "OnUnencrypted",  false );
David Faure's avatar
David Faure committed
709
    KSharedConfigPtr config = KGlobal::mainComponent().config();
710
711
712
    grp = config->group("Notification Messages" );
    grp.writeEntry( "kjscupguard_alarmhandler", true );
    grp.writeEntry("ReportJSErrors", false);
George Staikos's avatar
George Staikos committed
713
    KConfig cfg( "khtmlrc" );
714
715
716
717
718
719
720
721
722
723
724
725
726
    grp = cfg.group("HTML Settings");
    grp.writeEntry( "StandardFont", HTML_DEFAULT_VIEW_SANSSERIF_FONT );
    grp.writeEntry( "FixedFont", HTML_DEFAULT_VIEW_FIXED_FONT );
    grp.writeEntry( "SerifFont", HTML_DEFAULT_VIEW_SERIF_FONT );
    grp.writeEntry( "SansSerifFont", HTML_DEFAULT_VIEW_SANSSERIF_FONT );
    grp.writeEntry( "CursiveFont", HTML_DEFAULT_VIEW_CURSIVE_FONT );
    grp.writeEntry( "FantasyFont", HTML_DEFAULT_VIEW_FANTASY_FONT );
    grp.writeEntry( "MinimumFontSize", HTML_DEFAULT_MIN_FONT_SIZE );
    grp.writeEntry( "MediumFontSize", 10 );
    grp.writeEntry( "Fonts", QStringList() );
    grp.writeEntry( "DefaultEncoding", "" );
    grp = cfg.group("Java/JavaScript Settings");
    grp.writeEntry( "WindowOpenPolicy", (int)KHTMLSettings::KJSWindowOpenAllow);
George Staikos's avatar
George Staikos committed
727
728

    cfg.sync();
729
    grp.sync();
David Faure's avatar
David Faure committed
730

731
    KJS::ScriptInterpreter::turnOffCPUGuard();
George Staikos's avatar
George Staikos committed
732
733
734
735
736
737
738
739
740
741
742
743

    QPalette pal = a.palette();
    for (int c = 0; palInfo[c].color; ++c)
    {
        pal.setColor(QPalette::Active,   palInfo[c].role, QColor(palInfo[c].color));
        pal.setColor(QPalette::Inactive, palInfo[c].role, QColor(palInfo[c].color));
        pal.setColor(QPalette::Disabled, palInfo[c].role, QColor(disPalInfo[c].color));
    }
    a.setPalette(pal);

    int rv = 1;

744
745
    bool outputDebug = args->isSet( "debug" );

746
    KConfig dc( "kdebugrc", KConfig::SimpleConfig );
747
748
749
750
751
752
    static int areas[] = { 1000, 6000, 6005, 6010, 6020, 6030,
                            6031, 6035, 6036, 6040, 6041, 6045,
                            6050, 6060, 6061, 7000, 7006, 170,
                            171, 7101, 7002, 7019, 7027, 7014,
                            7011, 6070, 6080, 6090, 0};
    for ( int i = 0; areas[i]; ++i ) {
753
754
755
        grp = dc.group( QString::number( areas[i] ) );
        grp.writeEntry( "InfoOutput", outputDebug ? 2 : 4 );
        grp.sync();
George Staikos's avatar
George Staikos committed
756
    }
757
758
759
    dc.sync();

    kClearDebugConfig();
George Staikos's avatar
George Staikos committed
760

761
762
763
764
765
766
    // make sure the missing image icon is independent of the icon theme..
    QByteArray brokenImData = QByteArray::fromBase64(imageMissingIcon);
    QImage brokenIm;
    brokenIm.loadFromData(brokenImData);
    khtml::Cache::brokenPixmap = new QPixmap(QPixmap::fromImage(brokenIm));

George Staikos's avatar
George Staikos committed
767
768
    // create widgets
    KMainWindow *toplevel = new KMainWindow();
Allan Sandfeld Jensen's avatar
Compile    
Allan Sandfeld Jensen committed
769
    KHTMLPart *part = new KHTMLPart( toplevel, 0, KHTMLPart::BrowserViewGUI );
George Staikos's avatar
George Staikos committed
770
771
772
773
774
775

    toplevel->setCentralWidget( part->widget() );
    KAcceleratorManager::setNoAccel ( part->widget() );
    part->setJScriptEnabled(true);

    part->executeScript(DOM::Node(), ""); // force the part to create an interpreter
776
777
    part->setJavaEnabled(false);
    part->setPluginsEnabled(false);
George Staikos's avatar
George Staikos committed
778
779
780
781
782
783
784
785
786
787
788
789
790

    if (args->isSet("show"))
	visual = true;

    a.setTopWidget(part->widget());
    if ( visual )
        toplevel->show();

    // we're not interested
    toplevel->statusBar()->hide();

    if (!getenv("KDE_DEBUG")) {
        // set ulimits
791
        rlimit vmem_limit = { 512*1024*1024, RLIM_INFINITY };	// 512Mb Memory should suffice
George Staikos's avatar
George Staikos committed
792
793
794
795
796
797
798
799
800
        setrlimit(RLIMIT_AS, &vmem_limit);
        rlimit stack_limit = { 8*1024*1024, RLIM_INFINITY };	// 8Mb Memory should suffice
        setrlimit(RLIMIT_STACK, &stack_limit);
    }

    // run the tests
    RegressionTest *regressionTest = new RegressionTest(part,
                                                        baseDir,
                                                        args->getOption("output"),
801
                                                        args->getOption("reference"),
George Staikos's avatar
George Staikos committed
802
803
804
                                                        args->isSet("genoutput"),
                                                        !args->isSet( "html" ),
                                                        !args->isSet( "js" ));
805
806
    QObject::connect(part->browserExtension(), SIGNAL(openUrlRequest(const KUrl&, const KParts::OpenUrlArguments&, const KParts::BrowserArguments&)),
		     regressionTest, SLOT(slotOpenURL(const KUrl&, const KParts::OpenUrlArguments&, const KParts::BrowserArguments&)));
George Staikos's avatar
George Staikos committed
807
808
809
810
    QObject::connect(part->browserExtension(), SIGNAL(resizeTopLevelWidget( int, int )),
		     regressionTest, SLOT(resizeTopLevelWidget( int, int )));

    bool result = false;
811
    QStringList tests = args->getOptionList("test");
George Staikos's avatar
George Staikos committed
812
813
814
815
    // merge testcases specified on command line
    for (; testcase_index < args->count(); testcase_index++)
        tests << args->arg(testcase_index);
    if (tests.count() > 0)
816
        foreach (QString test, tests) {
George Staikos's avatar
George Staikos committed
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
	    result = regressionTest->runTests(test,true);
            if (!result) break;
        }
    else
	result = regressionTest->runTests();

    if (result) {
	if (args->isSet("genoutput")) {
	    printf("\nOutput generation completed.\n");
	}
	else {
	    printf("\nTests completed.\n");
            printf("Total:    %d\n",
                   regressionTest->m_passes_work+
                   regressionTest->m_passes_fail+
                   regressionTest->m_failures_work+
                   regressionTest->m_failures_fail+
                   regressionTest->m_errors);
	    printf("Passes:   %d",regressionTest->m_passes_work);
            if ( regressionTest->m_passes_fail )
                printf( " (%d unexpected passes)\n", regressionTest->m_passes_fail );
            else
                printf( "\n" );
	    printf("Failures: %d",regressionTest->m_failures_work);
            if ( regressionTest->m_failures_fail )
                printf( " (%d expected failures)\n", regressionTest->m_failures_fail );
            else
                printf( "\n" );
            if ( regressionTest->m_errors )
                printf("Errors:   %d\n",regressionTest->m_errors);

            QFile list( regressionTest->m_outputDir + "/links.html" );
            list.open( QIODevice::WriteOnly|QIODevice::Append );
            QString link, cl;
            link = QString( "<hr>%1 failures. (%2 expected failures)" )
                   .arg(regressionTest->m_failures_work )
                   .arg( regressionTest->m_failures_fail );
854
            list.write( link.toLatin1(), link.length() );
George Staikos's avatar
George Staikos committed
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
            list.close();
	}
    }

    // Only return a 0 exit code if all tests were successful
    if (regressionTest->m_failures_work == 0 && regressionTest->m_errors == 0)
	rv = 0;

    // cleanup
    delete regressionTest;
    delete part;
    delete toplevel;

    khtml::Cache::clear();
    khtml::CSSStyleSelector::clear();
    khtml::RenderStyle::cleanup();

    kill( xvfb, SIGINT );

    return rv;
}

// -------------------------------------------------------------------------

RegressionTest *RegressionTest::curr = 0;

881
RegressionTest::RegressionTest(KHTMLPart *part, const QString &baseDir, const QString &outputDir, const QString &baselineDir,
George Staikos's avatar
George Staikos committed
882
883
884
885
			       bool _genOutput, bool runJS, bool runHTML)
  : QObject(part)
{
    m_part = part;
886

George Staikos's avatar
George Staikos committed
887
888
    m_baseDir = baseDir;
    m_baseDir = m_baseDir.replace( "//", "/" );
889
    if ( m_baseDir.endsWith( "/" ) )	//krazy:exclude=duoblequote_chars DOM demands chars
George Staikos's avatar
George Staikos committed
890
891
892
893
        m_baseDir = m_baseDir.left( m_baseDir.length() - 1 );
    if (outputDir.isEmpty())
        m_outputDir = m_baseDir + "/output";
    else {
894
        createMissingDirs(outputDir + "/");	//krazy:exclude=duoblequote_chars DOM demands chars
George Staikos's avatar
George Staikos committed
895
896
        m_outputDir = outputDir;
    }
897
898
899
900
901
902
903
904
905
    m_baselineDir = baselineDir;
    m_baselineDir = m_baselineDir.replace( "//", "/" );
    if (m_baselineDir.endsWith( "/" ) )
        m_baselineDir = m_baselineDir.left( m_baselineDir.length() - 1 );
    if (m_baselineDir.isEmpty())
        m_baselineDir = m_baseDir + "/baseline";
    else {
        createMissingDirs(m_baselineDir + "/");
    }
George Staikos's avatar
George Staikos committed
906
907
908
909
910
911
912
    m_genOutput = _genOutput;
    m_runJS = runJS;
    m_runHTML =  runHTML;
    m_passes_work = m_passes_fail = 0;
    m_failures_work = m_failures_fail = 0;
    m_errors = 0;

913
914
    if (!m_genOutput)
        ::unlink( QFile::encodeName( m_outputDir + "/links.html" ) );
George Staikos's avatar
George Staikos committed
915
916
917
918
    QFile f( m_outputDir + "/empty.html" );
    QString s;
    f.open( QIODevice::WriteOnly | QIODevice::Truncate );
    s = "<html><body>Follow the white rabbit";
919
    f.write( s.toLatin1(), s.length() );
George Staikos's avatar
George Staikos committed
920
    f.close();
921
    f.setFileName( m_outputDir + "/index.html" );
George Staikos's avatar
George Staikos committed
922
923
    f.open( QIODevice::WriteOnly | QIODevice::Truncate );
    s = "<html><frameset cols=150,*><frame src=links.html><frame name=content src=empty.html>";
924
    f.write( s.toLatin1(), s.length() );
George Staikos's avatar
George Staikos committed
925
926
927
928
929
    f.close();

    m_paintBuffer = 0;

    curr = this;
930
    m_part->view()->setFrameStyle(QFrame::StyledPanel | QFrame::Plain);
931
    resizeTopLevelWidget(800, 598 );
George Staikos's avatar
George Staikos committed
932
933
934
935
936
937
938
939
940
941
942
943
}


static QStringList readListFile( const QString &filename )
{
    // Read ignore file for this directory
    QString ignoreFilename = filename;
    QFileInfo ignoreInfo(ignoreFilename);
    QStringList ignoreFiles;
    if (ignoreInfo.exists()) {
        QFile ignoreFile(ignoreFilename);
        if (!ignoreFile.open(QIODevice::ReadOnly)) {
944
            fprintf(stderr,"Can't open %s\n",qPrintable(ignoreFilename));
George Staikos's avatar
George Staikos committed
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
            exit(1);
        }
        QTextStream ignoreStream(&ignoreFile);
        QString line;
        while (!(line = ignoreStream.readLine()).isNull())
            ignoreFiles.append(line);
        ignoreFile.close();
    }
    return ignoreFiles;
}

RegressionTest::~RegressionTest()
{
    delete m_paintBuffer;
}

961
bool RegressionTest::runTests(QString relPath, bool mustExist, QStringList failureFileList)
George Staikos's avatar
George Staikos committed
962
963
964
{
    m_currentOutput.clear();

965
966
967
    QString fullPath = m_baseDir + "/tests/" + relPath;

    if (!QFile(fullPath).exists()) {
968
	fprintf(stderr,"%s: No such file or directory\n",qPrintable(relPath));
George Staikos's avatar
George Staikos committed
969
970
971
972
973
974
	return false;
    }

    QFileInfo info(fullPath);

    if (!info.exists() && mustExist) {
975
	fprintf(stderr,"%s: No such file or directory\n",qPrintable(relPath));
George Staikos's avatar
George Staikos committed
976
977
978
979
	return false;
    }

    if (!info.isReadable() && mustExist) {
980
	fprintf(stderr,"%s: Access denied\n",qPrintable(relPath));
George Staikos's avatar
George Staikos committed
981
982
983
984
	return false;
    }

    if (info.isDir()) {
985
986
        QStringList ignoreFiles = readListFile( fullPath + "/ignore" );
        QStringList failureFiles = readListFile( fullPath + "/KNOWN_FAILURES" );
George Staikos's avatar
George Staikos committed
987
988
989
990
991

	// Run each test in this directory, recusively
	QDir sourceDir(m_baseDir + "/tests/"+relPath);
	for (uint fileno = 0; fileno < sourceDir.count(); fileno++) {
	    QString filename = sourceDir[fileno];
992
	    QString relFilename = relPath.isEmpty() ? filename : relPath+"/"+filename;	//krazy:exclude=duoblequote_chars DOM demands chars
George Staikos's avatar
George Staikos committed
993
994
995

	    if (filename == "." || filename == ".." ||  ignoreFiles.contains(filename) )
                continue;
996
997

            runTests(relFilename, false, failureFiles);
George Staikos's avatar
George Staikos committed
998
999
1000
	}
    }
    else if (info.isFile()) {
For faster browsing, not all history is shown. View entire blame