proxygen
gtest_throw_on_failure_test Namespace Reference

Classes

class  ThrowOnFailureTest
 

Functions

def SetEnvVar (env_var, value)
 
def Run (command)
 

Variables

string __author__ = 'wan@google.com (Zhanyong Wan)'
 
string THROW_ON_FAILURE = 'gtest_throw_on_failure'
 
 EXE_PATH
 

Function Documentation

def gtest_throw_on_failure_test.Run (   command)
Runs a command; returns True/False if its exit code is/isn't 0.

Definition at line 70 of file gtest_throw_on_failure_test.py.

References join.

Referenced by gtest_throw_on_failure_test.ThrowOnFailureTest.RunAndVerify().

70 def Run(command):
71  """Runs a command; returns True/False if its exit code is/isn't 0."""
72 
73  print('Running "%s". . .' % ' '.join(command))
74  p = gtest_test_utils.Subprocess(command)
75  return p.exited and p.exit_code == 0
76 
77 
78 # The tests. TODO(wan@google.com): refactor the class to share common
79 # logic with code in gtest_break_on_failure_unittest.py.
#define join
def gtest_throw_on_failure_test.SetEnvVar (   env_var,
  value 
)
Sets an environment variable to a given value; unsets it when the
given value is None.

Definition at line 58 of file gtest_throw_on_failure_test.py.

Referenced by gtest_throw_on_failure_test.ThrowOnFailureTest.RunAndVerify().

58 def SetEnvVar(env_var, value):
59  """Sets an environment variable to a given value; unsets it when the
60  given value is None.
61  """
62 
63  env_var = env_var.upper()
64  if value is not None:
65  os.environ[env_var] = value
66  elif env_var in os.environ:
67  del os.environ[env_var]
68 
69 

Variable Documentation

string gtest_throw_on_failure_test.__author__ = 'wan@google.com (Zhanyong Wan)'
private

Definition at line 38 of file gtest_throw_on_failure_test.py.

gtest_throw_on_failure_test.EXE_PATH
Initial value:
2  'gtest_throw_on_failure_test_')
def GetTestExecutablePath(executable_name, build_dir=None)

Definition at line 51 of file gtest_throw_on_failure_test.py.

string gtest_throw_on_failure_test.THROW_ON_FAILURE = 'gtest_throw_on_failure'

Definition at line 47 of file gtest_throw_on_failure_test.py.