Commit c57906ce authored by lars's avatar lars

Add a message handler to DumpRenderTree that will

        suppress all debug output coming from qDebug() statements.
        Like this we can get rid of all the noise coming
        from the notImplemented() macro when running the
        layout tests. You can get it back by adding -v to
        DumpRenderTree's command line.

        Changed run-webkit-tests slightly, so we by default
        don't fail anymore when our output differs from what
        is generated on the Mac. Added a --strict option, so
        that we can still see this cases and fix them one by one.

        change all notImplemented() macros to use qDebug
        instead of fprintf(stder, ...)



git-svn-id: svn://svn.chromium.org/blink/trunk@18901 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent fb886a1b
2007-01-17 Lars Knoll <lars@trolltech.com>
Reviewed by Zack
change all notImplemented() macros to use qDebug
instead of fprintf(stder, ...)
* loader/qt/DocumentLoaderQt.cpp:
* loader/qt/FrameLoaderQt.cpp:
* page/qt/EventHandlerQt.cpp:
* page/qt/FrameQt.cpp:
* platform/graphics/qt/GraphicsContextQt.cpp:
* platform/graphics/qt/IconQt.cpp:
* platform/network/qt/ResourceHandleManagerQt.cpp:
* platform/network/qt/ResourceHandleQt.cpp:
* platform/qt/CursorQt.cpp:
* platform/qt/FileChooserQt.cpp:
* platform/qt/MimeTypeRegistryQt.cpp:
* platform/qt/PageQt.cpp: Removed.
* platform/qt/PopupMenuQt.cpp:
* platform/qt/ScrollViewQt.cpp:
* platform/qt/TemporaryLinkStubs.cpp:
* platform/qt/TextBoundaries.cpp:
* platform/qt/WidgetQt.cpp:
2007-01-16 Brady Eidson <beidson@apple.com>
Reviewed by Oliver
......
......@@ -39,7 +39,7 @@
#include <QDateTime>
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore {
......
......@@ -75,7 +75,7 @@
#include <QScrollArea>
#include <qdebug.h>
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", __FILE__, __LINE__, __FUNCTION__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore {
......
......@@ -49,8 +49,7 @@ namespace WebCore {
using namespace EventNames;
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", \
__FILE__, __LINE__, __FUNCTION__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
static bool isKeyboardOptionTab(KeyboardEvent* event)
{
......
......@@ -68,8 +68,7 @@
using namespace KJS;
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", \
__FILE__, __LINE__, __FUNCTION__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore {
......
......@@ -49,7 +49,7 @@
#define M_PI 3.14159265358979323846
#endif
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore {
......
......@@ -19,11 +19,11 @@
*/
#include "config.h"
#include <stdio.h>
#include "Icon.h"
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
#include <qglobal.h>
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore {
......
......@@ -44,8 +44,7 @@
#include <QUrl>
#include <qdebug.h>
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", \
__FILE__, __LINE__, __FUNCTION__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
#if 0
#define DEBUG qDebug
......
......@@ -40,8 +40,7 @@
#include "ResourceHandleManagerQt.h"
#include "ResourceHandleInternal.h"
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", \
__FILE__, __LINE__, __FUNCTION__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore {
......
......@@ -35,7 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore {
......
......@@ -21,7 +21,7 @@
#include "config.h"
#include "FileChooser.h"
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore {
......
......@@ -27,7 +27,7 @@
#include "config.h"
#include "MimeTypeRegistry.h"
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore
{
......
/*
* Copyright (C) 2006 Zack Rusin <zack@kde.org>
* Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
* Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include <QWidget>
#include "Page.h"
#include "IntRect.h"
#include "FloatRect.h"
#include "Frame.h"
#include "FrameView.h"
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
namespace WebCore {
}
// vim: ts=4 sw=4 et
......@@ -25,9 +25,9 @@
#include "config.h"
#include "PopupMenu.h"
#include <stdio.h>
#include <qglobal.h>
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore {
......
......@@ -41,7 +41,7 @@
#include <QScrollBar>
#include <QScrollArea>
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore {
......
......@@ -67,8 +67,7 @@
using namespace WebCore;
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", \
__FILE__, __LINE__, __FUNCTION__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
FloatRect Font::selectionRectForComplexText(const TextRun&, const TextStyle&, const IntPoint&, int) const { notImplemented(); return FloatRect(); }
int Font::offsetForPositionForComplexText(const TextRun&, const TextStyle&, int, bool) const { notImplemented(); return 0; }
......
......@@ -35,7 +35,7 @@
#include <QDebug>
#include <stdio.h>
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
// This is very primitive. When I'll have time I'll do the "proper" implementation based on
......
......@@ -40,7 +40,7 @@
#include <QWidget>
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore {
......
2007-01-17 Lars Knoll <lars@trolltech.com>
Reviewed by Zack
change all notImplemented() macros to use qDebug
instead of fprintf(stder, ...)
* WebCoreSupport/ChromeClientQt.cpp:
* WebCoreSupport/ContextMenuClientQt.cpp:
* WebCoreSupport/EditorClientQt.cpp:
* WebCoreSupport/FrameLoaderClientQt.cpp:
2007-01-16 Alice Liu <alice.liu@apple.com>
Added these stubs to keep the Qt build from failing.
......
......@@ -34,7 +34,7 @@
#include "qwebpage.h"
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore
{
......
......@@ -32,8 +32,7 @@
#include <stdio.h>
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", \
__FILE__, __LINE__, __FUNCTION__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__);
namespace WebCore {
......
......@@ -34,7 +34,7 @@
#include <stdio.h>
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d(%s)\n", __FILE__, __LINE__, __FUNCTION__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore {
......
......@@ -33,8 +33,7 @@
#include "qdebug.h"
#include "qwebframe.h"
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", __FILE__, __LINE__, __FUNCTION__); } while(0)
#define notImplemented() qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, __FUNCTION__)
namespace WebCore
{
......
2007-01-17 Lars Knoll <lars@trolltech.com>
Reviewed by Zack
Add a message handler to DumpRenderTree that will
suppress all debug output coming from qDebug() statements.
Like this we can get rid of all the noise coming
from the notImplemented() macro when running the
layout tests. You can get it back by adding -v to
DumpRenderTree's command line.
Changed run-webkit-tests slightly, so we by default
don't fail anymore when our output differs from what
is generated on the Mac. Added a --strict option, so
that we can still see this cases and fix them one by one.
* DumpRenderTree/DumpRenderTree.qtproj/main.cpp:
(messageHandler):
(main):
* Scripts/run-webkit-tests:
2007-01-16 Lars Knoll <lars@trolltech.com>
Reviewed by Zack
......
......@@ -27,11 +27,17 @@
*/
#include "DumpRenderTree.h"
#include "qurl.h"
#include "qdir.h"
#include <qstringlist.h>
#include <qapplication.h>
#include <qurl.h>
#include <qdir.h>
#include <qdebug.h>
void messageHandler(QtMsgType, const char *)
{
// do nothing
}
int main(int argc, char* argv[])
......@@ -39,20 +45,28 @@ int main(int argc, char* argv[])
QApplication app(argc, argv);
QStringList args = app.arguments();
if (args.count() < 2) {
qDebug() << "Usage: DumpRenderTree [-v] filename";
exit(0);
}
// supress debug output from Qt if not started with -v
if (!args.contains(QLatin1String("-v")))
qInstallMsgHandler(messageHandler);
WebCore::DumpRenderTree dumper;
if (args.count() == 2 && args[1] == QLatin1String("-"))
if (args.last() == QLatin1String("-"))
dumper.open();
else if (args.count() == 2) {
if (!args[1].startsWith("/")
&& !args[1].startsWith("file:")) {
else {
if (!args.last().startsWith("/")
&& !args.last().startsWith("file:")) {
QString path = QDir::currentPath();
if (!path.endsWith('/'))
path.append('/');
args[1].prepend(path);
args.last().prepend(path);
}
dumper.open(QUrl(args[1]));
dumper.open(QUrl(args.last()));
}
return app.exec();
}
......@@ -92,7 +92,8 @@ my $testOnlySVGs = '';
my $testResultsDirectory = "/tmp/layout-test-results";
my $threaded = 0;
my $verbose = 0;
my $use_valgrind = 0;
my $useValgrind = 0;
my $strictTesting = 0;
my $expectedTag = "expected";
if (isCygwin()) {
......@@ -139,7 +140,8 @@ my $usage =
" -t|--threaded Run a concurrent JavaScript thead with each test\n" .
" -v|--verbose More verbose output (overrides --quiet)\n" .
" --debug|--release Set DumpRenderTree build configuration\n" .
" --valgrind Run DumpRenderTree inside valgrind (Linux only)\n";
" --valgrind Run DumpRenderTree inside valgrind (Qt/Linux only)\n" .
" --strict Do a comparison with the output on Mac (Qt only)\n";
# Parse out build options (--debug or --release) first
my $buildConfiguration = setConfiguration();
......@@ -163,7 +165,8 @@ my $getOptionsResult = GetOptions(
'svg' => \$testOnlySVGs,
'threaded|t' => \$threaded,
'verbose|v' => \$verbose,
'valgrind' => \$use_valgrind,
'valgrind' => \$useValgrind,
'strict' => \$strictTesting,
);
if (!$getOptionsResult || $showHelp) {
......@@ -372,7 +375,7 @@ for my $test (@tests) {
close EXPECTED;
}
my $expectedMac;
if (isQt()) {
if (isQt() && $strictTesting) {
if (!$resetResults && open EXPECTED, "<", "$expectedTestResultsDirectory/$base-$expectedTagMac.txt") {
$expectedMac = "";
while (<EXPECTED>) {
......@@ -448,7 +451,7 @@ for my $test (@tests) {
}
}
if (isQt()) {
if (isQt() && $strictTesting) {
if (defined $expectedMac) {
my $simplified_actual;
$simplified_actual = $actual;
......@@ -903,11 +906,11 @@ sub openDumpRenderTreeIfNeeded()
$ENV{MallocStackLogging} = 1 if $checkLeaks;
$ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
my @args = ();
if ($use_valgrind) {
if ($useValgrind) {
push @args, $tool;
}
push @args, @toolArgs;
if ($use_valgrind) {
if ($useValgrind) {
$tool = "valgrind";
}
$dumpToolPID = open2(\*IN, \*OUT, $tool, @args) or die "Failed to start tool: $tool\n";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment