Changeset 160627 in webkit
- Timestamp:
- Dec 15, 2013 8:58:10 PM (10 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r160620 r160627 1 2013-12-15 Tamas Gergely <tgergely.u-szeged@partner.samsung.com> 2 3 Refactor option handling in WebKitTestRunner. 4 https://bugs.webkit.org/show_bug.cgi?id=123185 5 6 Reviewed by Darin Adler. 7 8 Option handling is refactored (according to the FIXME) that allows 9 to automatically generate the help message. 10 11 * WebKitTestRunner/CMakeLists.txt: 12 * WebKitTestRunner/GNUmakefile.am: 13 * WebKitTestRunner/Options.cpp: Added. 14 (WTR::Options::Options): 15 (WTR::handleOptionTimeout): 16 (WTR::handleOptionNoTimeout): 17 (WTR::handleOptionNoTimeoutAtAll): 18 (WTR::handleOptionVerbose): 19 (WTR::handleOptionGcBetweenTests): 20 (WTR::handleOptionPixelTests): 21 (WTR::handleOptionPrintSupportedFeatures): 22 (WTR::handleOptionComplexText): 23 (WTR::handleOptionAcceleratedDrawing): 24 (WTR::handleOptionRemoteLayerTree): 25 (WTR::handleOptionUnmatched): 26 (WTR::OptionsHandler::OptionsHandler): 27 (WTR::Option::Option): 28 (WTR::Option::matches): 29 (WTR::OptionsHandler::parse): 30 (WTR::OptionsHandler::printHelp): 31 * WebKitTestRunner/Options.h: Added. 32 * WebKitTestRunner/TestController.cpp: 33 (WTR::TestController::initialize): 34 * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: 35 1 36 2013-12-15 Dan Bernstein <mitz@apple.com> 2 37 -
trunk/Tools/WebKitTestRunner/CMakeLists.txt
r160404 r160627 7 7 ${WEBKIT_TESTRUNNER_DIR}/CyclicRedundancyCheck.cpp 8 8 ${WEBKIT_TESTRUNNER_DIR}/GeolocationProviderMock.cpp 9 ${WEBKIT_TESTRUNNER_DIR}/Options.cpp 9 10 ${WEBKIT_TESTRUNNER_DIR}/PixelDumpSupport.cpp 10 11 ${WEBKIT_TESTRUNNER_DIR}/TestController.cpp -
trunk/Tools/WebKitTestRunner/GNUmakefile.am
r156164 r160627 22 22 Tools/WebKitTestRunner/GeolocationProviderMock.cpp \ 23 23 Tools/WebKitTestRunner/GeolocationProviderMock.h \ 24 Tools/WebKitTestRunner/Options.cpp \ 25 Tools/WebKitTestRunner/Options.h \ 24 26 Tools/WebKitTestRunner/PixelDumpSupport.cpp \ 25 27 Tools/WebKitTestRunner/PixelDumpSupport.h \ -
trunk/Tools/WebKitTestRunner/TestController.cpp
r160459 r160627 28 28 29 29 #include "EventSenderProxy.h" 30 #include "Options.h" 30 31 #include "PlatformWebView.h" 31 32 #include "StringFunctions.h" … … 267 268 platformInitialize(); 268 269 270 Options options(defaultLongTimeout, defaultShortTimeout); 271 OptionsHandler optionsHandler(options); 272 269 273 if (argc < 2) { 270 fputs("Usage: WebKitTestRunner [options] filename [filename2..n]\n", stderr); 271 // FIXME: Refactor option parsing to allow us to print 272 // an auto-generated list of options. 274 optionsHandler.printHelp(); 273 275 exit(1); 274 276 } 275 276 bool printSupportedFeatures = false; 277 278 for (int i = 1; i < argc; ++i) { 279 std::string argument(argv[i]); 280 281 if (argument == "--timeout" && i + 1 < argc) { 282 m_longTimeout = atoi(argv[++i]); 283 // Scale up the short timeout to match. 284 m_shortTimeout = defaultShortTimeout * m_longTimeout / defaultLongTimeout; 285 continue; 286 } 287 288 if (argument == "--no-timeout") { 289 m_useWaitToDumpWatchdogTimer = false; 290 continue; 291 } 292 293 if (argument == "--no-timeout-at-all") { 294 m_useWaitToDumpWatchdogTimer = false; 295 m_forceNoTimeout = true; 296 continue; 297 } 298 299 if (argument == "--verbose") { 300 m_verbose = true; 301 continue; 302 } 303 if (argument == "--gc-between-tests") { 304 m_gcBetweenTests = true; 305 continue; 306 } 307 if (argument == "--pixel-tests" || argument == "-p") { 308 m_shouldDumpPixelsForAllTests = true; 309 continue; 310 } 311 if (argument == "--print-supported-features") { 312 printSupportedFeatures = true; 313 break; 314 } 315 if (argument == "--complex-text") { 316 m_forceComplexText = true; 317 continue; 318 } 319 if (argument == "--accelerated-drawing") { 320 m_shouldUseAcceleratedDrawing = true; 321 continue; 322 } 323 if (argument == "--remote-layer-tree") { 324 m_shouldUseRemoteLayerTree = true; 325 continue; 326 } 327 328 329 // Skip any other arguments that begin with '--'. 330 if (argument.length() >= 2 && argument[0] == '-' && argument[1] == '-') 331 continue; 332 333 m_paths.push_back(argument); 334 } 335 336 if (printSupportedFeatures) { 277 if (!optionsHandler.parse(argc, argv)) 278 exit(1); 279 280 m_longTimeout = options.longTimeout; 281 m_shortTimeout = options.shortTimeout; 282 m_useWaitToDumpWatchdogTimer = options.useWaitToDumpWatchdogTimer; 283 m_forceNoTimeout = options.forceNoTimeout; 284 m_verbose = options.verbose; 285 m_gcBetweenTests = options.gcBetweenTests; 286 m_shouldDumpPixelsForAllTests = options.shouldDumpPixelsForAllTests; 287 m_forceComplexText = options.forceComplexText; 288 m_shouldUseAcceleratedDrawing = options.shouldUseAcceleratedDrawing; 289 m_shouldUseRemoteLayerTree = options.shouldUseRemoteLayerTree; 290 m_paths = options.paths; 291 292 if (options.printSupportedFeatures) { 337 293 // FIXME: On Windows, DumpRenderTree uses this to expose whether it supports 3d 338 294 // transforms and accelerated compositing. When we support those features, we -
trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
r159485 r160627 60 60 8034C6621487636400AC32E9 /* AccessibilityControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8034C6611487636400AC32E9 /* AccessibilityControllerMac.mm */; }; 61 61 8097338A14874A5A008156D9 /* AccessibilityNotificationHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8097338914874A5A008156D9 /* AccessibilityNotificationHandler.mm */; }; 62 841CC00F181185BF0042E9B6 /* Options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841CC00D181185BF0042E9B6 /* Options.cpp */; }; 62 63 8CCDA823151A570B0003F937 /* SampleFont.sfont in Resources */ = {isa = PBXBuildFile; fileRef = 8CCDA822151A570B0003F937 /* SampleFont.sfont */; }; 63 64 A664BC7613A5F3A9009A7B25 /* libWebCoreTestSupport.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 41230E16138C78BF00BCCFCA /* libWebCoreTestSupport.dylib */; }; … … 175 176 8097338814874A5A008156D9 /* AccessibilityNotificationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AccessibilityNotificationHandler.h; path = mac/AccessibilityNotificationHandler.h; sourceTree = "<group>"; }; 176 177 8097338914874A5A008156D9 /* AccessibilityNotificationHandler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityNotificationHandler.mm; path = mac/AccessibilityNotificationHandler.mm; sourceTree = "<group>"; }; 178 841CC00D181185BF0042E9B6 /* Options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Options.cpp; sourceTree = "<group>"; }; 179 841CC00E181185BF0042E9B6 /* Options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Options.h; sourceTree = "<group>"; }; 177 180 8CCDA822151A570B0003F937 /* SampleFont.sfont */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = SampleFont.sfont; path = fonts/SampleFont.sfont; sourceTree = "<group>"; }; 178 181 8DD76FA10486AA7600D96B5E /* WebKitTestRunner */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = WebKitTestRunner; sourceTree = BUILT_PRODUCTS_DIR; }; … … 281 284 isa = PBXGroup; 282 285 children = ( 286 841CC00D181185BF0042E9B6 /* Options.cpp */, 287 841CC00E181185BF0042E9B6 /* Options.h */, 283 288 BC9192021333E4CD003011DC /* cg */, 284 289 BC7933FE118F7C74005EA8E2 /* mac */, … … 638 643 3164C8F015D1ADA100EF1FE0 /* WebNotificationProvider.cpp in Sources */, 639 644 4429FC5F1627089600F66D8B /* WorkQueueManager.cpp in Sources */, 645 841CC00F181185BF0042E9B6 /* Options.cpp in Sources */, 640 646 ); 641 647 runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset
for help on using the changeset viewer.