Wizard
Software Engineering Project - Wizard
Loading...
Searching...
No Matches
gtest_test_utils.Subprocess Class Reference

Public Member Functions

 __init__ (self, command, working_dir=None, capture_stderr=True, env=None)
 

Public Attributes

 output = p.communicate()[0]
 
bool terminated_by_signal = True
 
bool exited = False
 
 exit_code = self._return_code
 

Protected Attributes

 _return_code = p.returncode
 

Constructor & Destructor Documentation

◆ __init__()

gtest_test_utils.Subprocess.__init__ ( self,
command,
working_dir = None,
capture_stderr = True,
env = None )
Changes into a specified directory, if provided, and executes a command.

Restores the old directory afterwards.

Args:
  command:        The command to run, in the form of sys.argv.
  working_dir:    The directory to change into.
  capture_stderr: Determines whether to capture stderr in the output member
                  or to discard it.
  env:            Dictionary with environment to pass to the subprocess.

Returns:
  An object that represents outcome of the executed process. It has the
  following attributes:
    terminated_by_signal   True if and only if the child process has been
                           terminated by a signal.
    exited                 True if and only if the child process exited
                           normally.
    exit_code              The code with which the child process exited.
    output                 Child process's stdout and stderr output
                           combined in a string.

The documentation for this class was generated from the following file: