diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-03-11 22:18:52 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-03-11 22:18:52 +0000 |
commit | baa766af2a71363fb1ccf8de5de444c4a88f0e61 (patch) | |
tree | 371303a68075a9188a758ad359689fc579ff8388 /test/gtest_test_utils.py | |
parent | 1fe95e6208c27cc989952fef40fb2074234d6529 (diff) | |
download | googletest-baa766af2a71363fb1ccf8de5de444c4a88f0e61.tar.gz |
Implements the --help flag; fixes tests on Windows.
git-svn-id: http://googletest.googlecode.com/svn/trunk@204 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'test/gtest_test_utils.py')
-rwxr-xr-x | test/gtest_test_utils.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/test/gtest_test_utils.py b/test/gtest_test_utils.py index 8ee99c0..8f55b07 100755 --- a/test/gtest_test_utils.py +++ b/test/gtest_test_utils.py @@ -124,7 +124,7 @@ def GetExitStatus(exit_code): class Subprocess: - def __init__(this, command, working_dir=None): + def __init__(self, command, working_dir=None): """Changes into a specified directory, if provided, and executes a command. Restores the old directory afterwards. Execution results are returned via the following attributes: @@ -137,7 +137,7 @@ class Subprocess: combined in a string. Args: - command: A command to run. + command: A command to run, in the form of sys.argv. working_dir: A directory to change into. """ @@ -154,8 +154,8 @@ class Subprocess: cwd=working_dir, universal_newlines=True) # communicate returns a tuple with the file obect for the child's # output. - this.output = p.communicate()[0] - this._return_code = p.returncode + self.output = p.communicate()[0] + self._return_code = p.returncode else: old_dir = os.getcwd() try: @@ -163,25 +163,25 @@ class Subprocess: os.chdir(working_dir) p = popen2.Popen4(command) p.tochild.close() - this.output = p.fromchild.read() + self.output = p.fromchild.read() ret_code = p.wait() finally: os.chdir(old_dir) # Converts ret_code to match the semantics of # subprocess.Popen.returncode. if os.WIFSIGNALED(ret_code): - this._return_code = -os.WTERMSIG(ret_code) + self._return_code = -os.WTERMSIG(ret_code) else: # os.WIFEXITED(ret_code) should return True here. - this._return_code = os.WEXITSTATUS(ret_code) + self._return_code = os.WEXITSTATUS(ret_code) - if this._return_code < 0: - this.terminated_by_signal = True - this.exited = False - this.signal = -this._return_code + if self._return_code < 0: + self.terminated_by_signal = True + self.exited = False + self.signal = -self._return_code else: - this.terminated_by_signal = False - this.exited = True - this.exit_code = this._return_code + self.terminated_by_signal = False + self.exited = True + self.exit_code = self._return_code def Main(): |