TestWebKitAPI has issues due to FastMalloc incompatibility
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jan 2012 00:15:09 +0000 (00:15 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jan 2012 00:15:09 +0000 (00:15 +0000)
<http://webkit.org/b/66521>
<rdar://problem/10607911>

Reviewed by David Levin.

Original patch by Dmitry Lomov <dslomov@google.com>.

This patch ensures that gtest uses the FastMalloc new and delete
operators that are defined in JavaScriptCore.

* gtest/README.WebKit: Update with project changes.
* gtest/include/gtest/internal/gtest-port.h: Import necessary
headers to use FastMalloc in gtest.
* gtest/msvc/gtest-md.vcproj: Add include directories to find
WTF headers.
* gtest/xcode/Config/DebugProject.xcconfig: Define
WEBCORE_PRIVATE_HEADERS_DIR for Debug builds.
* gtest/xcode/Config/General.xcconfig: Define
HEADER_SEARCH_PATHS in terms of WEBCORE_PRIVATE_HEADERS_DIR.
* gtest/xcode/Config/ProductionProject.xcconfig: Define
WEBCORE_PRIVATE_HEADERS_DIR for Production builds.  This
overrides the value in ReleaseProject.xcconfig.
* gtest/xcode/Config/ReleaseProject.xcconfig: Define
WEBCORE_PRIVATE_HEADERS_DIR for Release builds.
* gtest/xcode/gtest.xcodeproj/project.pbxproj:
- Remove local HEADER_SEARCH_PATHS definitions.
- Link to JavaScriptCore.framework when building
  gtest.framework.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104091 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/ThirdParty/ChangeLog
Source/ThirdParty/gtest/README.WebKit
Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h
Source/ThirdParty/gtest/msvc/gtest-md.vcproj
Source/ThirdParty/gtest/xcode/Config/DebugProject.xcconfig
Source/ThirdParty/gtest/xcode/Config/General.xcconfig
Source/ThirdParty/gtest/xcode/Config/ProductionProject.xcconfig
Source/ThirdParty/gtest/xcode/Config/ReleaseProject.xcconfig
Source/ThirdParty/gtest/xcode/gtest.xcodeproj/project.pbxproj

index 0a7e623664e44162d867103401602ccc71ad76da..4fcaa225ff81bbceb952f3ae651bd9970c876b96 100644 (file)
@@ -1,3 +1,35 @@
+2012-01-04  David Kilzer  <ddkilzer@apple.com>
+
+        TestWebKitAPI has issues due to FastMalloc incompatibility
+        <http://webkit.org/b/66521>
+        <rdar://problem/10607911>
+
+        Reviewed by David Levin.
+
+        Original patch by Dmitry Lomov <dslomov@google.com>.
+
+        This patch ensures that gtest uses the FastMalloc new and delete
+        operators that are defined in JavaScriptCore.
+
+        * gtest/README.WebKit: Update with project changes.
+        * gtest/include/gtest/internal/gtest-port.h: Import necessary
+        headers to use FastMalloc in gtest.
+        * gtest/msvc/gtest-md.vcproj: Add include directories to find
+        WTF headers.
+        * gtest/xcode/Config/DebugProject.xcconfig: Define
+        WEBCORE_PRIVATE_HEADERS_DIR for Debug builds.
+        * gtest/xcode/Config/General.xcconfig: Define
+        HEADER_SEARCH_PATHS in terms of WEBCORE_PRIVATE_HEADERS_DIR.
+        * gtest/xcode/Config/ProductionProject.xcconfig: Define
+        WEBCORE_PRIVATE_HEADERS_DIR for Production builds.  This
+        overrides the value in ReleaseProject.xcconfig.
+        * gtest/xcode/Config/ReleaseProject.xcconfig: Define
+        WEBCORE_PRIVATE_HEADERS_DIR for Release builds.
+        * gtest/xcode/gtest.xcodeproj/project.pbxproj:
+        - Remove local HEADER_SEARCH_PATHS definitions.
+        - Link to JavaScriptCore.framework when building
+          gtest.framework.
+
 2012-01-03  David Kilzer  <ddkilzer@apple.com>
 
         Add Production configuration to gtest Xcode project
index c426f5b20dcd1c166d6137926006f1abbd4f94aa..acae49d825502ff50e94ca5828875ce0dee32697 100644 (file)
@@ -2,6 +2,10 @@ GTest v.1.5.0
 
 http://googletest.googlecode.com/svn/tags/release-1.5.0/ 
 
+2012-01-04 Dmitry Lomov (dslomov@google.com)  David Kilzer (ddkilzer@apple.com)
+      - WebKit port of gtest uses FastMalloc "new" and "delete" operators from JavaScriptCore.
+      - The gtest.framework target now links to JavaScriptCore.framework.
+
 2011-12-22 David Kilzer (ddkilzer@apple.com)
       Added Production configuration to gtest Xcode project.
 
index 7924437a9f7f5d131be932c7fc71e30c9aee122a..fb3b376361fd1da543b55e8de3042f83c184991b 100644 (file)
 #include <sys/stat.h>
 #endif  // !_WIN32_WCE
 
+#include <wtf/Platform.h>
+#include <wtf/ExportMacros.h>
+#if USE(JSC)
+#include <runtime/JSExportMacros.h>
+#endif
+#include <wtf/Assertions.h>
+#include <wtf/FastMalloc.h>
+
 #include <iostream>  // NOLINT
 #include <sstream>  // NOLINT
 #include <string>  // NOLINT
index d88d001a97e32d638c17bee2aec583146cf3ed65..6c987e9c3a812be4e77f5f50ae3faffc57de2278 100644 (file)
@@ -20,7 +20,7 @@
                        OutputDirectory="$(ConfigurationBuildDir)\lib"
                        IntermediateDirectory="$(ConfigurationBuildDir)\obj\$(ProjectName)"
                        ConfigurationType="4"
-                       InheritedPropertySheets="$(ProjectDir)\..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops"
+                       InheritedPropertySheets="&quot;$(ProjectDir)\..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops&quot;"
                        CharacterSet="2"
                        >
                        <Tool
@@ -40,6 +40,7 @@
                        />
                        <Tool
                                Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;"
                                Optimization="0"
                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
                                MinimalRebuild="true"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;"
                                PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;"
                                Optimization="0"
                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
                                MinimalRebuild="true"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;"
                                PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;"
                                PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;"
                                Optimization="0"
                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
                                MinimalRebuild="true"
index 3d68157d5d512a880f186856c3ba10b4a2b18000..22d5c057e8af12c153274a75e14b5cbe78af354a 100644 (file)
@@ -28,3 +28,6 @@ OTHER_CFLAGS = $(OTHER_CFLAGS) -DDEBUG=1
 // These are turned off to avoid STL incompatibilities with client code
 // // Turns on special C++ STL checks to "encourage" good STL use
 // GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) _GLIBCXX_DEBUG_PEDANTIC _GLIBCXX_DEBUG _GLIBCPP_CONCEPT_CHECKS
+
+// Used by HEADER_SEARCH_PATHS in General.xcconfig
+WEBCORE_PRIVATE_HEADERS_DIR = $(BUILT_PRODUCTS_DIR)/WebCore.framework/PrivateHeaders;
index ebed809474f6474d3256c0de7a37b47e70272de7..50b7c2cb81b0735aa2cb10a18b9c4f4c603c0e2e 100644 (file)
@@ -12,6 +12,8 @@
 // Not building PowerPC any more
 ARCHS = i386 x86_64
 
+HEADER_SEARCH_PATHS = $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders ../ ../include/
+
 // Zerolink prevents link warnings so turn it off
 ZERO_LINK = NO
 
index 74455cfb41be03820a5c44a7f07b65e38ba74fc6..d118bb180b4ba41fbc5414559d17bbf42b6a6ea8 100644 (file)
@@ -10,3 +10,5 @@
 
 #include "ReleaseProject.xcconfig"
 
+// Used by HEADER_SEARCH_PATHS in General.xcconfig
+WEBCORE_PRIVATE_HEADERS_DIR = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/PrivateHeaders;
index 5349f0a04afc7837787828d3f424a889874ec932..5634fd6ba05693823586f402bc406bcb65acd4d2 100644 (file)
@@ -30,3 +30,6 @@ OTHER_CFLAGS = $(OTHER_CFLAGS) -DNDEBUG=1 -Wno-unused-variable
 
 // When we strip we want to strip all symbols in release, but save externals.
 STRIP_STYLE = all
+
+// Used by HEADER_SEARCH_PATHS in General.xcconfig
+WEBCORE_PRIVATE_HEADERS_DIR = $(BUILT_PRODUCTS_DIR)/WebCore.framework/PrivateHeaders;
index ef115576298766f99cee678d79f799d080e7b29c..0a64e4dd6fea00fe9a8ebdc08c2288865c1e0d1d 100644 (file)
@@ -74,6 +74,7 @@
                40C84993101A36A60083642A /* libgtest_main.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 40C8490B101A217E0083642A /* libgtest_main.a */; };
                40C849A2101A37050083642A /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4539C8FF0EC27F6400A70F4C /* gtest.framework */; };
                40C849A4101A37150083642A /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4539C8FF0EC27F6400A70F4C /* gtest.framework */; };
