| Index: build_tools/install_gtest/install_gtest.py
|
| ===================================================================
|
| --- build_tools/install_gtest/install_gtest.py (revision 760)
|
| +++ build_tools/install_gtest/install_gtest.py (working copy)
|
| @@ -73,14 +73,22 @@
|
| def PatchAll(options):
|
| def Patch(abs_path, patch_file):
|
| print "Patching %s with: %s" % (abs_path, patch_file)
|
| - p = subprocess.Popen('chmod -R a+w . && patch -p0 < %s' % (patch_file),
|
| + command = ''
|
| + if (sys.platform == 'win32'):
|
| + command = 'patch -p0 < %s' % (patch_file)
|
| + else:
|
| + command = 'chmod -R a+w . && patch -p0 < %s' % (patch_file)
|
| + p = subprocess.Popen(command,
|
| cwd=abs_path,
|
| env=options.shell_env,
|
| shell=True)
|
| assert p.wait() == 0
|
|
|
| - Patch(options.working_dir, os.path.join(options.script_dir, GTEST_PATCH_FILE))
|
| - Patch(options.working_dir, os.path.join(options.script_dir, GMOCK_PATCH_FILE))
|
| + patch_path = os.path.join(options.script_dir, GTEST_PATCH_FILE)
|
| + print 'about to patch with working_dir %s, patch: %s' % (options.working_dir,
|
| + patch_path)
|
| + Patch(options.working_dir, patch_path)
|
| + Patch(options.working_dir, patch_path)
|
|
|
|
|
| # Build GTest and GMock, then install them into the toolchain. Note that
|
| @@ -186,15 +194,22 @@
|
| # extracts GTest and GMock, patches and builds them both, then installs them
|
| # into the toolchain specified in |options.toolchain|.
|
| def InstallTestingLibs(options):
|
| + print 'Making working directory.'
|
| MakeWorkingDir(options)
|
| try:
|
| + print 'Downloading and Extracting gtest.'
|
| DownloadAndExtractAll(options)
|
| + print 'Patching gtest.'
|
| PatchAll(options)
|
| except:
|
| + # TODO(mlinck) improve this error
|
| + print 'An Error occurred'
|
| return 1
|
|
|
| + print 'Building and installing gtest.'
|
| BuildAndInstallAll(options)
|
| # Clean up.
|
| + print 'Cleaning up gtest install files.'
|
| shutil.rmtree(options.working_dir, ignore_errors=True)
|
| return 0
|
|
|
|
|