Changeset 86108 in webkit
- Timestamp:
- May 9, 2011 5:17:50 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r86084 r86108 1 2011-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 1 11 2011-05-09 Xan Lopez <xlopez@igalia.com> 2 12 -
trunk/Source/ThirdParty/gtest/README.WebKit
r83815 r86108 2 2 3 3 http://googletest.googlecode.com/svn/tags/release-1.5.0/ 4 5 2011-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 2 2 <VisualStudioProject 3 3 ProjectType="Visual C++" 4 Version=" 7.10"4 Version="8.00" 5 5 Name="gtest-md" 6 6 ProjectGUID="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}" 7 Keyword="Win32Proj"> 7 RootNamespace="gtest-md" 8 Keyword="Win32Proj" 9 > 8 10 <Platforms> 9 11 <Platform 10 Name="Win32"/> 12 Name="Win32" 13 /> 11 14 </Platforms> 15 <ToolFiles> 16 </ToolFiles> 12 17 <Configurations> 13 18 <Configuration 14 19 Name="Debug|Win32" 15 OutputDirectory="$(SolutionName)/$(ConfigurationName)" 16 IntermediateDirectory="$(OutDir)/$(ProjectName)" 20 OutputDirectory="$(ConfigurationBuildDir)\lib" 17 21 ConfigurationType="4" 22 InheritedPropertySheets="$(ProjectDir)\..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops" 18 23 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 /> 20 40 <Tool 21 41 Name="VCCLCompilerTool" 22 42 Optimization="0" 23 43 PreprocessorDefinitions="WIN32;_DEBUG;_LIB" 24 MinimalRebuild=" TRUE"44 MinimalRebuild="true" 25 45 BasicRuntimeChecks="3" 26 46 RuntimeLibrary="3" 27 47 UsePrecompiledHeader="0" 28 48 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 /> 33 61 <Tool 34 62 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 /> 54 80 </Configuration> 55 81 <Configuration 56 82 Name="Release|Win32" 57 OutputDirectory="$(SolutionName)/$(ConfigurationName)" 58 IntermediateDirectory="$(OutDir)/$(ProjectName)" 83 OutputDirectory="$(ConfigurationBuildDir)\lib" 59 84 ConfigurationType="4" 85 InheritedPropertySheets="$(ProjectDir)\..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops" 60 86 CharacterSet="2" 61 ReferencesPath=""..\include";"..""> 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 /> 62 103 <Tool 63 104 Name="VCCLCompilerTool" … … 66 107 UsePrecompiledHeader="0" 67 108 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 /> 72 121 <Tool 73 122 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 /> 93 140 </Configuration> 94 141 </Configurations> … … 99 146 Name="Source Files" 100 147 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=""..";"..\include""/> 109 </FileConfiguration> 110 <FileConfiguration 111 Name="Release|Win32"> 112 <Tool 113 Name="VCCLCompilerTool" 114 AdditionalIncludeDirectories=""..";"..\include""/> 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=""..";"..\include""/> 124 </FileConfiguration> 125 <FileConfiguration 126 Name="Release|Win32"> 127 <Tool 128 Name="VCCLCompilerTool" 129 AdditionalIncludeDirectories=""..";"..\include""/> 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=""..";"..\include""/> 139 </FileConfiguration> 140 <FileConfiguration 141 Name="Release|Win32"> 142 <Tool 143 Name="VCCLCompilerTool" 144 AdditionalIncludeDirectories=""..";"..\include""/> 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=""..";"..\include""/> 154 </FileConfiguration> 155 <FileConfiguration 156 Name="Release|Win32"> 157 <Tool 158 Name="VCCLCompilerTool" 159 AdditionalIncludeDirectories=""..";"..\include""/> 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=""..";"..\include""/> 169 </FileConfiguration> 170 <FileConfiguration 171 Name="Release|Win32"> 172 <Tool 173 Name="VCCLCompilerTool" 174 AdditionalIncludeDirectories=""..";"..\include""/> 175 </FileConfiguration> 176 </File> 177 <File 178 RelativePath="..\src\gtest.cc"> 179 <FileConfiguration 180 Name="Debug|Win32"> 181 <Tool 182 Name="VCCLCompilerTool" 183 AdditionalIncludeDirectories=""..";"..\include""/> 184 </FileConfiguration> 185 <FileConfiguration 186 Name="Release|Win32"> 187 <Tool 188 Name="VCCLCompilerTool" 189 AdditionalIncludeDirectories=""..";"..\include""/> 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=""..";"..\include"" 159 /> 160 </FileConfiguration> 161 <FileConfiguration 162 Name="Release|Win32" 163 > 164 <Tool 165 Name="VCCLCompilerTool" 166 AdditionalIncludeDirectories=""..";"..\include"" 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=""..";"..\include"" 179 /> 180 </FileConfiguration> 181 <FileConfiguration 182 Name="Release|Win32" 183 > 184 <Tool 185 Name="VCCLCompilerTool" 186 AdditionalIncludeDirectories=""..";"..\include"" 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=""..";"..\include"" 199 /> 200 </FileConfiguration> 201 <FileConfiguration 202 Name="Release|Win32" 203 > 204 <Tool 205 Name="VCCLCompilerTool" 206 AdditionalIncludeDirectories=""..";"..\include"" 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=""..";"..\include"" 219 /> 220 </FileConfiguration> 221 <FileConfiguration 222 Name="Release|Win32" 223 > 224 <Tool 225 Name="VCCLCompilerTool" 226 AdditionalIncludeDirectories=""..";"..\include"" 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=""..";"..\include"" 239 /> 240 </FileConfiguration> 241 <FileConfiguration 242 Name="Release|Win32" 243 > 244 <Tool 245 Name="VCCLCompilerTool" 246 AdditionalIncludeDirectories=""..";"..\include"" 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=""..";"..\include"" 259 /> 260 </FileConfiguration> 261 <FileConfiguration 262 Name="Release|Win32" 263 > 264 <Tool 265 Name="VCCLCompilerTool" 266 AdditionalIncludeDirectories=""..";"..\include"" 267 /> 190 268 </FileConfiguration> 191 269 </File> … … 194 272 Name="Header Files" 195 273 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 > 232 323 </File> 233 324 </Filter> -
trunk/Source/WebKit/win/ChangeLog
r86018 r86108 1 2011-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 1 10 2011-05-07 Sheriff Bot <webkit.review.bot@gmail.com> 2 11 -
trunk/Source/WebKit/win/WebKit.vcproj/WebKit.sln
r82477 r86108 153 153 {3E48AB23-D249-488F-A1C4-43CDF52FBD28} = {3E48AB23-D249-488F-A1C4-43CDF52FBD28} 154 154 EndProjectSection 155 EndProject 156 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-md", "..\..\..\ThirdParty\gtest\msvc\gtest-md.vcproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}" 155 157 EndProject 156 158 Global … … 510 512 {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release|Win32.ActiveCfg = Release|Win32 511 513 {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 512 526 EndGlobalSection 513 527 GlobalSection(SolutionProperties) = preSolution -
trunk/Tools/ChangeLog
r86090 r86108 1 2011-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 1 24 2011-05-09 Igor Oliveira <igor.oliveira@openbossa.org> 2 25 -
trunk/Tools/Scripts/build-api-tests
r74301 r86108 57 57 58 58 # Build 59 chdir "Tools/TestWebKitAPI" or die;60 59 61 60 my $result; 62 61 if (isAppleMacWebKit()) { 62 chdir "Source/ThirdParty/gtest"; 63 buildXCodeProject("xcode/gtest", $clean, XcodeOptions(), @ARGV); 64 chdir "../../../Tools/TestWebKitAPI" or die; 63 65 $result = buildXCodeProject("TestWebKitAPI", $clean, XcodeOptions(), @ARGV); 64 66 } elsif (isAppleWinWebKit()) { 67 chdir "Tools/TestWebKitAPI" or die; 65 68 $result = buildVisualStudioProject("win/TestWebKitAPI.sln", $clean); 66 69 } else { -
trunk/Tools/Scripts/run-api-tests
r80357 r86108 123 123 { 124 124 my ($suite, $testName) = @_; 125 my $test = $suite . " /" . $testName;125 my $test = $suite . "." . $testName; 126 126 127 127 print " Test: $testName -> "; … … 236 236 for my $test (@tests) { 237 237 $test =~ s/[\r\n]*$//; 238 my ($suite, $testName) = split(/\ //, $test);238 my ($suite, $testName) = split(/\./, $test); 239 239 push @{$keyedTests{$suite}}, $testName; 240 240 } -
trunk/Tools/TestWebKitAPI/Configurations/TestWebKitAPICommon.vsprops
r75138 r86108 7 7 <Tool 8 8 Name="VCCLCompilerTool" 9 AdditionalIncludeDirectories=""$(ProjectDir)";"$(ProjectDir)\..";"$(ConfigurationBuildDir)\include";"$(ConfigurationBuildDir)\include\WebCore\ForwardingHeaders";"$(ConfigurationBuildDir)\include\private";"$(WebKitLibrariesDir)\include""9 AdditionalIncludeDirectories=""$(ProjectDir)";"$(ProjectDir)\..";"$(ConfigurationBuildDir)\include";"$(ConfigurationBuildDir)\include\WebCore\ForwardingHeaders";"$(ConfigurationBuildDir)\include\private";"$(WebKitLibrariesDir)\include";"$(ProjectDir)\..\..\..\Source\ThirdParty\gtest\include"" 10 10 ForcedIncludeFiles="TestWebKitAPIPrefix.h" 11 11 /> 12 12 <Tool 13 13 Name="VCLinkerTool" 14 AdditionalDependencies="WebKit$(WebKitDLLConfigSuffix).lib JavaScriptCore$(WebKitDLLConfigSuffix).lib "14 AdditionalDependencies="WebKit$(WebKitDLLConfigSuffix).lib JavaScriptCore$(WebKitDLLConfigSuffix).lib gtest.lib" 15 15 SubSystem="1" 16 16 /> -
trunk/Tools/TestWebKitAPI/Test.h
r77672 r86108 29 29 #include "TestsController.h" 30 30 31 #include <gtest/gtest.h> 32 31 33 namespace TestWebKitAPI { 32 34 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); \ 74 41 } \ 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) 85 43 86 44 } // namespace TestWebKitAPI -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r85461 r86108 58 58 C0BD669D131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0BD669C131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp */; }; 59 59 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 */; }; 60 61 F6F3F29113342FEB00A6BF19 /* CookieManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6F3F29013342FEB00A6BF19 /* CookieManager.cpp */; }; 61 62 /* End PBXBuildFile section */ … … 161 162 C0BD669C131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResponsivenessTimerDoesntFireEarly.cpp; sourceTree = "<group>"; }; 162 163 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; }; 163 165 F6F3F29013342FEB00A6BF19 /* CookieManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CookieManager.cpp; sourceTree = "<group>"; }; 164 166 /* End PBXFileReference section */ … … 173 175 BC90964E1255620C00083756 /* JavaScriptCore.framework in Frameworks */, 174 176 C02B7854126613AE0026BF0F /* Carbon.framework in Frameworks */, 177 F3FC3EE313678B7300126A65 /* libgtest.a in Frameworks */, 175 178 ); 176 179 runOnlyForDeploymentPostprocessing = 0; … … 223 226 isa = PBXGroup; 224 227 children = ( 228 F3FC3EE213678B7300126A65 /* libgtest.a */, 225 229 BCB9E9F011235BDE00A137E0 /* Cocoa.framework */, 226 230 BC90964D1255620C00083756 /* JavaScriptCore.framework */, … … 480 484 buildSettings = { 481 485 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 ); 482 494 }; 483 495 name = Debug; … … 488 500 buildSettings = { 489 501 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 ); 490 510 }; 491 511 name = Release; -
trunk/Tools/TestWebKitAPI/Tests/WTF/VectorBasic.cpp
r69343 r86108 33 33 { 34 34 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()); 38 38 } 39 39 -
trunk/Tools/TestWebKitAPI/TestsController.cpp
r69317 r86108 27 27 28 28 #include "Test.h" 29 #include <algorithm>30 29 #include <assert.h> 30 #include <gtest/gtest.h> 31 #include <cstdio> 31 32 32 33 namespace TestWebKitAPI { … … 39 40 40 41 TestsController::TestsController() 41 : m_testFailed(false)42 , m_currentTest(0)43 42 { 43 int argc = 0; 44 ::testing::InitGoogleTest(&argc, (char**)0); 44 45 } 45 46 46 47 void TestsController::dumpTestNames() 47 48 { 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 } 52 58 } 53 59 54 60 bool TestsController::runTestNamed(const std::string& identifier) 55 61 { 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(); 69 64 } 70 65 71 void TestsController::testFailed(const char* file, int line, const char* message)66 bool TestsController::runAllTests() 72 67 { 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(); 80 69 } 81 70 -
trunk/Tools/TestWebKitAPI/TestsController.h
r69317 r86108 40 40 void dumpTestNames(); 41 41 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(); 48 43 49 44 private: 50 45 TestsController(); 51 46 ~TestsController(); 52 53 bool m_testFailed;54 Test* m_currentTest;55 56 std::map<std::string, CreateTestFunction> m_createTestFunctions;57 47 }; 58 48 -
trunk/Tools/TestWebKitAPI/mac/main.mm
r69317 r86108 34 34 bool passed = true; 35 35 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 } 41 45 42 46 [pool drain];
Note: See TracChangeset
for help on using the changeset viewer.