proxygen
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)
 
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)
 
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

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.

References gtest_help_test.RunWithFlag().

Referenced by gtest_help_test.GTestHelpTest.TestHelpFlag(), gtest_help_test.GTestHelpTest.testPrintsHelpWithFullFlag(), gtest_help_test.GTestHelpTest.testPrintsHelpWithIncorrectFlagStyle(), gtest_help_test.GTestHelpTest.testPrintsHelpWithQuestionFlag(), gtest_help_test.GTestHelpTest.testPrintsHelpWithShortFlag(), gtest_help_test.GTestHelpTest.testPrintsHelpWithUnrecognizedGoogleTestFlag(), and gtest_help_test.GTestHelpTest.testPrintsHelpWithWindowsStyleQuestionFlag().

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:
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)
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.

References gtest_help_test.RunWithFlag(), and gtest_help_test.GTestHelpTest.TestHelpFlag().

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:
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)
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.

References gtest_help_test.RunWithFlag(), and gtest_help_test.GTestHelpTest.TestHelpFlag().

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:
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)
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.

References gtest_help_test.RunWithFlag().

Referenced by gtest_help_test.GTestHelpTest.TestNonHelpFlag(), gtest_help_test.GTestHelpTest.testRunsTestsWithGtestInternalFlag(), and gtest_help_test.GTestHelpTest.testRunsTestsWithoutHelpFlag().

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 
def RunWithFlag(flag)
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.

References gtest_help_test.RunWithFlag(), and gtest_help_test.GTestHelpTest.TestNonHelpFlag().

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 
def RunWithFlag(flag)
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.

References gtest_help_test.RunWithFlag(), and gtest_help_test.GTestHelpTest.TestNonHelpFlag().

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 
def RunWithFlag(flag)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithFullFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithFullFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithFullFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithIncorrectFlagStyle (   self)

Definition at line 154 of file gtest_help_test.py.

References gtest_help_test.GTestHelpTest.TestHelpFlag().

Referenced by gtest_help_test.GTestHelpTest.testPrintsHelpWithIncorrectFlagStyle().

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

Definition at line 154 of file gtest_help_test.py.

References gtest_help_test.GTestHelpTest.TestHelpFlag(), and gtest_help_test.GTestHelpTest.testPrintsHelpWithIncorrectFlagStyle().

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

Definition at line 154 of file gtest_help_test.py.

References gtest_help_test.GTestHelpTest.TestHelpFlag(), and gtest_help_test.GTestHelpTest.testPrintsHelpWithIncorrectFlagStyle().

155  for incorrect_flag in INCORRECT_FLAG_VARIANTS:
156  self.TestHelpFlag(incorrect_flag)
157 
def gtest_help_test.GTestHelpTest.testPrintsHelpWithQuestionFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithQuestionFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithQuestionFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithShortFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithShortFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithShortFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithUnrecognizedGoogleTestFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithUnrecognizedGoogleTestFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithUnrecognizedGoogleTestFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithWindowsStyleQuestionFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithWindowsStyleQuestionFlag (   self)
def gtest_help_test.GTestHelpTest.testPrintsHelpWithWindowsStyleQuestionFlag (   self)
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.

References gtest_test_utils.Main(), gtest_help_test.GTestHelpTest.TestNonHelpFlag(), and gtest_help_test.GTestHelpTest.testRunsTestsWithGtestInternalFlag().

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 
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.

References gtest_test_utils.Main(), gtest_help_test.GTestHelpTest.TestNonHelpFlag(), and gtest_help_test.GTestHelpTest.testRunsTestsWithGtestInternalFlag().

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 
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.

References gtest_test_utils.Main(), and gtest_help_test.GTestHelpTest.TestNonHelpFlag().

Referenced by gtest_help_test.GTestHelpTest.testRunsTestsWithGtestInternalFlag().

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 
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.

References gtest_help_test.GTestHelpTest.TestNonHelpFlag(), and gtest_help_test.GTestHelpTest.testRunsTestsWithoutHelpFlag().

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 
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.

References gtest_help_test.GTestHelpTest.TestNonHelpFlag(), and gtest_help_test.GTestHelpTest.testRunsTestsWithoutHelpFlag().

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 
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.

References gtest_help_test.GTestHelpTest.TestNonHelpFlag().

Referenced by gtest_help_test.GTestHelpTest.testRunsTestsWithoutHelpFlag().

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: