proxygen
gtest_color_test Namespace Reference

Classes

class  GTestColorTest
 

Functions

def SetEnvVar (env_var, value)
 
def UsesColor (term, color_env_var, color_flag)
 

Variables

string __author__ = 'wan@google.com (Zhanyong Wan)'
 
string IS_WINDOWS = 'nt'
 
string COLOR_ENV_VAR = 'GTEST_COLOR'
 
string COLOR_FLAG = 'gtest_color'
 
 COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_color_test_')
 

Function Documentation

def gtest_color_test.SetEnvVar (   env_var,
  value 
)
Sets the env variable to 'value'; unsets it when 'value' is None.

Definition at line 47 of file gtest_color_test.py.

Referenced by UsesColor().

47 def SetEnvVar(env_var, value):
48  """Sets the env variable to 'value'; unsets it when 'value' is None."""
49 
50  if value is not None:
51  os.environ[env_var] = value
52  elif env_var in os.environ:
53  del os.environ[env_var]
54 
55 
def SetEnvVar(env_var, value)
def gtest_color_test.UsesColor (   term,
  color_env_var,
  color_flag 
)
Runs gtest_color_test_ and returns its exit code.

Definition at line 56 of file gtest_color_test.py.

References SetEnvVar().

Referenced by gtest_color_test.GTestColorTest.testAliasesOfYesAndNo(), gtest_color_test.GTestColorTest.testEnvVarAndFlag(), gtest_color_test.GTestColorTest.testEnvVarOnly(), gtest_color_test.GTestColorTest.testFlagOnly(), and gtest_color_test.GTestColorTest.testNoEnvVarNoFlag().

56 def UsesColor(term, color_env_var, color_flag):
57  """Runs gtest_color_test_ and returns its exit code."""
58 
59  SetEnvVar('TERM', term)
60  SetEnvVar(COLOR_ENV_VAR, color_env_var)
61 
62  if color_flag is None:
63  args = []
64  else:
65  args = ['--%s=%s' % (COLOR_FLAG, color_flag)]
66  p = gtest_test_utils.Subprocess([COMMAND] + args)
67  return not p.exited or p.exit_code
68 
69 
def SetEnvVar(env_var, value)
def UsesColor(term, color_env_var, color_flag)

Variable Documentation

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

Definition at line 34 of file gtest_color_test.py.

string gtest_color_test.COLOR_ENV_VAR = 'GTEST_COLOR'

Definition at line 42 of file gtest_color_test.py.

string gtest_color_test.COLOR_FLAG = 'gtest_color'

Definition at line 43 of file gtest_color_test.py.

gtest_color_test.COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_color_test_')

Definition at line 44 of file gtest_color_test.py.

string gtest_color_test.IS_WINDOWS = 'nt'

Definition at line 40 of file gtest_color_test.py.