Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Qt] Compile WTF tests of TestWebKitAPI

https://bugs.webkit.org/show_bug.cgi?id=108935

Reviewed by Kenneth Rohde Christiansen.

.:

Build gtest on Linux.

* WebKit.pro:

Source/ThirdParty:

Add qmake build system .pro file for building gtest as static library.

* gtest/gtest.pro: Added.

Tools:

Add initial stubs and files for building at least the WTF tests.
The WK2 tests need more platform code, in particular PlatformWebView
and injected bundle support.

* TestWebKitAPI/TestWebKitAPI.pri: Added.
* TestWebKitAPI/TestWebKitAPI.pro: Added.
* TestWebKitAPI/Tests/WTF/WTF.pro: Added.
* TestWebKitAPI/qt/InjectedBundleControllerQt.cpp: Added.
(TestWebKitAPI):
(TestWebKitAPI::InjectedBundleController::platformInitialize):
* TestWebKitAPI/qt/PlatformUtilitiesQt.cpp: Added.
(Util):
(TestWebKitAPI::Util::run):
(TestWebKitAPI::Util::sleep):
(TestWebKitAPI::Util::createInjectedBundlePath):
(TestWebKitAPI::Util::createURLForResource):
(TestWebKitAPI::Util::URLForNonExistentResource):
* TestWebKitAPI/qt/main.cpp: Added.
(main):
* Tools.pro:
* qmake/mkspecs/features/default_post.prf:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information...
commit db2d1d4d3981c88ae3c8008d5fc330ece1120662 1 parent 1188d65
hausmann@webkit.org authored
View
11 ChangeLog
@@ -1,3 +1,14 @@
+2013-02-05 Simon Hausmann <simon.hausmann@digia.com>
+
+ [Qt] Compile WTF tests of TestWebKitAPI
+ https://bugs.webkit.org/show_bug.cgi?id=108935
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Build gtest on Linux.
+
+ * WebKit.pro:
+
2013-02-06 Jonathon Jongsma <jonathon.jongsma@collabora.com>
[GStreamer] MediaPlayer's code is not easily reusable by other GStreamer-based players
View
11 Source/ThirdParty/ChangeLog
@@ -1,3 +1,14 @@
+2013-02-05 Simon Hausmann <simon.hausmann@digia.com>
+
+ [Qt] Compile WTF tests of TestWebKitAPI
+ https://bugs.webkit.org/show_bug.cgi?id=108935
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add qmake build system .pro file for building gtest as static library.
+
+ * gtest/gtest.pro: Added.
+
2013-02-05 Paweł Forysiuk <tuxator@o2.pl>
Building with MinGW compiler dies with gtest errors
View
14 Source/ThirdParty/gtest/gtest.pro
@@ -0,0 +1,14 @@
+TEMPLATE = lib
+CONFIG += static
+TARGET = gtest
+
+DEFINES += QT_NO_KEYWORDS
+
+INCLUDEPATH += $$PWD/include $${ROOT_WEBKIT_DIR}/Source/WTF $${ROOT_WEBKIT_DIR}/Source/JavaScriptCore $$QT.core.includes
+
+HEADERS = $$PWD/include/gtest/*.h $$PWD/include/gtest/internal/*.h
+SOURCES = $$PWD/src/gtest-all.cc
+
+QT =
+
+CONFIG += compiling_thirdparty_code
View
29 Tools/ChangeLog
@@ -1,3 +1,32 @@
+2013-02-05 Simon Hausmann <simon.hausmann@digia.com>
+
+ [Qt] Compile WTF tests of TestWebKitAPI
+ https://bugs.webkit.org/show_bug.cgi?id=108935
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add initial stubs and files for building at least the WTF tests.
+ The WK2 tests need more platform code, in particular PlatformWebView
+ and injected bundle support.
+
+ * TestWebKitAPI/TestWebKitAPI.pri: Added.
+ * TestWebKitAPI/TestWebKitAPI.pro: Added.
+ * TestWebKitAPI/Tests/WTF/WTF.pro: Added.
+ * TestWebKitAPI/qt/InjectedBundleControllerQt.cpp: Added.
+ (TestWebKitAPI):
+ (TestWebKitAPI::InjectedBundleController::platformInitialize):
+ * TestWebKitAPI/qt/PlatformUtilitiesQt.cpp: Added.
+ (Util):
+ (TestWebKitAPI::Util::run):
+ (TestWebKitAPI::Util::sleep):
+ (TestWebKitAPI::Util::createInjectedBundlePath):
+ (TestWebKitAPI::Util::createURLForResource):
+ (TestWebKitAPI::Util::URLForNonExistentResource):
+ * TestWebKitAPI/qt/main.cpp: Added.
+ (main):
+ * Tools.pro:
+ * qmake/mkspecs/features/default_post.prf:
+
2013-02-06 Roger Fong <roger_fong@apple.com>
VS2010 WinLauncher project, property sheets and resources.
View
14 Tools/TestWebKitAPI/TestWebKitAPI.pri
@@ -0,0 +1,14 @@
+
+INCLUDEPATH += $$PWD $${ROOT_WEBKIT_DIR}/Source/ThirdParty/gtest/include
+WEBKIT += wtf javascriptcore
+
+DEFINES += QT_NO_CAST_FROM_ASCII
+
+QT += core gui webkit
+
+CONFIG += compiling_thirdparty_code
+
+SOURCES += $$PWD/*.cpp
+SOURCES += $$PWD/qt/*.cpp
+
+LIBS += -L$${ROOT_BUILD_DIR}/Source/ThirdParty/gtest/$$activeBuildConfig() -lgtest
View
3  Tools/TestWebKitAPI/TestWebKitAPI.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+
+SUBDIRS += Tests/WTF
View
26 Tools/TestWebKitAPI/Tests/WTF/WTF.pro
@@ -0,0 +1,26 @@
+TEMPLATE = app
+TARGET = tst_wtf
+
+SOURCES += \
+ AtomicString.cpp \
+ CheckedArithmeticOperations.cpp \
+ CString.cpp \
+ Functional.cpp \
+ HashMap.cpp \
+ HashSet.cpp \
+ IntegerToStringConversion.cpp \
+ ListHashSet.cpp \
+ MathExtras.cpp \
+ MediaTime.cpp \
+ RedBlackTree.cpp \
+ SaturatedArithmeticOperations.cpp \
+ StringBuilder.cpp \
+ StringImpl.cpp \
+ StringOperators.cpp \
+ TemporaryChange.cpp \
+ VectorBasic.cpp \
+ Vector.cpp \
+ VectorReverse.cpp \
+ WTFString.cpp
+
+include(../../TestWebKitAPI.pri)
View
35 Tools/TestWebKitAPI/qt/InjectedBundleControllerQt.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 "InjectedBundleController.h"
+
+namespace TestWebKitAPI {
+
+void InjectedBundleController::platformInitialize()
+{
+}
+
+} // namespace TestWebKitAPI
View
60 Tools/TestWebKitAPI/qt/PlatformUtilitiesQt.cpp
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+
+#include <QCoreApplication>
+
+#include <unistd.h>
+
+namespace TestWebKitAPI {
+namespace Util {
+
+void run(bool* done)
+{
+ while (!*done)
+ QCoreApplication::processEvents();
+}
+
+void sleep(double seconds)
+{
+ usleep(seconds * 1000000);
+}
+
+WKStringRef createInjectedBundlePath()
+{
+ // ### FIXME.
+ return WKStringCreateWithUTF8CString("");
+}
+
+WKURLRef createURLForResource(const char* resource, const char* extension)
+{
+ // ### FIXME.
+ return WKURLCreateWithUTF8CString("");
+}
+
+WKURLRef URLForNonExistentResource()
+{
+ return WKURLCreateWithUTF8CString("file:///does-not-exist.html");
+}
+
+} // namespace Util
+} // namespace TestWebKitAPI
View
31 Tools/TestWebKitAPI/qt/main.cpp
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ */
+
+#include "config.h"
+#include "TestsController.h"
+
+#include <QGuiApplication>
+
+int main(int argc, char** argv)
+{
+ QGuiApplication app(argc, argv);
+
+ return TestWebKitAPI::TestsController::shared().run(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
View
7 Tools/Tools.pro
@@ -20,6 +20,13 @@ build?(webkit2) {
have?(QTQUICK): SUBDIRS += MiniBrowser/qt/MiniBrowser.pro
SUBDIRS += MiniBrowser/qt/raw/MiniBrowserRaw.pro
}
+
+ !production_build {
+ # Only tested on Linux so far.
+ linux* {
+ SUBDIRS += TestWebKitAPI
+ }
+ }
}
build?(imagediff): SUBDIRS += ImageDiff/ImageDiff.pro
View
2  Tools/qmake/mkspecs/features/default_post.prf
@@ -51,7 +51,7 @@ INCLUDEPATH += \
CONFIG -= warn_on
-*-g++*: QMAKE_CXXFLAGS = \
+!compiling_thirdparty_code:*-g++*: QMAKE_CXXFLAGS = \
-Wall \
-Wextra \
-Wreturn-type \
View
9 WebKit.pro
@@ -44,6 +44,15 @@ QtWebKit.file = Source/QtWebKit.pro
QtWebKit.makefile = Makefile.QtWebKit
SUBDIRS += QtWebKit
+!production_build {
+ # Only tested on Linux so far.
+ linux* {
+ gtest.file = Source/ThirdParty/gtest/gtest.pro
+ gtest.makefile = Makefile.gtest
+ SUBDIRS += gtest
+ }
+}
+
Tools.file = Tools/Tools.pro
Tools.makefile = Makefile.Tools
SUBDIRS += Tools
Please sign in to comment.
Something went wrong with that request. Please try again.