+               444D117514A262FB009FEC3F /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 444D117414A262FB009FEC3F /* JavaScriptCore.framework */; };
                4539C9340EC280AE00A70F4C /* gtest-param-test.h in Headers */ = {isa = PBXBuildFile; fileRef = 4539C9330EC280AE00A70F4C /* gtest-param-test.h */; settings = {ATTRIBUTES = (Public, ); }; };
                4539C9380EC280E200A70F4C /* gtest-linked_ptr.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 4539C9350EC280E200A70F4C /* gtest-linked_ptr.h */; };
                4539C9390EC280E200A70F4C /* gtest-param-util-generated.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 4539C9360EC280E200A70F4C /* gtest-param-util-generated.h */; };
                40D4CDF30E30E07400294801 /* General.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = General.xcconfig; sourceTree = "<group>"; };
                40D4CDF40E30E07400294801 /* ReleaseProject.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ReleaseProject.xcconfig; sourceTree = "<group>"; };
                40D4CF510E30F5E200294801 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+               444D117414A262FB009FEC3F /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                44C48DFF14A4098F00A2D9C7 /* ProductionProject.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ProductionProject.xcconfig; sourceTree = "<group>"; };
                4539C8FF0EC27F6400A70F4C /* gtest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = gtest.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                4539C9330EC280AE00A70F4C /* gtest-param-test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-param-test.h"; sourceTree = "<group>"; };
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
+               444D117214A2628F009FEC3F /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               444D117514A262FB009FEC3F /* JavaScriptCore.framework in Frameworks */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
                0867D691FE84028FC02AAC07 /* gtest */ = {
                        isa = PBXGroup;
                        children = (
+                               444D117414A262FB009FEC3F /* JavaScriptCore.framework */,
                                40D4CDF00E30E07400294801 /* Config */,
                                08FB77ACFE841707C02AAC07 /* Source */,
                                40D4CF4E0E30F5E200294801 /* Resources */,
                                8D07F2BD0486CC7A007CD1D0 /* Headers */,
                                404884A50E2F7C0400CF7658 /* Copy Headers Internal */,
                                8D07F2BF0486CC7A007CD1D0 /* Resources */,
+                               444D117214A2628F009FEC3F /* Frameworks */,
                        );
                        buildRules = (
                        );
                40899F450FFA7185000B29AE /* Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = ../;
                                PRODUCT_NAME = "gtest_unittest-framework";
                        };
                        name = Debug;
                40899F460FFA7185000B29AE /* Release */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = ../;
                                PRODUCT_NAME = "gtest_unittest-framework";
                        };
                        name = Release;
                        buildSettings = {
                                GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
                                GCC_SYMBOLS_PRIVATE_EXTERN = YES;
-                               HEADER_SEARCH_PATHS = (
-                                       ../,
-                                       ../include/,
-                               );
                                PRODUCT_NAME = gtest;
                        };
                        name = Debug;
                        buildSettings = {
                                GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
                                GCC_SYMBOLS_PRIVATE_EXTERN = YES;
-                               HEADER_SEARCH_PATHS = (
-                                       ../,
-                                       ../include/,
-                               );
                                PRODUCT_NAME = gtest;
                        };
                        name = Release;
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = 40899FB30FFA7567000B29AE /* StaticLibraryTarget.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       ../,
-                                       ../include/,
-                               );
                                PRODUCT_NAME = gtest_main;
                        };
                        name = Debug;
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = 40899FB30FFA7567000B29AE /* StaticLibraryTarget.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       ../,
-                                       ../include/,
-                               );
                                PRODUCT_NAME = gtest_main;
                        };
                        name = Release;
                40C84985101A36850083642A /* Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = ../;
                                PRODUCT_NAME = gtest_unittest;
                        };
                        name = Debug;
                40C84986101A36850083642A /* Release */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = ../;
                                PRODUCT_NAME = gtest_unittest;
                        };
                        name = Release;
                        buildSettings = {
                                DYLIB_COMPATIBILITY_VERSION = 1;
                                DYLIB_CURRENT_VERSION = 1;
-                               HEADER_SEARCH_PATHS = (
-                                       ../,
-                                       ../include/,
-                               );
                                INFOPLIST_FILE = Resources/Info.plist;
                                INFOPLIST_PREFIX_HEADER = "$(PROJECT_TEMP_DIR)/Version.h";
                                INFOPLIST_PREPROCESS = YES;
                        buildSettings = {
                                DYLIB_COMPATIBILITY_VERSION = 1;
                                DYLIB_CURRENT_VERSION = 1;
-                               HEADER_SEARCH_PATHS = (
-                                       ../,
-                                       ../include/,
-                               );
                                INFOPLIST_FILE = Resources/Info.plist;
                                INFOPLIST_PREFIX_HEADER = "$(PROJECT_TEMP_DIR)/Version.h";
                                INFOPLIST_PREPROCESS = YES;