Changeset 86108 in webkit


Ignore:
Timestamp:
May 9, 2011 5:17:50 PM (13 years ago)
Author:
levin@chromium.org
Message:

Switch TestWebKitAPI to GTest
https://bugs.webkit.org/show_bug.cgi?id=59561

Patch by Dmitry Lomov <dslomov@google.com> on 2011-05-09
Reviewed by Sam Weinig.

.:

  • Source/ThirdParty/gtest/README.WebKit:
  • Source/ThirdParty/gtest/msvc/gtest-md.vcproj:

Source/WebKit/win:

  • WebKit.vcproj/WebKit.sln:

Tools:

  • Scripts/build-api-tests:
  • Scripts/run-api-tests:
  • TestWebKitAPI/Configurations/TestWebKitAPICommon.vsprops:
  • TestWebKitAPI/Test.h:
  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WTF/VectorBasic.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/TestsController.cpp:

(TestWebKitAPI::TestsController::TestsController):
(TestWebKitAPI::TestsController::dumpTestNames):
(TestWebKitAPI::TestsController::runTestNamed):
(TestWebKitAPI::TestsController::runAllTests):

  • TestWebKitAPI/TestsController.h:
  • TestWebKitAPI/mac/main.mm:

(main):

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r86084 r86108  
     12011-05-09  Dmitry Lomov  <dslomov@google.com>
     2
     3        Reviewed by Sam Weinig.
     4       
     5        Switch TestWebKitAPI to GTest
     6        https://bugs.webkit.org/show_bug.cgi?id=59561
     7
     8        * Source/ThirdParty/gtest/README.WebKit:
     9        * Source/ThirdParty/gtest/msvc/gtest-md.vcproj:
     10
    1112011-05-09  Xan Lopez  <xlopez@igalia.com>
    212
  • trunk/Source/ThirdParty/gtest/README.WebKit

    r83815 r86108  
    22
    33http://googletest.googlecode.com/svn/tags/release-1.5.0/
     4
     52011-05-06 Dmitry Lomov (dslomov@google.com)
     6      gtest-md.vcproj upgraded to VS 2005 (8.0) format to match the rest of WebKit
  • trunk/Source/ThirdParty/gtest/msvc/gtest-md.vcproj

    r83815 r86108  
    22<VisualStudioProject
    33        ProjectType="Visual C++"
    4         Version="7.10"
     4        Version="8.00"
    55        Name="gtest-md"
    66        ProjectGUID="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}"
    7         Keyword="Win32Proj">
     7        RootNamespace="gtest-md"
     8        Keyword="Win32Proj"
     9        >
    810        <Platforms>
    911                <Platform
    10                         Name="Win32"/>
     12                        Name="Win32"
     13                />
    1114        </Platforms>
     15        <ToolFiles>
     16        </ToolFiles>
    1217        <Configurations>
    1318                <Configuration
    1419                        Name="Debug|Win32"
    15                         OutputDirectory="$(SolutionName)/$(ConfigurationName)"
    16                         IntermediateDirectory="$(OutDir)/$(ProjectName)"
     20                        OutputDirectory="$(ConfigurationBuildDir)\lib"
    1721                        ConfigurationType="4"
     22                        InheritedPropertySheets="$(ProjectDir)\..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops"
    1823                        CharacterSet="2"
    19                         ReferencesPath="">
     24                        >
     25                        <Tool
     26                                Name="VCPreBuildEventTool"
     27                        />
     28                        <Tool
     29                                Name="VCCustomBuildTool"
     30                        />
     31                        <Tool
     32                                Name="VCXMLDataGeneratorTool"
     33                        />
     34                        <Tool
     35                                Name="VCWebServiceProxyGeneratorTool"
     36                        />
     37                        <Tool
     38                                Name="VCMIDLTool"
     39                        />
    2040                        <Tool
    2141                                Name="VCCLCompilerTool"
    2242                                Optimization="0"
    2343                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
    24                                 MinimalRebuild="TRUE"
     44                                MinimalRebuild="true"
    2545                                BasicRuntimeChecks="3"
    2646                                RuntimeLibrary="3"
    2747                                UsePrecompiledHeader="0"
    2848                                WarningLevel="3"
    29                                 Detect64BitPortabilityProblems="FALSE"
    30                                 DebugInformationFormat="4"/>
    31                         <Tool
    32                                 Name="VCCustomBuildTool"/>
     49                                Detect64BitPortabilityProblems="false"
     50                                DebugInformationFormat="4"
     51                        />
     52                        <Tool
     53                                Name="VCManagedResourceCompilerTool"
     54                        />
     55                        <Tool
     56                                Name="VCResourceCompilerTool"
     57                        />
     58                        <Tool
     59                                Name="VCPreLinkEventTool"
     60                        />
    3361                        <Tool
    3462                                Name="VCLibrarianTool"
    35                                 OutputFile="$(OutDir)/gtestd.lib"/>
    36                         <Tool
    37                                 Name="VCMIDLTool"/>
    38                         <Tool
    39                                 Name="VCPostBuildEventTool"/>
    40                         <Tool
    41                                 Name="VCPreBuildEventTool"/>
    42                         <Tool
    43                                 Name="VCPreLinkEventTool"/>
    44                         <Tool
    45                                 Name="VCResourceCompilerTool"/>
    46                         <Tool
    47                                 Name="VCWebServiceProxyGeneratorTool"/>
    48                         <Tool
    49                                 Name="VCXMLDataGeneratorTool"/>
    50                         <Tool
    51                                 Name="VCManagedWrapperGeneratorTool"/>
    52                         <Tool
    53                                 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
     63                                OutputFile="$(OutDir)\gtest.lib"
     64                        />
     65                        <Tool
     66                                Name="VCALinkTool"
     67                        />
     68                        <Tool
     69                                Name="VCXDCMakeTool"
     70                        />
     71                        <Tool
     72                                Name="VCBscMakeTool"
     73                        />
     74                        <Tool
     75                                Name="VCFxCopTool"
     76                        />
     77                        <Tool
     78                                Name="VCPostBuildEventTool"
     79                        />
    5480                </Configuration>
    5581                <Configuration
    5682                        Name="Release|Win32"
    57                         OutputDirectory="$(SolutionName)/$(ConfigurationName)"
    58                         IntermediateDirectory="$(OutDir)/$(ProjectName)"
     83                        OutputDirectory="$(ConfigurationBuildDir)\lib"
    5984                        ConfigurationType="4"
     85                        InheritedPropertySheets="$(ProjectDir)\..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops"
    6086                        CharacterSet="2"
    61                         ReferencesPath="&quot;..\include&quot;;&quot;..&quot;">
     87                        >
     88                        <Tool
     89                                Name="VCPreBuildEventTool"
     90                        />
     91                        <Tool
     92                                Name="VCCustomBuildTool"
     93                        />
     94                        <Tool
     95                                Name="VCXMLDataGeneratorTool"
     96                        />
     97                        <Tool
     98                                Name="VCWebServiceProxyGeneratorTool"
     99                        />
     100                        <Tool
     101                                Name="VCMIDLTool"
     102                        />
    62103                        <Tool
    63104                                Name="VCCLCompilerTool"
     
    66107                                UsePrecompiledHeader="0"
    67108                                WarningLevel="3"
    68                                 Detect64BitPortabilityProblems="FALSE"
    69                                 DebugInformationFormat="3"/>
    70                         <Tool
    71                                 Name="VCCustomBuildTool"/>
     109                                Detect64BitPortabilityProblems="false"
     110                                DebugInformationFormat="3"
     111                        />
     112                        <Tool
     113                                Name="VCManagedResourceCompilerTool"
     114                        />
     115                        <Tool
     116                                Name="VCResourceCompilerTool"
     117                        />
     118                        <Tool
     119                                Name="VCPreLinkEventTool"
     120                        />
    72121                        <Tool
    73122                                Name="VCLibrarianTool"
    74                                 OutputFile="$(OutDir)/gtest.lib"/>
    75                         <Tool
    76                                 Name="VCMIDLTool"/>
    77                         <Tool
    78                                 Name="VCPostBuildEventTool"/>
    79                         <Tool
    80                                 Name="VCPreBuildEventTool"/>
    81                         <Tool
    82                                 Name="VCPreLinkEventTool"/>
    83                         <Tool
    84                                 Name="VCResourceCompilerTool"/>
    85                         <Tool
    86                                 Name="VCWebServiceProxyGeneratorTool"/>
    87                         <Tool
    88                                 Name="VCXMLDataGeneratorTool"/>
    89                         <Tool
    90                                 Name="VCManagedWrapperGeneratorTool"/>
    91                         <Tool
    92                                 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
     123                                OutputFile="$(OutDir)\gtest.lib"
     124                        />
     125                        <Tool
     126                                Name="VCALinkTool"
     127                        />
     128                        <Tool
     129                                Name="VCXDCMakeTool"
     130                        />
     131                        <Tool
     132                                Name="VCBscMakeTool"
     133                        />
     134                        <Tool
     135                                Name="VCFxCopTool"
     136                        />
     137                        <Tool
     138                                Name="VCPostBuildEventTool"
     139                        />
    93140                </Configuration>
    94141        </Configurations>
     
    99146                        Name="Source Files"
    100147                        Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
    101                         UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
    102                         <File
    103                                 RelativePath="..\src\gtest-death-test.cc">
    104                                 <FileConfiguration
    105                                         Name="Debug|Win32">
    106                                         <Tool
    107                                                 Name="VCCLCompilerTool"
    108                                                 AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
    109                                 </FileConfiguration>
    110                                 <FileConfiguration
    111                                         Name="Release|Win32">
    112                                         <Tool
    113                                                 Name="VCCLCompilerTool"
    114                                                 AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
    115                                 </FileConfiguration>
    116                         </File>
    117                         <File
    118                                 RelativePath="..\src\gtest-filepath.cc">
    119                                 <FileConfiguration
    120                                         Name="Debug|Win32">
    121                                         <Tool
    122                                                 Name="VCCLCompilerTool"
    123                                                 AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
    124                                 </FileConfiguration>
    125                                 <FileConfiguration
    126                                         Name="Release|Win32">
    127                                         <Tool
    128                                                 Name="VCCLCompilerTool"
    129                                                 AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
    130                                 </FileConfiguration>
    131                         </File>
    132                         <File
    133                                 RelativePath="..\src\gtest-port.cc">
    134                                 <FileConfiguration
    135                                         Name="Debug|Win32">
    136                                         <Tool
    137                                                 Name="VCCLCompilerTool"
    138                                                 AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
    139                                 </FileConfiguration>
    140                                 <FileConfiguration
    141                                         Name="Release|Win32">
    142                                         <Tool
    143                                                 Name="VCCLCompilerTool"
    144                                                 AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
    145                                 </FileConfiguration>
    146                         </File>
    147                         <File
    148                                 RelativePath="..\src\gtest-test-part.cc">
    149                                 <FileConfiguration
    150                                         Name="Debug|Win32">
    151                                         <Tool
    152                                                 Name="VCCLCompilerTool"
    153                                                 AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
    154                                 </FileConfiguration>
    155                                 <FileConfiguration
    156                                         Name="Release|Win32">
    157                                         <Tool
    158                                                 Name="VCCLCompilerTool"
    159                                                 AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
    160                                 </FileConfiguration>
    161                         </File>
    162                         <File
    163                                 RelativePath="..\src\gtest-typed-test.cc">
    164                                 <FileConfiguration
    165                                         Name="Debug|Win32">
    166                                         <Tool
    167                                                 Name="VCCLCompilerTool"
    168                                                 AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
    169                                 </FileConfiguration>
    170                                 <FileConfiguration
    171                                         Name="Release|Win32">
    172                                         <Tool
    173                                                 Name="VCCLCompilerTool"
    174                                                 AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
    175                                 </FileConfiguration>
    176                         </File>
    177                         <File
    178                                 RelativePath="..\src\gtest.cc">
    179                                 <FileConfiguration
    180                                         Name="Debug|Win32">
    181                                         <Tool
    182                                                 Name="VCCLCompilerTool"
    183                                                 AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
    184                                 </FileConfiguration>
    185                                 <FileConfiguration
    186                                         Name="Release|Win32">
    187                                         <Tool
    188                                                 Name="VCCLCompilerTool"
    189                                                 AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
     148                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
     149                        >
     150                        <File
     151                                RelativePath="..\src\gtest-death-test.cc"
     152                                >
     153                                <FileConfiguration
     154                                        Name="Debug|Win32"
     155                                        >
     156                                        <Tool
     157                                                Name="VCCLCompilerTool"
     158                                                AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
     159                                        />
     160                                </FileConfiguration>
     161                                <FileConfiguration
     162                                        Name="Release|Win32"
     163                                        >
     164                                        <Tool
     165                                                Name="VCCLCompilerTool"
     166                                                AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
     167                                        />
     168                                </FileConfiguration>
     169                        </File>
     170                        <File
     171                                RelativePath="..\src\gtest-filepath.cc"
     172                                >
     173                                <FileConfiguration
     174                                        Name="Debug|Win32"
     175                                        >
     176                                        <Tool
     177                                                Name="VCCLCompilerTool"
     178                                                AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
     179                                        />
     180                                </FileConfiguration>
     181                                <FileConfiguration
     182                                        Name="Release|Win32"
     183                                        >
     184                                        <Tool
     185                                                Name="VCCLCompilerTool"
     186                                                AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
     187                                        />
     188                                </FileConfiguration>
     189                        </File>
     190                        <File
     191                                RelativePath="..\src\gtest-port.cc"
     192                                >
     193                                <FileConfiguration
     194                                        Name="Debug|Win32"
     195                                        >
     196                                        <Tool
     197                                                Name="VCCLCompilerTool"
     198                                                AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
     199                                        />
     200                                </FileConfiguration>
     201                                <FileConfiguration
     202                                        Name="Release|Win32"
     203                                        >
     204                                        <Tool
     205                                                Name="VCCLCompilerTool"
     206                                                AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
     207                                        />
     208                                </FileConfiguration>
     209                        </File>
     210                        <File
     211                                RelativePath="..\src\gtest-test-part.cc"
     212                                >
     213                                <FileConfiguration
     214                                        Name="Debug|Win32"
     215                                        >
     216                                        <Tool
     217                                                Name="VCCLCompilerTool"
     218                                                AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
     219                                        />
     220                                </FileConfiguration>
     221                                <FileConfiguration
     222                                        Name="Release|Win32"
     223                                        >
     224                                        <Tool
     225                                                Name="VCCLCompilerTool"
     226                                                AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
     227                                        />
     228                                </FileConfiguration>
     229                        </File>
     230                        <File
     231                                RelativePath="..\src\gtest-typed-test.cc"
     232                                >
     233                                <FileConfiguration
     234                                        Name="Debug|Win32"
     235                                        >
     236                                        <Tool
     237                                                Name="VCCLCompilerTool"
     238                                                AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
     239                                        />
     240                                </FileConfiguration>
     241                                <FileConfiguration
     242                                        Name="Release|Win32"
     243                                        >
     244                                        <Tool
     245                                                Name="VCCLCompilerTool"
     246                                                AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
     247                                        />
     248                                </FileConfiguration>
     249                        </File>
     250                        <File
     251                                RelativePath="..\src\gtest.cc"
     252                                >
     253                                <FileConfiguration
     254                                        Name="Debug|Win32"
     255                                        >
     256                                        <Tool
     257                                                Name="VCCLCompilerTool"
     258                                                AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
     259                                        />
     260                                </FileConfiguration>
     261                                <FileConfiguration
     262                                        Name="Release|Win32"
     263                                        >
     264                                        <Tool
     265                                                Name="VCCLCompilerTool"
     266                                                AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
     267                                        />
    190268                                </FileConfiguration>
    191269                        </File>
     
    194272                        Name="Header Files"
    195273                        Filter="h;hpp;hxx;hm;inl;inc;xsd"
    196                         UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
    197                         <File
    198                                 RelativePath="..\include\gtest\internal\gtest-death-test-internal.h">
    199                         </File>
    200                         <File
    201                                 RelativePath="..\include\gtest\gtest-death-test.h">
    202                         </File>
    203                         <File
    204                                 RelativePath="..\include\gtest\internal\gtest-filepath.h">
    205                         </File>
    206                         <File
    207                                 RelativePath="..\src\gtest-internal-inl.h">
    208                         </File>
    209                         <File
    210                                 RelativePath="..\include\gtest\internal\gtest-internal.h">
    211                         </File>
    212                         <File
    213                                 RelativePath="..\include\gtest\gtest-message.h">
    214                         </File>
    215                         <File
    216                                 RelativePath="..\include\gtest\internal\gtest-port.h">
    217                         </File>
    218                         <File
    219                                 RelativePath="..\include\gtest\gtest-spi.h">
    220                         </File>
    221                         <File
    222                                 RelativePath="..\include\gtest\internal\gtest-string.h">
    223                         </File>
    224                         <File
    225                                 RelativePath="..\include\gtest\gtest.h">
    226                         </File>
    227                         <File
    228                                 RelativePath="..\include\gtest\gtest_pred_impl.h">
    229                         </File>
    230                         <File
    231                                 RelativePath="..\include\gtest\gtest_prod.h">
     274                        UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
     275                        >
     276                        <File
     277                                RelativePath="..\include\gtest\internal\gtest-death-test-internal.h"
     278                                >
     279                        </File>
     280                        <File
     281                                RelativePath="..\include\gtest\gtest-death-test.h"
     282                                >
     283                        </File>
     284                        <File
     285                                RelativePath="..\include\gtest\internal\gtest-filepath.h"
     286                                >
     287                        </File>
     288                        <File
     289                                RelativePath="..\src\gtest-internal-inl.h"
     290                                >
     291                        </File>
     292                        <File
     293                                RelativePath="..\include\gtest\internal\gtest-internal.h"
     294                                >
     295                        </File>
     296                        <File
     297                                RelativePath="..\include\gtest\gtest-message.h"
     298                                >
     299                        </File>
     300                        <File
     301                                RelativePath="..\include\gtest\internal\gtest-port.h"
     302                                >
     303                        </File>
     304                        <File
     305                                RelativePath="..\include\gtest\gtest-spi.h"
     306                                >
     307                        </File>
     308                        <File
     309                                RelativePath="..\include\gtest\internal\gtest-string.h"
     310                                >
     311                        </File>
     312                        <File
     313                                RelativePath="..\include\gtest\gtest.h"
     314                                >
     315                        </File>
     316                        <File
     317                                RelativePath="..\include\gtest\gtest_pred_impl.h"
     318                                >
     319                        </File>
     320                        <File
     321                                RelativePath="..\include\gtest\gtest_prod.h"
     322                                >
    232323                        </File>
    233324                </Filter>
  • trunk/Source/WebKit/win/ChangeLog

    r86018 r86108  
     12011-05-09  Dmitry Lomov  <dslomov@google.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Switch TestWebKitAPI to GTest
     6        https://bugs.webkit.org/show_bug.cgi?id=59561
     7
     8        * WebKit.vcproj/WebKit.sln:
     9
    1102011-05-07  Sheriff Bot  <webkit.review.bot@gmail.com>
    211
  • trunk/Source/WebKit/win/WebKit.vcproj/WebKit.sln

    r82477 r86108  
    153153                {3E48AB23-D249-488F-A1C4-43CDF52FBD28} = {3E48AB23-D249-488F-A1C4-43CDF52FBD28}
    154154        EndProjectSection
     155EndProject
     156Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-md", "..\..\..\ThirdParty\gtest\msvc\gtest-md.vcproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}"
    155157EndProject
    156158Global
     
    510512                {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release|Win32.ActiveCfg = Release|Win32
    511513                {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release|Win32.Build.0 = Release|Win32
     514                {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug_All|Win32.ActiveCfg = Debug|Win32
     515                {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug_All|Win32.Build.0 = Debug|Win32
     516                {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug_Cairo_CFLite|Win32.ActiveCfg = Debug|Win32
     517                {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug_Cairo_CFLite|Win32.Build.0 = Debug|Win32
     518                {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug|Win32.ActiveCfg = Debug|Win32
     519                {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug|Win32.Build.0 = Debug|Win32
     520                {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Production|Win32.ActiveCfg = Release|Win32
     521                {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Production|Win32.Build.0 = Release|Win32
     522                {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release_Cairo_CFLite|Win32.ActiveCfg = Release|Win32
     523                {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release_Cairo_CFLite|Win32.Build.0 = Release|Win32
     524                {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release|Win32.ActiveCfg = Release|Win32
     525                {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release|Win32.Build.0 = Release|Win32
    512526        EndGlobalSection
    513527        GlobalSection(SolutionProperties) = preSolution
  • trunk/Tools/ChangeLog

    r86090 r86108  
     12011-05-09  Dmitry Lomov  <dslomov@google.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Switch TestWebKitAPI to GTest
     6        https://bugs.webkit.org/show_bug.cgi?id=59561
     7
     8        * Scripts/build-api-tests:
     9        * Scripts/run-api-tests:
     10        * TestWebKitAPI/Configurations/TestWebKitAPICommon.vsprops:
     11        * TestWebKitAPI/Test.h:
     12        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     13        * TestWebKitAPI/Tests/WTF/VectorBasic.cpp:
     14        (TestWebKitAPI::TEST):
     15        * TestWebKitAPI/TestsController.cpp:
     16        (TestWebKitAPI::TestsController::TestsController):
     17        (TestWebKitAPI::TestsController::dumpTestNames):
     18        (TestWebKitAPI::TestsController::runTestNamed):
     19        (TestWebKitAPI::TestsController::runAllTests):
     20        * TestWebKitAPI/TestsController.h:
     21        * TestWebKitAPI/mac/main.mm:
     22        (main):
     23
    1242011-05-09  Igor Oliveira  <igor.oliveira@openbossa.org>
    225
  • trunk/Tools/Scripts/build-api-tests

    r74301 r86108  
    5757
    5858# Build
    59 chdir "Tools/TestWebKitAPI" or die;
    6059
    6160my $result;
    6261if (isAppleMacWebKit()) {
     62    chdir "Source/ThirdParty/gtest";
     63    buildXCodeProject("xcode/gtest", $clean, XcodeOptions(), @ARGV);
     64    chdir "../../../Tools/TestWebKitAPI" or die;
    6365    $result = buildXCodeProject("TestWebKitAPI", $clean, XcodeOptions(), @ARGV);
    6466} elsif (isAppleWinWebKit()) {
     67    chdir "Tools/TestWebKitAPI" or die;
    6568    $result = buildVisualStudioProject("win/TestWebKitAPI.sln", $clean);
    6669} else {
  • trunk/Tools/Scripts/run-api-tests

    r80357 r86108  
    123123{
    124124    my ($suite, $testName) = @_;
    125     my $test = $suite . "/" . $testName;
     125    my $test = $suite . "." . $testName;
    126126
    127127    print "    Test: $testName -> ";
     
    236236    for my $test (@tests) {
    237237        $test =~ s/[\r\n]*$//;
    238         my ($suite, $testName) = split(/\//, $test);
     238        my ($suite, $testName) = split(/\./, $test);
    239239        push @{$keyedTests{$suite}}, $testName;
    240240    }
  • trunk/Tools/TestWebKitAPI/Configurations/TestWebKitAPICommon.vsprops

    r75138 r86108  
    77        <Tool
    88                Name="VCCLCompilerTool"
    9                 AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ConfigurationBuildDir)\include&quot;;&quot;$(ConfigurationBuildDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include&quot;"
     9                AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ConfigurationBuildDir)\include&quot;;&quot;$(ConfigurationBuildDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(ProjectDir)\..\..\..\Source\ThirdParty\gtest\include&quot;"
    1010                ForcedIncludeFiles="TestWebKitAPIPrefix.h"
    1111        />
    1212        <Tool
    1313                Name="VCLinkerTool"
    14                 AdditionalDependencies="WebKit$(WebKitDLLConfigSuffix).lib JavaScriptCore$(WebKitDLLConfigSuffix).lib"
     14                AdditionalDependencies="WebKit$(WebKitDLLConfigSuffix).lib JavaScriptCore$(WebKitDLLConfigSuffix).lib gtest.lib"
    1515                SubSystem="1"
    1616        />
  • trunk/Tools/TestWebKitAPI/Test.h

    r77672 r86108  
    2929#include "TestsController.h"
    3030
     31#include <gtest/gtest.h>
     32
    3133namespace TestWebKitAPI {
    3234
    33 // Abstract base class that all tests inherit from.
    34 class Test {
    35 public:
    36     virtual ~Test() { }
    37    
    38     virtual void run() = 0;
    39     std::string name() const { return m_identifier; }
    40    
    41     template<typename TestClassTy> class Register {
    42     public:
    43         Register(const std::string& testSuite, const std::string& testCase)
    44         {
    45             TestsController::shared().registerCreateTestFunction(testSuite + "/" + testCase, Register::create);
    46         }
    47    
    48     private:
    49         static Test* create(const std::string& identifier)
    50         {
    51             return new TestClassTy(identifier);
    52         }
    53     };
    54 
    55 protected:
    56     Test(const std::string& identifier)
    57         : m_identifier(identifier)
    58     {
    59     }
    60 
    61     std::string m_identifier;
    62 };
    63 
    64 #define TEST_CLASS_NAME(testSuite, testCaseName) testSuite##testCaseName##_Test
    65 #define TEST_REGISTRAR_NAME(testSuite, testCaseName) testSuite##testCaseName##_Registrar
    66 
    67 // Use this to define a new test.
    68 #define TEST(testSuite, testCaseName) \
    69     class TEST_CLASS_NAME(testSuite, testCaseName) : public Test { \
    70     public: \
    71         TEST_CLASS_NAME(testSuite, testCaseName)(const std::string& identifier) \
    72             : Test(identifier) \
    73         { \
     35#define TEST_ASSERT(expression) EXPECT_TRUE(expression)
     36#define TEST_ASSERT_RETURN(expression, returnValue) \
     37    do { \
     38        if (!(expression)) { \
     39            EXPECT_FALSE(true) << #expression; \
     40            return (returnValue); \
    7441        } \
    75         virtual void run(); \
    76     }; \
    77     \
    78     static Test::Register<TEST_CLASS_NAME(testSuite, testCaseName)> TEST_REGISTRAR_NAME(testSuite, testCaseName)(#testSuite, #testCaseName); \
    79     \
    80     void TEST_CLASS_NAME(testSuite, testCaseName)::run()
    81 
    82 #define _TEST_ASSERT_HELPER(expression, returnStatement) do { if (!(expression)) { TestsController::shared().testFailed(__FILE__, __LINE__, #expression); returnStatement; } } while (0)
    83 #define TEST_ASSERT(expression) _TEST_ASSERT_HELPER(expression, return)
    84 #define TEST_ASSERT_RETURN(expression, returnValue) _TEST_ASSERT_HELPER(expression, return (returnValue))
     42    } while (0)
    8543
    8644} // namespace TestWebKitAPI
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r85461 r86108  
    5858                C0BD669D131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0BD669C131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp */; };
    5959                C0BD669F131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */; };
     60                F3FC3EE313678B7300126A65 /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3FC3EE213678B7300126A65 /* libgtest.a */; };
    6061                F6F3F29113342FEB00A6BF19 /* CookieManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6F3F29013342FEB00A6BF19 /* CookieManager.cpp */; };
    6162/* End PBXBuildFile section */
     
    161162                C0BD669C131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResponsivenessTimerDoesntFireEarly.cpp; sourceTree = "<group>"; };
    162163                C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResponsivenessTimerDoesntFireEarly_Bundle.cpp; sourceTree = "<group>"; };
     164                F3FC3EE213678B7300126A65 /* libgtest.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgtest.a; path = ../../WebKitBuild/Debug/libgtest.a; sourceTree = SOURCE_ROOT; };
    163165                F6F3F29013342FEB00A6BF19 /* CookieManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CookieManager.cpp; sourceTree = "<group>"; };
    164166/* End PBXFileReference section */
     
    173175                                BC90964E1255620C00083756 /* JavaScriptCore.framework in Frameworks */,
    174176                                C02B7854126613AE0026BF0F /* Carbon.framework in Frameworks */,
     177                                F3FC3EE313678B7300126A65 /* libgtest.a in Frameworks */,
    175178                        );
    176179                        runOnlyForDeploymentPostprocessing = 0;
     
    223226                        isa = PBXGroup;
    224227                        children = (
     228                                F3FC3EE213678B7300126A65 /* libgtest.a */,
    225229                                BCB9E9F011235BDE00A137E0 /* Cocoa.framework */,
    226230                                BC90964D1255620C00083756 /* JavaScriptCore.framework */,
     
    480484                        buildSettings = {
    481485                                FRAMEWORK_SEARCH_PATHS = "$(inherited)";
     486                                HEADER_SEARCH_PATHS = (
     487                                        ../../Source/ThirdParty/gtest/include,
     488                                        "$(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders",
     489                                );
     490                                LIBRARY_SEARCH_PATHS = (
     491                                        "$(inherited)",
     492                                        "\"$(SRCROOT)/../../WebKitBuild/Debug\"",
     493                                );
    482494                        };
    483495                        name = Debug;
     
    488500                        buildSettings = {
    489501                                FRAMEWORK_SEARCH_PATHS = "$(inherited)";
     502                                HEADER_SEARCH_PATHS = (
     503                                        ../../Source/ThirdParty/gtest/include,
     504                                        "$(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders",
     505                                );
     506                                LIBRARY_SEARCH_PATHS = (
     507                                        "$(inherited)",
     508                                        "\"$(SRCROOT)/../../WebKitBuild/Release\"",
     509                                );
    490510                        };
    491511                        name = Release;
  • trunk/Tools/TestWebKitAPI/Tests/WTF/VectorBasic.cpp

    r69343 r86108  
    3333{
    3434    Vector<int> intVector;
    35     TEST_ASSERT(intVector.isEmpty());
    36     TEST_ASSERT(intVector.size() == 0);
    37     TEST_ASSERT(intVector.capacity() == 0);
     35    ASSERT_TRUE(intVector.isEmpty());
     36    ASSERT_EQ(0ul, intVector.size());
     37    ASSERT_EQ(0ul, intVector.capacity());
    3838}
    3939
  • trunk/Tools/TestWebKitAPI/TestsController.cpp

    r69317 r86108  
    2727
    2828#include "Test.h"
    29 #include <algorithm>
    3029#include <assert.h>
     30#include <gtest/gtest.h>
     31#include <cstdio>
    3132
    3233namespace TestWebKitAPI {
     
    3940
    4041TestsController::TestsController()
    41     : m_testFailed(false)
    42     , m_currentTest(0)
    4342{
     43    int argc = 0;
     44    ::testing::InitGoogleTest(&argc, (char**)0);
    4445}
    4546
    4647void TestsController::dumpTestNames()
    4748{
    48     std::map<std::string, CreateTestFunction>::const_iterator it = m_createTestFunctions.begin();
    49     std::map<std::string, CreateTestFunction>::const_iterator end = m_createTestFunctions.end();
    50     for (; it != end; ++it)
    51         printf("%s\n", (*it).first.c_str());
     49    ::testing::UnitTest* unit_test = ::testing::UnitTest::GetInstance();
     50
     51    for (int i = 0; i < unit_test->total_test_case_count(); i++) {
     52        const ::testing::TestCase* test_case = unit_test->GetTestCase(i);
     53        for (int j = 0; j < test_case->total_test_count(); j++) {
     54          const ::testing::TestInfo* test_info = test_case->GetTestInfo(j);
     55          printf("%s.%s\n", test_case->name(), test_info->name());
     56        }
     57    }
    5258}
    5359
    5460bool TestsController::runTestNamed(const std::string& identifier)
    5561{
    56     CreateTestFunction createTestFunction = m_createTestFunctions[identifier];
    57     if (!createTestFunction) {
    58         printf("ERROR: Test not found - %s\n", identifier.c_str());
    59         return false;
    60     }
    61 
    62     m_currentTest = createTestFunction(identifier);
    63     m_currentTest->run();
    64 
    65     delete m_currentTest;
    66     m_currentTest = 0;
    67 
    68     return !m_testFailed;
     62    ::testing::GTEST_FLAG(filter) = identifier;
     63    return !RUN_ALL_TESTS();
    6964}
    7065
    71 void TestsController::testFailed(const char* file, int line, const char* message)
     66bool TestsController::runAllTests()
    7267{
    73     m_testFailed = true;
    74     printf("FAIL: %s\n\t%s (%s:%d)\n", m_currentTest->name().c_str(), message, file, line);
    75 }
    76 
    77 void TestsController::registerCreateTestFunction(const std::string& identifier, CreateTestFunction createTestFunction)
    78 {
    79     m_createTestFunctions[identifier] = createTestFunction;
     68    return !RUN_ALL_TESTS();
    8069}
    8170
  • trunk/Tools/TestWebKitAPI/TestsController.h

    r69317 r86108  
    4040    void dumpTestNames();
    4141    bool runTestNamed(const std::string&);
    42 
    43     // Called by the tests themselves.
    44     void testFailed(const char* file, int line, const char* message);
    45 
    46     typedef Test* (*CreateTestFunction)(const std::string&);
    47     void registerCreateTestFunction(const std::string&, CreateTestFunction);
     42    bool runAllTests();
    4843
    4944private:
    5045    TestsController();
    5146    ~TestsController();
    52 
    53     bool m_testFailed;
    54     Test* m_currentTest;
    55 
    56     std::map<std::string, CreateTestFunction> m_createTestFunctions;
    5747};
    5848
  • trunk/Tools/TestWebKitAPI/mac/main.mm

    r69317 r86108  
    3434    bool passed = true;
    3535
    36     std::string argument(argv[1]);
    37     if (argument == "--dump-tests")
    38         TestWebKitAPI::TestsController::shared().dumpTestNames();
    39     else   
    40         passed = TestWebKitAPI::TestsController::shared().runTestNamed(argument);
     36    if (argc == 1)
     37        passed = TestWebKitAPI::TestsController::shared().runAllTests();
     38    else {
     39        std::string argument(argv[1]);
     40        if (argument == "--dump-tests")
     41            TestWebKitAPI::TestsController::shared().dumpTestNames();
     42        else
     43            passed = TestWebKitAPI::TestsController::shared().runTestNamed(argument);
     44    }
    4145
    4246    [pool drain];
Note: See TracChangeset for help on using the changeset viewer.