tesseract v5.3.3.20231005
googletest-throw-on-failure-test Namespace Reference

Classes

class  ThrowOnFailureTest
 

Functions

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

Variables

string THROW_ON_FAILURE = 'gtest_throw_on_failure'
 
 EXE_PATH
 

Function Documentation

◆ Run()

def googletest-throw-on-failure-test.Run (   command)
Runs a command; returns True/False if its exit code is/isn't 0.

Definition at line 68 of file googletest-throw-on-failure-test.py.

68def Run(command):
69 """Runs a command; returns True/False if its exit code is/isn't 0."""
70
71 print('Running "%s". . .' % ' '.join(command))
73 return p.exited and p.exit_code == 0
74
75
76# The tests.

◆ SetEnvVar()

def googletest-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 56 of file googletest-throw-on-failure-test.py.

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

Variable Documentation

◆ EXE_PATH

googletest-throw-on-failure-test.EXE_PATH
Initial value:
2 'googletest-throw-on-failure-test_')
def GetTestExecutablePath(executable_name, build_dir=None)

Definition at line 49 of file googletest-throw-on-failure-test.py.

◆ THROW_ON_FAILURE

string googletest-throw-on-failure-test.THROW_ON_FAILURE = 'gtest_throw_on_failure'

Definition at line 45 of file googletest-throw-on-failure-test.py.