tesseract v5.3.3.20231005
gtest_help_test.GTestHelpTest Class Reference
Inheritance diagram for gtest_help_test.GTestHelpTest:

Public Member Functions

def TestHelpFlag (self, flag)
 
def TestNonHelpFlag (self, flag)
 
def testPrintsHelpWithFullFlag (self)
 
def testPrintsHelpWithShortFlag (self)
 
def testPrintsHelpWithQuestionFlag (self)
 
def testPrintsHelpWithWindowsStyleQuestionFlag (self)
 
def testPrintsHelpWithUnrecognizedGoogleTestFlag (self)
 
def testPrintsHelpWithIncorrectFlagStyle (self)
 
def testRunsTestsWithoutHelpFlag (self)
 
def testRunsTestsWithGtestInternalFlag (self)
 

Detailed Description

Tests the --help flag and its equivalent forms.

Definition at line 98 of file gtest_help_test.py.

Member Function Documentation

◆ TestHelpFlag()

def gtest_help_test.GTestHelpTest.TestHelpFlag (   self,
  flag 
)
Verifies correct behavior when help flag is specified.

The right message must be printed and the tests must
skipped when the given flag is specified.

Args:
  flag:  A flag to pass to the binary or None.

Definition at line 101 of file gtest_help_test.py.

101 def TestHelpFlag(self, flag):
102 """Verifies correct behavior when help flag is specified.
103
104 The right message must be printed and the tests must
105 skipped when the given flag is specified.
106
107 Args:
108 flag: A flag to pass to the binary or None.
109 """
110
111 exit_code, output = RunWithFlag(flag)
112 self.assertEquals(0, exit_code)
113 self.assert_(HELP_REGEX.search(output), output)
114
115 if IS_LINUX or IS_GNUKFREEBSD:
116 self.assert_(STREAM_RESULT_TO_FLAG in output, output)
117 else:
118 self.assert_(STREAM_RESULT_TO_FLAG not in output, output)
119
120 if SUPPORTS_DEATH_TESTS and not IS_WINDOWS:
121 self.assert_(DEATH_TEST_STYLE_FLAG in output, output)
122 else:
123 self.assert_(DEATH_TEST_STYLE_FLAG not in output, output)
124
def RunWithFlag(flag)

◆ TestNonHelpFlag()

def gtest_help_test.GTestHelpTest.TestNonHelpFlag (   self,
  flag 
)
Verifies correct behavior when no help flag is specified.

Verifies that when no help flag is specified, the tests are run
and the help message is not printed.

Args:
  flag:  A flag to pass to the binary or None.

Definition at line 125 of file gtest_help_test.py.

125 def TestNonHelpFlag(self, flag):
126 """Verifies correct behavior when no help flag is specified.
127
128 Verifies that when no help flag is specified, the tests are run
129 and the help message is not printed.
130
131 Args:
132 flag: A flag to pass to the binary or None.
133 """
134
135 exit_code, output = RunWithFlag(flag)
136 self.assert_(exit_code != 0)
137 self.assert_(not HELP_REGEX.search(output), output)
138

◆ testPrintsHelpWithFullFlag()

def gtest_help_test.GTestHelpTest.testPrintsHelpWithFullFlag (   self)

Definition at line 139 of file gtest_help_test.py.

139 def testPrintsHelpWithFullFlag(self):
140 self.TestHelpFlag('--help')
141

◆ testPrintsHelpWithIncorrectFlagStyle()

def gtest_help_test.GTestHelpTest.testPrintsHelpWithIncorrectFlagStyle (   self)

Definition at line 154 of file gtest_help_test.py.

154 def testPrintsHelpWithIncorrectFlagStyle(self):
155 for incorrect_flag in INCORRECT_FLAG_VARIANTS:
156 self.TestHelpFlag(incorrect_flag)
157

◆ testPrintsHelpWithQuestionFlag()

def gtest_help_test.GTestHelpTest.testPrintsHelpWithQuestionFlag (   self)

Definition at line 145 of file gtest_help_test.py.

145 def testPrintsHelpWithQuestionFlag(self):
146 self.TestHelpFlag('-?')
147

◆ testPrintsHelpWithShortFlag()

def gtest_help_test.GTestHelpTest.testPrintsHelpWithShortFlag (   self)

Definition at line 142 of file gtest_help_test.py.

142 def testPrintsHelpWithShortFlag(self):
143 self.TestHelpFlag('-h')
144

◆ testPrintsHelpWithUnrecognizedGoogleTestFlag()

def gtest_help_test.GTestHelpTest.testPrintsHelpWithUnrecognizedGoogleTestFlag (   self)

Definition at line 151 of file gtest_help_test.py.

151 def testPrintsHelpWithUnrecognizedGoogleTestFlag(self):
152 self.TestHelpFlag(UNKNOWN_FLAG)
153

◆ testPrintsHelpWithWindowsStyleQuestionFlag()

def gtest_help_test.GTestHelpTest.testPrintsHelpWithWindowsStyleQuestionFlag (   self)

Definition at line 148 of file gtest_help_test.py.

148 def testPrintsHelpWithWindowsStyleQuestionFlag(self):
149 self.TestHelpFlag('/?')
150

◆ testRunsTestsWithGtestInternalFlag()

def gtest_help_test.GTestHelpTest.testRunsTestsWithGtestInternalFlag (   self)
Verifies that the tests are run and no help message is printed when
a flag starting with Google Test prefix and 'internal_' is supplied.

Definition at line 164 of file gtest_help_test.py.

164 def testRunsTestsWithGtestInternalFlag(self):
165 """Verifies that the tests are run and no help message is printed when
166 a flag starting with Google Test prefix and 'internal_' is supplied."""
167
168 self.TestNonHelpFlag(INTERNAL_FLAG_FOR_TESTING)
169
170

◆ testRunsTestsWithoutHelpFlag()

def gtest_help_test.GTestHelpTest.testRunsTestsWithoutHelpFlag (   self)
Verifies that when no help flag is specified, the tests are run
and the help message is not printed.

Definition at line 158 of file gtest_help_test.py.

158 def testRunsTestsWithoutHelpFlag(self):
159 """Verifies that when no help flag is specified, the tests are run
160 and the help message is not printed."""
161
162 self.TestNonHelpFlag(None)
163

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