webkitdirs.pm: Add setupMacWebKitEnvironment() to set __XPC_DYLD_FRAMEWORK_PATH consi...
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 May 2014 09:17:53 +0000 (09:17 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 May 2014 09:17:53 +0000 (09:17 +0000)
commit4e9a27a0f9c75ae8dc1176a69d889c6d2510adce
treec3e9566144e2e43e9b15a68e5c6fa777ac149473
parent6aee306fdf3630badd1bbd73908adab9623c1b6c
webkitdirs.pm: Add setupMacWebKitEnvironment() to set __XPC_DYLD_FRAMEWORK_PATH consistently
<http://webkit.org/b/132954>

Reviewed by Darin Adler.

Extract code into setupMacWebKitEnvironment() for setting up
common environment variables so it may be shared.  Sets
__XPC_DYLD_FRAMEWORK_PATH consistently and adds support for
using guardmalloc to some scripts.

Also adds support for parsing shared (common) command-line
switches, initially just -g|--guard-malloc.

* Scripts/bisect-builds: Add -g|--guard-malloc support by using
sharedCommandLineOptions() and sharedCommandLineOptionsUsage().
(mountAndRunNightly): Call setupMacWebKitEnvironment().  Use a
local copy of %ENV when launching Safari so we don't have to
restore variables.

* Scripts/run-api-tests: Add -g|--guard-malloc support by using
sharedCommandLineOptions() and sharedCommandLineOptionsUsage().
Check result of GetOptions() to catch invalid command-line
switches.
(runTest): Use a local copy of %ENV when running tests so we
don't have to restore variables.
(prepareEnvironmentForRunningTestTool): Call
setupMacWebKitEnvironment().

* Scripts/run-pageloadtest: Add -g|--guard-malloc support by
using sharedCommandLineOptions() and
sharedCommandLineOptionsUsage().  Call
setupMacWebKitEnvironment().

* Scripts/webkitdirs.pm:
(sharedCommandLineOptions): Return array of common switches to
pass to Getopt::Long::GetOptions().
(sharedCommandLineOptionsUsage): Return formatted string of
common switches for printing usage help text.
(setUpGuardMallocIfNeeded): Support using '-g' for enabling
guardmalloc.
(printHelpAndExitForRunAndDebugWebKitAppIfNeeded): Ditto.
(setupMacWebKitEnvironment): Extracted from runMacWebKitApp()
and changed not to clobber DYLD_FRAMEWORK_PATH if already set.
(runMacWebKitApp): Call setupMacWebKitEnvironment().  Use a
local copy of %ENV when launching Safari so we don't have to
restore variables.
(execMacWebKitAppForDebugging): Call
setupMacWebKitEnvironment().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169042 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/Scripts/bisect-builds
Tools/Scripts/run-api-tests
Tools/Scripts/run-pageloadtest
Tools/Scripts/webkitdirs.pm