Changeset 169042 in webkit
- Timestamp:
- May 19, 2014 2:17:53 AM (10 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r169017 r169042 1 2014-05-19 David Kilzer <ddkilzer@apple.com> 2 3 webkitdirs.pm: Add setupMacWebKitEnvironment() to set __XPC_DYLD_FRAMEWORK_PATH consistently 4 <http://webkit.org/b/132954> 5 6 Reviewed by Darin Adler. 7 8 Extract code into setupMacWebKitEnvironment() for setting up 9 common environment variables so it may be shared. Sets 10 __XPC_DYLD_FRAMEWORK_PATH consistently and adds support for 11 using guardmalloc to some scripts. 12 13 Also adds support for parsing shared (common) command-line 14 switches, initially just -g|--guard-malloc. 15 16 * Scripts/bisect-builds: Add -g|--guard-malloc support by using 17 sharedCommandLineOptions() and sharedCommandLineOptionsUsage(). 18 (mountAndRunNightly): Call setupMacWebKitEnvironment(). Use a 19 local copy of %ENV when launching Safari so we don't have to 20 restore variables. 21 22 * Scripts/run-api-tests: Add -g|--guard-malloc support by using 23 sharedCommandLineOptions() and sharedCommandLineOptionsUsage(). 24 Check result of GetOptions() to catch invalid command-line 25 switches. 26 (runTest): Use a local copy of %ENV when running tests so we 27 don't have to restore variables. 28 (prepareEnvironmentForRunningTestTool): Call 29 setupMacWebKitEnvironment(). 30 31 * Scripts/run-pageloadtest: Add -g|--guard-malloc support by 32 using sharedCommandLineOptions() and 33 sharedCommandLineOptionsUsage(). Call 34 setupMacWebKitEnvironment(). 35 36 * Scripts/webkitdirs.pm: 37 (sharedCommandLineOptions): Return array of common switches to 38 pass to Getopt::Long::GetOptions(). 39 (sharedCommandLineOptionsUsage): Return formatted string of 40 common switches for printing usage help text. 41 (setUpGuardMallocIfNeeded): Support using '-g' for enabling 42 guardmalloc. 43 (printHelpAndExitForRunAndDebugWebKitAppIfNeeded): Ditto. 44 (setupMacWebKitEnvironment): Extracted from runMacWebKitApp() 45 and changed not to clobber DYLD_FRAMEWORK_PATH if already set. 46 (runMacWebKitApp): Call setupMacWebKitEnvironment(). Use a 47 local copy of %ENV when launching Safari so we don't have to 48 restore variables. 49 (execMacWebKitAppForDebugging): Call 50 setupMacWebKitEnvironment(). 51 1 52 2014-05-18 Rik Cabanier <cabanier@adobe.com> 2 53 -
trunk/Tools/Scripts/bisect-builds
r166419 r169042 1 1 #!/usr/bin/perl -w 2 2 3 # Copyright (C) 2007 , 2008, 2009, 2011, 2012, 2013Apple Inc. All rights reserved.3 # Copyright (C) 2007-2009, 2011-2014 Apple Inc. All rights reserved. 4 4 # 5 5 # Redistribution and use in source and binary forms, with or without … … 85 85 86 86 my $result = GetOptions( 87 sharedCommandLineOptions(), 87 88 "b|branch=s" => \$branch, 88 89 "d|download-directory=s" => \$nightlyDownloadDirectory, … … 115 116 [-s|--sanity-check] verify both starting and ending revisions before bisecting 116 117 END 118 print STDERR sharedCommandLineOptionsUsage(brackets => 1, indent => 2, switchWidth => 30); 117 119 exit 1; 118 120 } … … 406 408 407 409 $tempFile ||= ""; 408 `DYLD_FRAMEWORK_PATH=$frameworkPath WEBKIT_UNSET_DYLD_FRAMEWORK_PATH=YES $safari $tempFile`; 410 411 { 412 local %ENV = %ENV; 413 setupMacWebKitEnvironment($frameworkPath); 414 415 `$safari $tempFile`; 416 } 409 417 410 418 `hdiutil detach '$mountPath' 2> $devNull`; -
trunk/Tools/Scripts/run-api-tests
r168910 r169042 1 1 #!/usr/bin/perl -w 2 2 3 # Copyright (C) 2010 , 2011, 2012Apple Inc. All rights reserved.3 # Copyright (C) 2010-2012, 2014 Apple Inc. All rights reserved. 4 4 # 5 5 # Redistribution and use in source and binary forms, with or without … … 66 66 --[no-]build Build (or do not build) unit tests prior to running (default: $buildDefault) 67 67 --root= Path to the pre-built root containing TestWebKitAPI 68 68 @{[ sharedCommandLineOptionsUsage(indent => 2, switchWidth => 21) ]} 69 69 Examples 70 70 … … 77 77 EOF 78 78 79 GetOptions( 79 my $getOptionsResult = GetOptions( 80 sharedCommandLineOptions(), 80 81 'help' => \$showHelp, 81 82 'verbose|v' => \$verbose, … … 85 86 ); 86 87 87 if ( $showHelp) {88 if (!$getOptionsResult || $showHelp) { 88 89 print STDERR $usage; 89 90 exit 1; … … 175 176 die "run-api-tests is not supported on this platform.\n" unless isSupportedPlatform(); 176 177 178 local %ENV = %ENV; 177 179 prepareEnvironmentForRunningTestTool(); 178 180 … … 336 338 return unless isAppleMacWebKit(); 337 339 338 $ENV{DYLD_FRAMEWORK_PATH} = productDir(); 339 $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; 340 setupMacWebKitEnvironment(productDir()); 340 341 } 341 342 -
trunk/Tools/Scripts/run-pageloadtest
r165676 r169042 2 2 3 3 # Copyright (C) 2006 Eric Seidel (eric@webkit.org) 4 # Copyright (C) 2014 Apple Inc. All rights reserved. 4 5 # 5 6 # Redistribution and use in source and binary forms, with or without … … 48 49 my $usage = 49 50 "Usage: " . basename($0) . "[options] testName\n" . 50 " --help Show this help message\n"; 51 " --help Show this help message\n" . 52 sharedCommandLineOptionsUsage(indent => 2, switchWidth => 23); 51 53 52 my $getOptionsResult = GetOptions('help' => \$showHelp); 54 my $getOptionsResult = GetOptions( 55 sharedCommandLineOptions(), 56 'help' => \$showHelp 57 ); 53 58 54 59 if (!$getOptionsResult || $showHelp) { … … 82 87 # Set up DYLD_FRAMEWORK_PATH to point to the product directory. 83 88 print "Starting Safari with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n"; 84 $ENV{DYLD_FRAMEWORK_PATH} = $productDir; 85 $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; 89 setupMacWebKitEnvironment($productDir); 86 90 87 91 my @testCommands = ('activate'); -
trunk/Tools/Scripts/webkitdirs.pm
r168910 r169042 1 # Copyright (C) 2005 , 2006, 2007, 2010, 2011, 2012, 2013Apple Inc. All rights reserved.1 # Copyright (C) 2005-2007, 2010-2014 Apple Inc. All rights reserved. 2 2 # Copyright (C) 2009 Google Inc. All rights reserved. 3 3 # Copyright (C) 2011 Research In Motion Limited. All rights reserved. … … 40 40 use File::Spec; 41 41 use File::stat; 42 use List::Util; 42 43 use POSIX; 43 44 use VCSUtils; … … 66 67 &safariPath 67 68 &setConfiguration 69 &setupMacWebKitEnvironment 70 &sharedCommandLineOptions 71 &sharedCommandLineOptionsUsage 68 72 USE_OPEN_COMMAND 69 73 ); … … 1288 1292 } 1289 1293 1294 sub sharedCommandLineOptions() 1295 { 1296 return ( 1297 "g|guard-malloc" => \$shouldUseGuardMalloc, 1298 ); 1299 } 1300 1301 sub sharedCommandLineOptionsUsage(+@) 1302 { 1303 my %opts = @_; 1304 1305 my %switches = ( 1306 '-g|--guard-malloc' => 'Use guardmalloc when running executable', 1307 ); 1308 1309 my $indent = " " x ($opts{indent} || 2); 1310 my $switchWidth = List::Util::max(int($opts{switchWidth}), List::Util::max(map { length($_) } keys %switches) + ($opts{brackets} ? 2 : 0)); 1311 1312 my $result = "Common switches:\n"; 1313 1314 for my $switch (keys %switches) { 1315 my $switchName = $opts{brackets} ? "[" . $switch . "]" : $switch; 1316 $result .= sprintf("%s%-" . $switchWidth . "s %s\n", $indent, $switchName, $switches{$switch}); 1317 } 1318 1319 return $result; 1320 } 1321 1290 1322 sub setUpGuardMallocIfNeeded 1291 1323 { … … 1295 1327 1296 1328 if (!defined($shouldUseGuardMalloc)) { 1297 $shouldUseGuardMalloc = checkForArgumentAndRemoveFromARGV("- -guard-malloc");1329 $shouldUseGuardMalloc = checkForArgumentAndRemoveFromARGV("-g") || checkForArgumentAndRemoveFromARGV("--guard-malloc"); 1298 1330 } 1299 1331 … … 1990 2022 --help Show this help message 1991 2023 --no-saved-state Launch the application without state restoration (OS X 10.7 and later) 1992 - -guard-mallocEnable Guard Malloc (OS X only)2024 -g|--guard-malloc Enable Guard Malloc (OS X only) 1993 2025 --use-web-process-xpc-service Launch the Web Process as an XPC Service (OS X only) 1994 2026 EOF … … 2019 2051 } 2020 2052 2053 sub setupMacWebKitEnvironment($) 2054 { 2055 my ($dyldFrameworkPath) = @_; 2056 2057 $dyldFrameworkPath = File::Spec->rel2abs($dyldFrameworkPath); 2058 2059 $ENV{DYLD_FRAMEWORK_PATH} = $ENV{DYLD_FRAMEWORK_PATH} ? join(":", $dyldFrameworkPath, $ENV{DYLD_FRAMEWORK_PATH}) : $dyldFrameworkPath; 2060 $ENV{__XPC_DYLD_FRAMEWORK_PATH} = $dyldFrameworkPath; 2061 $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; 2062 2063 setUpGuardMallocIfNeeded(); 2064 } 2065 2021 2066 sub runMacWebKitApp($;$) 2022 2067 { … … 2024 2069 my $productDir = productDir(); 2025 2070 print "Starting @{[basename($appPath)]} with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n"; 2026 $ENV{DYLD_FRAMEWORK_PATH} = $productDir; 2027 $ENV{__XPC_DYLD_FRAMEWORK_PATH} = File::Spec->rel2abs($productDir); 2028 $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; 2029 2030 setUpGuardMallocIfNeeded(); 2071 2072 local %ENV = %ENV; 2073 setupMacWebKitEnvironment($productDir); 2031 2074 2032 2075 if (defined($useOpenCommand) && $useOpenCommand == USE_OPEN_COMMAND) { … … 2060 2103 2061 2104 my $productDir = productDir(); 2062 $ENV{DYLD_FRAMEWORK_PATH} = $productDir; 2063 $ENV{__XPC_DYLD_FRAMEWORK_PATH} = File::Spec->rel2abs($productDir); 2064 $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; 2065 2066 setUpGuardMallocIfNeeded(); 2105 setupMacWebKitEnvironment($productDir); 2067 2106 2068 2107 my @architectureFlags = ($architectureSwitch, architecture());
Note: See TracChangeset
for help on using the changeset viewer.