tesseract v5.3.3.20231005
googletest-color-test Namespace Reference

Classes

class  GTestColorTest
 

Functions

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

Variables

string IS_WINDOWS = 'nt'
 
string COLOR_ENV_VAR = 'GTEST_COLOR'
 
string COLOR_FLAG = 'gtest_color'
 
 COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-color-test_')
 

Function Documentation

◆ SetEnvVar()

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

Definition at line 44 of file googletest-color-test.py.

44def SetEnvVar(env_var, value):
45 """Sets the env variable to 'value'; unsets it when 'value' is None."""
46
47 if value is not None:
48 os.environ[env_var] = value
49 elif env_var in os.environ:
50 del os.environ[env_var]
51
52
def SetEnvVar(env_var, value)

◆ UsesColor()

def googletest-color-test.UsesColor (   term,
  color_env_var,
  color_flag 
)
Runs googletest-color-test_ and returns its exit code.

Definition at line 53 of file googletest-color-test.py.

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

Variable Documentation

◆ COLOR_ENV_VAR

string googletest-color-test.COLOR_ENV_VAR = 'GTEST_COLOR'

Definition at line 39 of file googletest-color-test.py.

◆ COLOR_FLAG

string googletest-color-test.COLOR_FLAG = 'gtest_color'

Definition at line 40 of file googletest-color-test.py.

◆ COMMAND

googletest-color-test.COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-color-test_')

Definition at line 41 of file googletest-color-test.py.

◆ IS_WINDOWS

string googletest-color-test.IS_WINDOWS = 'nt'

Definition at line 37 of file googletest-color-test.py.