proxygen
gtest_filter_unittest.GTestFilterUnitTest Class Reference
Inheritance diagram for gtest_filter_unittest.GTestFilterUnitTest:

Public Member Functions

def AssertSetEqual (self, lhs, rhs)
 
def AssertPartitionIsValid (self, set_var, list_of_sets)
 
def AdjustForParameterizedTests (self, tests_to_run)
 
def RunAndVerify (self, gtest_filter, tests_to_run)
 
def RunAndVerifyWithSharding (self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
 
def RunAndVerifyAllowingDisabled (self, gtest_filter, tests_to_run)
 
def setUp (self)
 
def testDefaultBehavior (self)
 
def testDefaultBehaviorWithShards (self)
 
def testEmptyFilter (self)
 
def testBadFilter (self)
 
def testFullName (self)
 
def testUniversalFilters (self)
 
def testFilterByTestCase (self)
 
def testFilterByTest (self)
 
def testFilterDisabledTests (self)
 
def testWildcardInTestCaseName (self)
 
def testWildcardInTestName (self)
 
def testFilterWithoutDot (self)
 
def testTwoPatterns (self)
 
def testThreePatterns (self)
 
def testNegativeFilters (self)
 
def testFlagOverridesEnvVar (self)
 
def testShardStatusFileIsCreated (self)
 
def testShardStatusFileIsCreatedWithListTests (self)
 
def testShardingWorksWithDeathTests (self)
 
def AssertSetEqual (self, lhs, rhs)
 
def AssertPartitionIsValid (self, set_var, list_of_sets)
 
def AdjustForParameterizedTests (self, tests_to_run)
 
def RunAndVerify (self, gtest_filter, tests_to_run)
 
def RunAndVerifyWithSharding (self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
 
def RunAndVerifyAllowingDisabled (self, gtest_filter, tests_to_run)
 
def setUp (self)
 
def testDefaultBehavior (self)
 
def testDefaultBehaviorWithShards (self)
 
def testEmptyFilter (self)
 
def testBadFilter (self)
 
def testFullName (self)
 
def testUniversalFilters (self)
 
def testFilterByTestCase (self)
 
def testFilterByTest (self)
 
def testFilterDisabledTests (self)
 
def testWildcardInTestCaseName (self)
 
def testWildcardInTestName (self)
 
def testFilterWithoutDot (self)
 
def testTwoPatterns (self)
 
def testThreePatterns (self)
 
def testNegativeFilters (self)
 
def testFlagOverridesEnvVar (self)
 
def testShardStatusFileIsCreated (self)
 
def testShardStatusFileIsCreatedWithListTests (self)
 
def testShardingWorksWithDeathTests (self)
 
def AssertSetEqual (self, lhs, rhs)
 
def AssertPartitionIsValid (self, set_var, list_of_sets)
 
def AdjustForParameterizedTests (self, tests_to_run)
 
def RunAndVerify (self, gtest_filter, tests_to_run)
 
def RunAndVerifyWithSharding (self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
 
def RunAndVerifyAllowingDisabled (self, gtest_filter, tests_to_run)
 
def setUp (self)
 
def testDefaultBehavior (self)
 
def testDefaultBehaviorWithShards (self)
 
def testEmptyFilter (self)
 
def testBadFilter (self)
 
def testFullName (self)
 
def testUniversalFilters (self)
 
def testFilterByTestCase (self)
 
def testFilterByTest (self)
 
def testFilterDisabledTests (self)
 
def testWildcardInTestCaseName (self)
 
def testWildcardInTestName (self)
 
def testFilterWithoutDot (self)
 
def testTwoPatterns (self)
 
def testThreePatterns (self)
 
def testNegativeFilters (self)
 
def testFlagOverridesEnvVar (self)
 
def testShardStatusFileIsCreated (self)
 
def testShardStatusFileIsCreatedWithListTests (self)
 
def testShardingWorksWithDeathTests (self)
 

Detailed Description

Tests the env variable or the command line flag to filter tests.

Definition at line 228 of file gtest_filter_unittest.py.

Member Function Documentation

def gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests (   self,
  tests_to_run 
)
Adjust tests_to_run in case value parameterized tests are disabled.

Definition at line 251 of file gtest_filter_unittest.py.

References bm.list.

Referenced by gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding().

251  def AdjustForParameterizedTests(self, tests_to_run):
252  """Adjust tests_to_run in case value parameterized tests are disabled."""
253 
254  global param_tests_present
255  if not param_tests_present:
256  return list(set(tests_to_run) - set(PARAM_TESTS))
257  else:
258  return tests_to_run
259 
Encoder::MutableCompressedList list
Definition: Traits.h:592
def gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests (   self,
  tests_to_run 
)
Adjust tests_to_run in case value parameterized tests are disabled.

Definition at line 251 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests(), and bm.list.

251  def AdjustForParameterizedTests(self, tests_to_run):
252  """Adjust tests_to_run in case value parameterized tests are disabled."""
253 
254  global param_tests_present
255  if not param_tests_present:
256  return list(set(tests_to_run) - set(PARAM_TESTS))
257  else:
258  return tests_to_run
259 
Encoder::MutableCompressedList list
Definition: Traits.h:592
def gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests (   self,
  tests_to_run 
)
Adjust tests_to_run in case value parameterized tests are disabled.

Definition at line 251 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests(), and bm.list.

251  def AdjustForParameterizedTests(self, tests_to_run):
252  """Adjust tests_to_run in case value parameterized tests are disabled."""
253 
254  global param_tests_present
255  if not param_tests_present:
256  return list(set(tests_to_run) - set(PARAM_TESTS))
257  else:
258  return tests_to_run
259 
Encoder::MutableCompressedList list
Definition: Traits.h:592
def gtest_filter_unittest.GTestFilterUnitTest.AssertPartitionIsValid (   self,
  set_var,
  list_of_sets 
)
Asserts that list_of_sets is a valid partition of set_var.

Definition at line 242 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AssertPartitionIsValid().

242  def AssertPartitionIsValid(self, set_var, list_of_sets):
243  """Asserts that list_of_sets is a valid partition of set_var."""
244 
245  full_partition = []
246  for slice_var in list_of_sets:
247  full_partition.extend(slice_var)
248  self.assertEqual(len(set_var), len(full_partition))
249  self.assertEqual(set(set_var), set(full_partition))
250 
def AssertPartitionIsValid(self, set_var, list_of_sets)
Definition: Traits.h:592
def gtest_filter_unittest.GTestFilterUnitTest.AssertPartitionIsValid (   self,
  set_var,
  list_of_sets 
)
Asserts that list_of_sets is a valid partition of set_var.

Definition at line 242 of file gtest_filter_unittest.py.

Referenced by gtest_filter_unittest.GTestFilterUnitTest.AssertPartitionIsValid(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding().

242  def AssertPartitionIsValid(self, set_var, list_of_sets):
243  """Asserts that list_of_sets is a valid partition of set_var."""
244 
245  full_partition = []
246  for slice_var in list_of_sets:
247  full_partition.extend(slice_var)
248  self.assertEqual(len(set_var), len(full_partition))
249  self.assertEqual(set(set_var), set(full_partition))
250 
def AssertPartitionIsValid(self, set_var, list_of_sets)
Definition: Traits.h:592
def gtest_filter_unittest.GTestFilterUnitTest.AssertPartitionIsValid (   self,
  set_var,
  list_of_sets 
)
Asserts that list_of_sets is a valid partition of set_var.

Definition at line 242 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AssertPartitionIsValid().

242  def AssertPartitionIsValid(self, set_var, list_of_sets):
243  """Asserts that list_of_sets is a valid partition of set_var."""
244 
245  full_partition = []
246  for slice_var in list_of_sets:
247  full_partition.extend(slice_var)
248  self.assertEqual(len(set_var), len(full_partition))
249  self.assertEqual(set(set_var), set(full_partition))
250 
def AssertPartitionIsValid(self, set_var, list_of_sets)
Definition: Traits.h:592
def gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual (   self,
  lhs,
  rhs 
)
Asserts that two sets are equal.

Definition at line 233 of file gtest_filter_unittest.py.

Referenced by gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), and gtest_filter_unittest.GTestFilterUnitTest.testFlagOverridesEnvVar().

233  def AssertSetEqual(self, lhs, rhs):
234  """Asserts that two sets are equal."""
235 
236  for elem in lhs:
237  self.assert_(elem in rhs, '%s in %s' % (elem, rhs))
238 
239  for elem in rhs:
240  self.assert_(elem in lhs, '%s in %s' % (elem, lhs))
241 
def gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual (   self,
  lhs,
  rhs 
)
Asserts that two sets are equal.

Definition at line 233 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual().

233  def AssertSetEqual(self, lhs, rhs):
234  """Asserts that two sets are equal."""
235 
236  for elem in lhs:
237  self.assert_(elem in rhs, '%s in %s' % (elem, rhs))
238 
239  for elem in rhs:
240  self.assert_(elem in lhs, '%s in %s' % (elem, lhs))
241 
def gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual (   self,
  lhs,
  rhs 
)
Asserts that two sets are equal.

Definition at line 233 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual().

233  def AssertSetEqual(self, lhs, rhs):
234  """Asserts that two sets are equal."""
235 
236  for elem in lhs:
237  self.assert_(elem in rhs, '%s in %s' % (elem, rhs))
238 
239  for elem in rhs:
240  self.assert_(elem in lhs, '%s in %s' % (elem, lhs))
241 
def gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify (   self,
  gtest_filter,
  tests_to_run 
)
Checks that the binary runs correct set of tests for a given filter.

Definition at line 260 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests(), gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual(), gtest_filter_unittest.RunAndExtractTestList(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.SetEnvVar().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.testBadFilter(), gtest_throw_on_failure_test.ThrowOnFailureTest.testDefaultBehavior(), gtest_list_tests_unittest.GTestListTestsUnitTest.testDefaultBehavior(), gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehavior(), gtest_filter_unittest.GTestFilterUnitTest.testEmptyFilter(), gtest_filter_unittest.GTestFilterUnitTest.testFilterByTest(), gtest_filter_unittest.GTestFilterUnitTest.testFilterByTestCase(), gtest_filter_unittest.GTestFilterUnitTest.testFilterDisabledTests(), gtest_filter_unittest.GTestFilterUnitTest.testFilterWithoutDot(), gtest_list_tests_unittest.GTestListTestsUnitTest.testFlag(), gtest_filter_unittest.GTestFilterUnitTest.testFullName(), gtest_filter_unittest.GTestFilterUnitTest.testNegativeFilters(), gtest_list_tests_unittest.GTestListTestsUnitTest.testOverrideNonFilterFlags(), gtest_filter_unittest.GTestFilterUnitTest.testThreePatterns(), gtest_throw_on_failure_test.ThrowOnFailureTest.testThrowOnFailureEnvVar(), gtest_throw_on_failure_test.ThrowOnFailureTest.testThrowOnFailureFlag(), gtest_throw_on_failure_test.ThrowOnFailureTest.testThrowOnFailureFlagOverridesEnvVar(), gtest_filter_unittest.GTestFilterUnitTest.testTwoPatterns(), gtest_filter_unittest.GTestFilterUnitTest.testUniversalFilters(), gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestCaseName(), gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestName(), and gtest_list_tests_unittest.GTestListTestsUnitTest.testWithFilterFlags().

260  def RunAndVerify(self, gtest_filter, tests_to_run):
261  """Checks that the binary runs correct set of tests for a given filter."""
262 
263  tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
264 
265  # First, tests using the environment variable.
266 
267  # Windows removes empty variables from the environment when passing it
268  # to a new process. This means it is impossible to pass an empty filter
269  # into a process using the environment variable. However, we can still
270  # test the case when the variable is not supplied (i.e., gtest_filter is
271  # None).
272  # pylint: disable-msg=C6403
273  if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
274  SetEnvVar(FILTER_ENV_VAR, gtest_filter)
275  tests_run = RunAndExtractTestList()[0]
276  SetEnvVar(FILTER_ENV_VAR, None)
277  self.AssertSetEqual(tests_run, tests_to_run)
278  # pylint: enable-msg=C6403
279 
280  # Next, tests using the command line flag.
281 
282  if gtest_filter is None:
283  args = []
284  else:
285  args = ['--%s=%s' % (FILTER_FLAG, gtest_filter)]
286 
287  tests_run = RunAndExtractTestList(args)[0]
288  self.AssertSetEqual(tests_run, tests_to_run)
289 
def RunAndExtractTestList(args=None)
def RunAndVerify(self, gtest_filter, tests_to_run)
def SetEnvVar(env_var, value)
def gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify (   self,
  gtest_filter,
  tests_to_run 
)
Checks that the binary runs correct set of tests for a given filter.

Definition at line 260 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests(), gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual(), gtest_filter_unittest.RunAndExtractTestList(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.SetEnvVar().

260  def RunAndVerify(self, gtest_filter, tests_to_run):
261  """Checks that the binary runs correct set of tests for a given filter."""
262 
263  tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
264 
265  # First, tests using the environment variable.
266 
267  # Windows removes empty variables from the environment when passing it
268  # to a new process. This means it is impossible to pass an empty filter
269  # into a process using the environment variable. However, we can still
270  # test the case when the variable is not supplied (i.e., gtest_filter is
271  # None).
272  # pylint: disable-msg=C6403
273  if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
274  SetEnvVar(FILTER_ENV_VAR, gtest_filter)
275  tests_run = RunAndExtractTestList()[0]
276  SetEnvVar(FILTER_ENV_VAR, None)
277  self.AssertSetEqual(tests_run, tests_to_run)
278  # pylint: enable-msg=C6403
279 
280  # Next, tests using the command line flag.
281 
282  if gtest_filter is None:
283  args = []
284  else:
285  args = ['--%s=%s' % (FILTER_FLAG, gtest_filter)]
286 
287  tests_run = RunAndExtractTestList(args)[0]
288  self.AssertSetEqual(tests_run, tests_to_run)
289 
def RunAndExtractTestList(args=None)
def RunAndVerify(self, gtest_filter, tests_to_run)
def SetEnvVar(env_var, value)
def gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify (   self,
  gtest_filter,
  tests_to_run 
)
Checks that the binary runs correct set of tests for a given filter.

Definition at line 260 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests(), gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual(), gtest_filter_unittest.RunAndExtractTestList(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.SetEnvVar().

260  def RunAndVerify(self, gtest_filter, tests_to_run):
261  """Checks that the binary runs correct set of tests for a given filter."""
262 
263  tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
264 
265  # First, tests using the environment variable.
266 
267  # Windows removes empty variables from the environment when passing it
268  # to a new process. This means it is impossible to pass an empty filter
269  # into a process using the environment variable. However, we can still
270  # test the case when the variable is not supplied (i.e., gtest_filter is
271  # None).
272  # pylint: disable-msg=C6403
273  if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
274  SetEnvVar(FILTER_ENV_VAR, gtest_filter)
275  tests_run = RunAndExtractTestList()[0]
276  SetEnvVar(FILTER_ENV_VAR, None)
277  self.AssertSetEqual(tests_run, tests_to_run)
278  # pylint: enable-msg=C6403
279 
280  # Next, tests using the command line flag.
281 
282  if gtest_filter is None:
283  args = []
284  else:
285  args = ['--%s=%s' % (FILTER_FLAG, gtest_filter)]
286 
287  tests_run = RunAndExtractTestList(args)[0]
288  self.AssertSetEqual(tests_run, tests_to_run)
289 
def RunAndExtractTestList(args=None)
def RunAndVerify(self, gtest_filter, tests_to_run)
def SetEnvVar(env_var, value)
def gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled (   self,
  gtest_filter,
  tests_to_run 
)
Checks that the binary runs correct set of tests for the given filter.

Runs gtest_filter_unittest_ with the given filter, and enables
disabled tests. Verifies that the right set of tests were run.

Args:
  gtest_filter: A filter to apply to the tests.
  tests_to_run: A set of tests expected to run.

Definition at line 328 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests(), gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual(), gtest_filter_unittest.RunAndExtractTestList(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled().

328  def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run):
329  """Checks that the binary runs correct set of tests for the given filter.
330 
331  Runs gtest_filter_unittest_ with the given filter, and enables
332  disabled tests. Verifies that the right set of tests were run.
333 
334  Args:
335  gtest_filter: A filter to apply to the tests.
336  tests_to_run: A set of tests expected to run.
337  """
338 
339  tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
340 
341  # Construct the command line.
342  args = ['--%s' % ALSO_RUN_DISABED_TESTS_FLAG]
343  if gtest_filter is not None:
344  args.append('--%s=%s' % (FILTER_FLAG, gtest_filter))
345 
346  tests_run = RunAndExtractTestList(args)[0]
347  self.AssertSetEqual(tests_run, tests_to_run)
348 
def RunAndExtractTestList(args=None)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled (   self,
  gtest_filter,
  tests_to_run 
)
Checks that the binary runs correct set of tests for the given filter.

Runs gtest_filter_unittest_ with the given filter, and enables
disabled tests. Verifies that the right set of tests were run.

Args:
  gtest_filter: A filter to apply to the tests.
  tests_to_run: A set of tests expected to run.

Definition at line 328 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests(), gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual(), and gtest_filter_unittest.RunAndExtractTestList().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), gtest_filter_unittest.GTestFilterUnitTest.testBadFilter(), gtest_filter_unittest.GTestFilterUnitTest.testFilterByTestCase(), gtest_filter_unittest.GTestFilterUnitTest.testFilterDisabledTests(), gtest_filter_unittest.GTestFilterUnitTest.testFullName(), and gtest_filter_unittest.GTestFilterUnitTest.testUniversalFilters().

328  def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run):
329  """Checks that the binary runs correct set of tests for the given filter.
330 
331  Runs gtest_filter_unittest_ with the given filter, and enables
332  disabled tests. Verifies that the right set of tests were run.
333 
334  Args:
335  gtest_filter: A filter to apply to the tests.
336  tests_to_run: A set of tests expected to run.
337  """
338 
339  tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
340 
341  # Construct the command line.
342  args = ['--%s' % ALSO_RUN_DISABED_TESTS_FLAG]
343  if gtest_filter is not None:
344  args.append('--%s=%s' % (FILTER_FLAG, gtest_filter))
345 
346  tests_run = RunAndExtractTestList(args)[0]
347  self.AssertSetEqual(tests_run, tests_to_run)
348 
def RunAndExtractTestList(args=None)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled (   self,
  gtest_filter,
  tests_to_run 
)
Checks that the binary runs correct set of tests for the given filter.

Runs gtest_filter_unittest_ with the given filter, and enables
disabled tests. Verifies that the right set of tests were run.

Args:
  gtest_filter: A filter to apply to the tests.
  tests_to_run: A set of tests expected to run.

Definition at line 328 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests(), gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual(), gtest_filter_unittest.RunAndExtractTestList(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled().

328  def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run):
329  """Checks that the binary runs correct set of tests for the given filter.
330 
331  Runs gtest_filter_unittest_ with the given filter, and enables
332  disabled tests. Verifies that the right set of tests were run.
333 
334  Args:
335  gtest_filter: A filter to apply to the tests.
336  tests_to_run: A set of tests expected to run.
337  """
338 
339  tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
340 
341  # Construct the command line.
342  args = ['--%s' % ALSO_RUN_DISABED_TESTS_FLAG]
343  if gtest_filter is not None:
344  args.append('--%s=%s' % (FILTER_FLAG, gtest_filter))
345 
346  tests_run = RunAndExtractTestList(args)[0]
347  self.AssertSetEqual(tests_run, tests_to_run)
348 
def RunAndExtractTestList(args=None)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding (   self,
  gtest_filter,
  total_shards,
  tests_to_run,
  args = None,
  check_exit_0 = False 
)
Checks that binary runs correct tests for the given filter and shard.

Runs all shards of gtest_filter_unittest_ with the given filter, and
verifies that the right set of tests were run. The union of tests run
on each shard should be identical to tests_to_run, without duplicates.

Args:
  gtest_filter: A filter to apply to the tests.
  total_shards: A total number of shards to split test run into.
  tests_to_run: A set of tests expected to run.
  args   :      Arguments to pass to the to the test binary.
  check_exit_0: When set to a true value, make sure that all shards
            return 0.

Definition at line 291 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests(), gtest_filter_unittest.GTestFilterUnitTest.AssertPartitionIsValid(), folly::gen.range(), gtest_filter_unittest.RunWithSharding(), and gtest_filter_unittest.SetEnvVar().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehaviorWithShards(), gtest_filter_unittest.GTestFilterUnitTest.testEmptyFilter(), gtest_filter_unittest.GTestFilterUnitTest.testFullName(), gtest_filter_unittest.GTestFilterUnitTest.testShardingWorksWithDeathTests(), and gtest_filter_unittest.GTestFilterUnitTest.testUniversalFilters().

291  args=None, check_exit_0=False):
292  """Checks that binary runs correct tests for the given filter and shard.
293 
294  Runs all shards of gtest_filter_unittest_ with the given filter, and
295  verifies that the right set of tests were run. The union of tests run
296  on each shard should be identical to tests_to_run, without duplicates.
297 
298  Args:
299  gtest_filter: A filter to apply to the tests.
300  total_shards: A total number of shards to split test run into.
301  tests_to_run: A set of tests expected to run.
302  args : Arguments to pass to the to the test binary.
303  check_exit_0: When set to a true value, make sure that all shards
304  return 0.
305  """
306 
307  tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
308 
309  # Windows removes empty variables from the environment when passing it
310  # to a new process. This means it is impossible to pass an empty filter
311  # into a process using the environment variable. However, we can still
312  # test the case when the variable is not supplied (i.e., gtest_filter is
313  # None).
314  # pylint: disable-msg=C6403
315  if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
316  SetEnvVar(FILTER_ENV_VAR, gtest_filter)
317  partition = []
318  for i in range(0, total_shards):
319  (tests_run, exit_code) = RunWithSharding(total_shards, i, args)
320  if check_exit_0:
321  self.assertEqual(0, exit_code)
322  partition.append(tests_run)
323 
324  self.AssertPartitionIsValid(tests_to_run, partition)
325  SetEnvVar(FILTER_ENV_VAR, None)
326  # pylint: enable-msg=C6403
327 
def RunWithSharding(total_shards, shard_index, command)
Gen range(Value begin, Value end)
Definition: Base.h:467
def SetEnvVar(env_var, value)
def AssertPartitionIsValid(self, set_var, list_of_sets)
def gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding (   self,
  gtest_filter,
  total_shards,
  tests_to_run,
  args = None,
  check_exit_0 = False 
)
Checks that binary runs correct tests for the given filter and shard.

Runs all shards of gtest_filter_unittest_ with the given filter, and
verifies that the right set of tests were run. The union of tests run
on each shard should be identical to tests_to_run, without duplicates.

Args:
  gtest_filter: A filter to apply to the tests.
  total_shards: A total number of shards to split test run into.
  tests_to_run: A set of tests expected to run.
  args   :      Arguments to pass to the to the test binary.
  check_exit_0: When set to a true value, make sure that all shards
            return 0.

Definition at line 291 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests(), gtest_filter_unittest.GTestFilterUnitTest.AssertPartitionIsValid(), folly::gen.range(), gtest_filter_unittest.RunWithSharding(), and gtest_filter_unittest.SetEnvVar().

291  args=None, check_exit_0=False):
292  """Checks that binary runs correct tests for the given filter and shard.
293 
294  Runs all shards of gtest_filter_unittest_ with the given filter, and
295  verifies that the right set of tests were run. The union of tests run
296  on each shard should be identical to tests_to_run, without duplicates.
297 
298  Args:
299  gtest_filter: A filter to apply to the tests.
300  total_shards: A total number of shards to split test run into.
301  tests_to_run: A set of tests expected to run.
302  args : Arguments to pass to the to the test binary.
303  check_exit_0: When set to a true value, make sure that all shards
304  return 0.
305  """
306 
307  tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
308 
309  # Windows removes empty variables from the environment when passing it
310  # to a new process. This means it is impossible to pass an empty filter
311  # into a process using the environment variable. However, we can still
312  # test the case when the variable is not supplied (i.e., gtest_filter is
313  # None).
314  # pylint: disable-msg=C6403
315  if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
316  SetEnvVar(FILTER_ENV_VAR, gtest_filter)
317  partition = []
318  for i in range(0, total_shards):
319  (tests_run, exit_code) = RunWithSharding(total_shards, i, args)
320  if check_exit_0:
321  self.assertEqual(0, exit_code)
322  partition.append(tests_run)
323 
324  self.AssertPartitionIsValid(tests_to_run, partition)
325  SetEnvVar(FILTER_ENV_VAR, None)
326  # pylint: enable-msg=C6403
327 
def RunWithSharding(total_shards, shard_index, command)
Gen range(Value begin, Value end)
Definition: Base.h:467
def SetEnvVar(env_var, value)
def AssertPartitionIsValid(self, set_var, list_of_sets)
def gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding (   self,
  gtest_filter,
  total_shards,
  tests_to_run,
  args = None,
  check_exit_0 = False 
)
Checks that binary runs correct tests for the given filter and shard.

Runs all shards of gtest_filter_unittest_ with the given filter, and
verifies that the right set of tests were run. The union of tests run
on each shard should be identical to tests_to_run, without duplicates.

Args:
  gtest_filter: A filter to apply to the tests.
  total_shards: A total number of shards to split test run into.
  tests_to_run: A set of tests expected to run.
  args   :      Arguments to pass to the to the test binary.
  check_exit_0: When set to a true value, make sure that all shards
            return 0.

Definition at line 291 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AdjustForParameterizedTests(), gtest_filter_unittest.GTestFilterUnitTest.AssertPartitionIsValid(), folly::gen.range(), gtest_filter_unittest.RunWithSharding(), and gtest_filter_unittest.SetEnvVar().

291  args=None, check_exit_0=False):
292  """Checks that binary runs correct tests for the given filter and shard.
293 
294  Runs all shards of gtest_filter_unittest_ with the given filter, and
295  verifies that the right set of tests were run. The union of tests run
296  on each shard should be identical to tests_to_run, without duplicates.
297 
298  Args:
299  gtest_filter: A filter to apply to the tests.
300  total_shards: A total number of shards to split test run into.
301  tests_to_run: A set of tests expected to run.
302  args : Arguments to pass to the to the test binary.
303  check_exit_0: When set to a true value, make sure that all shards
304  return 0.
305  """
306 
307  tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
308 
309  # Windows removes empty variables from the environment when passing it
310  # to a new process. This means it is impossible to pass an empty filter
311  # into a process using the environment variable. However, we can still
312  # test the case when the variable is not supplied (i.e., gtest_filter is
313  # None).
314  # pylint: disable-msg=C6403
315  if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
316  SetEnvVar(FILTER_ENV_VAR, gtest_filter)
317  partition = []
318  for i in range(0, total_shards):
319  (tests_run, exit_code) = RunWithSharding(total_shards, i, args)
320  if check_exit_0:
321  self.assertEqual(0, exit_code)
322  partition.append(tests_run)
323 
324  self.AssertPartitionIsValid(tests_to_run, partition)
325  SetEnvVar(FILTER_ENV_VAR, None)
326  # pylint: enable-msg=C6403
327 
def RunWithSharding(total_shards, shard_index, command)
Gen range(Value begin, Value end)
Definition: Base.h:467
def SetEnvVar(env_var, value)
def AssertPartitionIsValid(self, set_var, list_of_sets)
def gtest_filter_unittest.GTestFilterUnitTest.setUp (   self)
Sets up test case.

Determines whether value-parameterized tests are enabled in the binary and
sets the flags accordingly.

Definition at line 349 of file gtest_filter_unittest.py.

References gtest_filter_unittest.RunAndReturnOutput(), and gtest_filter_unittest.GTestFilterUnitTest.setUp().

349  def setUp(self):
350  """Sets up test case.
351 
352  Determines whether value-parameterized tests are enabled in the binary and
353  sets the flags accordingly.
354  """
355 
356  global param_tests_present
357  if param_tests_present is None:
358  param_tests_present = PARAM_TEST_REGEX.search(
359  RunAndReturnOutput()) is not None
360 
def gtest_filter_unittest.GTestFilterUnitTest.setUp (   self)
Sets up test case.

Determines whether value-parameterized tests are enabled in the binary and
sets the flags accordingly.

Definition at line 349 of file gtest_filter_unittest.py.

References gtest_filter_unittest.RunAndReturnOutput().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.setUp().

349  def setUp(self):
350  """Sets up test case.
351 
352  Determines whether value-parameterized tests are enabled in the binary and
353  sets the flags accordingly.
354  """
355 
356  global param_tests_present
357  if param_tests_present is None:
358  param_tests_present = PARAM_TEST_REGEX.search(
359  RunAndReturnOutput()) is not None
360 
def gtest_filter_unittest.GTestFilterUnitTest.setUp (   self)
Sets up test case.

Determines whether value-parameterized tests are enabled in the binary and
sets the flags accordingly.

Definition at line 349 of file gtest_filter_unittest.py.

References gtest_filter_unittest.RunAndReturnOutput(), and gtest_filter_unittest.GTestFilterUnitTest.setUp().

349  def setUp(self):
350  """Sets up test case.
351 
352  Determines whether value-parameterized tests are enabled in the binary and
353  sets the flags accordingly.
354  """
355 
356  global param_tests_present
357  if param_tests_present is None:
358  param_tests_present = PARAM_TEST_REGEX.search(
359  RunAndReturnOutput()) is not None
360 
def gtest_filter_unittest.GTestFilterUnitTest.testBadFilter (   self)
def gtest_filter_unittest.GTestFilterUnitTest.testBadFilter (   self)
Tests a filter that matches nothing.

Definition at line 382 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testBadFilter().

382  def testBadFilter(self):
383  """Tests a filter that matches nothing."""
384 
385  self.RunAndVerify('BadFilter', [])
386  self.RunAndVerifyAllowingDisabled('BadFilter', [])
387 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testBadFilter (   self)
def gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehavior (   self)
Tests the behavior of not specifying the filter.

Definition at line 361 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehavior().

362  """Tests the behavior of not specifying the filter."""
363 
364  self.RunAndVerify(None, ACTIVE_TESTS)
365 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehavior (   self)
Tests the behavior of not specifying the filter.

Definition at line 361 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehavior().

362  """Tests the behavior of not specifying the filter."""
363 
364  self.RunAndVerify(None, ACTIVE_TESTS)
365 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehavior (   self)
Tests the behavior of not specifying the filter.

Definition at line 361 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehavior().

362  """Tests the behavior of not specifying the filter."""
363 
364  self.RunAndVerify(None, ACTIVE_TESTS)
365 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehaviorWithShards (   self)
Tests the behavior without the filter, with sharding enabled.

Definition at line 366 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehaviorWithShards().

367  """Tests the behavior without the filter, with sharding enabled."""
368 
369  self.RunAndVerifyWithSharding(None, 1, ACTIVE_TESTS)
370  self.RunAndVerifyWithSharding(None, 2, ACTIVE_TESTS)
371  self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS) - 1, ACTIVE_TESTS)
372  self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS), ACTIVE_TESTS)
373  self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS) + 1, ACTIVE_TESTS)
374 
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehaviorWithShards (   self)
Tests the behavior without the filter, with sharding enabled.

Definition at line 366 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehaviorWithShards().

367  """Tests the behavior without the filter, with sharding enabled."""
368 
369  self.RunAndVerifyWithSharding(None, 1, ACTIVE_TESTS)
370  self.RunAndVerifyWithSharding(None, 2, ACTIVE_TESTS)
371  self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS) - 1, ACTIVE_TESTS)
372  self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS), ACTIVE_TESTS)
373  self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS) + 1, ACTIVE_TESTS)
374 
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehaviorWithShards (   self)
Tests the behavior without the filter, with sharding enabled.

Definition at line 366 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testDefaultBehaviorWithShards().

367  """Tests the behavior without the filter, with sharding enabled."""
368 
369  self.RunAndVerifyWithSharding(None, 1, ACTIVE_TESTS)
370  self.RunAndVerifyWithSharding(None, 2, ACTIVE_TESTS)
371  self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS) - 1, ACTIVE_TESTS)
372  self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS), ACTIVE_TESTS)
373  self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS) + 1, ACTIVE_TESTS)
374 
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testEmptyFilter (   self)
Tests an empty filter.

Definition at line 375 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.GTestFilterUnitTest.testEmptyFilter().

375  def testEmptyFilter(self):
376  """Tests an empty filter."""
377 
378  self.RunAndVerify('', [])
379  self.RunAndVerifyWithSharding('', 1, [])
380  self.RunAndVerifyWithSharding('', 2, [])
381 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testEmptyFilter (   self)
Tests an empty filter.

Definition at line 375 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testEmptyFilter().

375  def testEmptyFilter(self):
376  """Tests an empty filter."""
377 
378  self.RunAndVerify('', [])
379  self.RunAndVerifyWithSharding('', 1, [])
380  self.RunAndVerifyWithSharding('', 2, [])
381 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testEmptyFilter (   self)
Tests an empty filter.

Definition at line 375 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.GTestFilterUnitTest.testEmptyFilter().

375  def testEmptyFilter(self):
376  """Tests an empty filter."""
377 
378  self.RunAndVerify('', [])
379  self.RunAndVerifyWithSharding('', 1, [])
380  self.RunAndVerifyWithSharding('', 2, [])
381 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testFilterByTest (   self)
Tests filtering by test name.

Definition at line 414 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testFilterByTest().

414  def testFilterByTest(self):
415  """Tests filtering by test name."""
416 
417  self.RunAndVerify('*.TestOne', ['BarTest.TestOne', 'BazTest.TestOne'])
418 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testFilterByTest (   self)
Tests filtering by test name.

Definition at line 414 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testFilterByTest().

414  def testFilterByTest(self):
415  """Tests filtering by test name."""
416 
417  self.RunAndVerify('*.TestOne', ['BarTest.TestOne', 'BazTest.TestOne'])
418 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testFilterByTest (   self)
Tests filtering by test name.

Definition at line 414 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testFilterByTest().

414  def testFilterByTest(self):
415  """Tests filtering by test name."""
416 
417  self.RunAndVerify('*.TestOne', ['BarTest.TestOne', 'BazTest.TestOne'])
418 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testFilterByTestCase (   self)
Tests filtering by test case name.

Definition at line 404 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), and gtest_filter_unittest.GTestFilterUnitTest.testFilterByTestCase().

405  """Tests filtering by test case name."""
406 
407  self.RunAndVerify('FooTest.*', ['FooTest.Abc', 'FooTest.Xyz'])
408 
409  BAZ_TESTS = ['BazTest.TestOne', 'BazTest.TestA', 'BazTest.TestB']
410  self.RunAndVerify('BazTest.*', BAZ_TESTS)
411  self.RunAndVerifyAllowingDisabled('BazTest.*',
412  BAZ_TESTS + ['BazTest.DISABLED_TestC'])
413 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testFilterByTestCase (   self)
Tests filtering by test case name.

Definition at line 404 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), and gtest_filter_unittest.GTestFilterUnitTest.testFilterByTestCase().

405  """Tests filtering by test case name."""
406 
407  self.RunAndVerify('FooTest.*', ['FooTest.Abc', 'FooTest.Xyz'])
408 
409  BAZ_TESTS = ['BazTest.TestOne', 'BazTest.TestA', 'BazTest.TestB']
410  self.RunAndVerify('BazTest.*', BAZ_TESTS)
411  self.RunAndVerifyAllowingDisabled('BazTest.*',
412  BAZ_TESTS + ['BazTest.DISABLED_TestC'])
413 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testFilterByTestCase (   self)
Tests filtering by test case name.

Definition at line 404 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testFilterByTestCase().

405  """Tests filtering by test case name."""
406 
407  self.RunAndVerify('FooTest.*', ['FooTest.Abc', 'FooTest.Xyz'])
408 
409  BAZ_TESTS = ['BazTest.TestOne', 'BazTest.TestA', 'BazTest.TestB']
410  self.RunAndVerify('BazTest.*', BAZ_TESTS)
411  self.RunAndVerifyAllowingDisabled('BazTest.*',
412  BAZ_TESTS + ['BazTest.DISABLED_TestC'])
413 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testFilterDisabledTests (   self)
Select only the disabled tests to run.

Definition at line 419 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testFilterDisabledTests().

420  """Select only the disabled tests to run."""
421 
422  self.RunAndVerify('DISABLED_FoobarTest.Test1', [])
423  self.RunAndVerifyAllowingDisabled('DISABLED_FoobarTest.Test1',
424  ['DISABLED_FoobarTest.Test1'])
425 
426  self.RunAndVerify('*DISABLED_*', [])
427  self.RunAndVerifyAllowingDisabled('*DISABLED_*', DISABLED_TESTS)
428 
429  self.RunAndVerify('*.DISABLED_*', [])
430  self.RunAndVerifyAllowingDisabled('*.DISABLED_*', [
431  'BarTest.DISABLED_TestFour',
432  'BarTest.DISABLED_TestFive',
433  'BazTest.DISABLED_TestC',
434  'DISABLED_FoobarTest.DISABLED_Test2',
435  ])
436 
437  self.RunAndVerify('DISABLED_*', [])
438  self.RunAndVerifyAllowingDisabled('DISABLED_*', [
439  'DISABLED_FoobarTest.Test1',
440  'DISABLED_FoobarTest.DISABLED_Test2',
441  'DISABLED_FoobarbazTest.TestA',
442  ])
443 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testFilterDisabledTests (   self)
Select only the disabled tests to run.

Definition at line 419 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), and gtest_filter_unittest.GTestFilterUnitTest.testFilterDisabledTests().

420  """Select only the disabled tests to run."""
421 
422  self.RunAndVerify('DISABLED_FoobarTest.Test1', [])
423  self.RunAndVerifyAllowingDisabled('DISABLED_FoobarTest.Test1',
424  ['DISABLED_FoobarTest.Test1'])
425 
426  self.RunAndVerify('*DISABLED_*', [])
427  self.RunAndVerifyAllowingDisabled('*DISABLED_*', DISABLED_TESTS)
428 
429  self.RunAndVerify('*.DISABLED_*', [])
430  self.RunAndVerifyAllowingDisabled('*.DISABLED_*', [
431  'BarTest.DISABLED_TestFour',
432  'BarTest.DISABLED_TestFive',
433  'BazTest.DISABLED_TestC',
434  'DISABLED_FoobarTest.DISABLED_Test2',
435  ])
436 
437  self.RunAndVerify('DISABLED_*', [])
438  self.RunAndVerifyAllowingDisabled('DISABLED_*', [
439  'DISABLED_FoobarTest.Test1',
440  'DISABLED_FoobarTest.DISABLED_Test2',
441  'DISABLED_FoobarbazTest.TestA',
442  ])
443 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testFilterDisabledTests (   self)
Select only the disabled tests to run.

Definition at line 419 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), and gtest_filter_unittest.GTestFilterUnitTest.testFilterDisabledTests().

420  """Select only the disabled tests to run."""
421 
422  self.RunAndVerify('DISABLED_FoobarTest.Test1', [])
423  self.RunAndVerifyAllowingDisabled('DISABLED_FoobarTest.Test1',
424  ['DISABLED_FoobarTest.Test1'])
425 
426  self.RunAndVerify('*DISABLED_*', [])
427  self.RunAndVerifyAllowingDisabled('*DISABLED_*', DISABLED_TESTS)
428 
429  self.RunAndVerify('*.DISABLED_*', [])
430  self.RunAndVerifyAllowingDisabled('*.DISABLED_*', [
431  'BarTest.DISABLED_TestFour',
432  'BarTest.DISABLED_TestFive',
433  'BazTest.DISABLED_TestC',
434  'DISABLED_FoobarTest.DISABLED_Test2',
435  ])
436 
437  self.RunAndVerify('DISABLED_*', [])
438  self.RunAndVerifyAllowingDisabled('DISABLED_*', [
439  'DISABLED_FoobarTest.Test1',
440  'DISABLED_FoobarTest.DISABLED_Test2',
441  'DISABLED_FoobarbazTest.TestA',
442  ])
443 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testFilterWithoutDot (   self)
Tests a filter that has no '.' in it.

Definition at line 461 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testFilterWithoutDot().

462  """Tests a filter that has no '.' in it."""
463 
464  self.RunAndVerify('*z*', [
465  'FooTest.Xyz',
466 
467  'BazTest.TestOne',
468  'BazTest.TestA',
469  'BazTest.TestB',
470  ])
471 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testFilterWithoutDot (   self)
Tests a filter that has no '.' in it.

Definition at line 461 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testFilterWithoutDot().

462  """Tests a filter that has no '.' in it."""
463 
464  self.RunAndVerify('*z*', [
465  'FooTest.Xyz',
466 
467  'BazTest.TestOne',
468  'BazTest.TestA',
469  'BazTest.TestB',
470  ])
471 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testFilterWithoutDot (   self)
Tests a filter that has no '.' in it.

Definition at line 461 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testFilterWithoutDot().

462  """Tests a filter that has no '.' in it."""
463 
464  self.RunAndVerify('*z*', [
465  'FooTest.Xyz',
466 
467  'BazTest.TestOne',
468  'BazTest.TestA',
469  'BazTest.TestB',
470  ])
471 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testFlagOverridesEnvVar (   self)
Tests that the filter flag overrides the filtering env. variable.

Definition at line 566 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual(), gtest_filter_unittest.RunAndExtractTestList(), gtest_filter_unittest.SetEnvVar(), and gtest_filter_unittest.GTestFilterUnitTest.testFlagOverridesEnvVar().

567  """Tests that the filter flag overrides the filtering env. variable."""
568 
569  SetEnvVar(FILTER_ENV_VAR, 'Foo*')
570  args = ['--%s=%s' % (FILTER_FLAG, '*One')]
571  tests_run = RunAndExtractTestList(args)[0]
572  SetEnvVar(FILTER_ENV_VAR, None)
573 
574  self.AssertSetEqual(tests_run, ['BarTest.TestOne', 'BazTest.TestOne'])
575 
def RunAndExtractTestList(args=None)
def SetEnvVar(env_var, value)
def gtest_filter_unittest.GTestFilterUnitTest.testFlagOverridesEnvVar (   self)
Tests that the filter flag overrides the filtering env. variable.

Definition at line 566 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual(), gtest_filter_unittest.RunAndExtractTestList(), and gtest_filter_unittest.SetEnvVar().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testFlagOverridesEnvVar().

567  """Tests that the filter flag overrides the filtering env. variable."""
568 
569  SetEnvVar(FILTER_ENV_VAR, 'Foo*')
570  args = ['--%s=%s' % (FILTER_FLAG, '*One')]
571  tests_run = RunAndExtractTestList(args)[0]
572  SetEnvVar(FILTER_ENV_VAR, None)
573 
574  self.AssertSetEqual(tests_run, ['BarTest.TestOne', 'BazTest.TestOne'])
575 
def RunAndExtractTestList(args=None)
def SetEnvVar(env_var, value)
def gtest_filter_unittest.GTestFilterUnitTest.testFlagOverridesEnvVar (   self)
Tests that the filter flag overrides the filtering env. variable.

Definition at line 566 of file gtest_filter_unittest.py.

References gtest_filter_unittest.GTestFilterUnitTest.AssertSetEqual(), gtest_filter_unittest.RunAndExtractTestList(), gtest_filter_unittest.SetEnvVar(), and gtest_filter_unittest.GTestFilterUnitTest.testFlagOverridesEnvVar().

567  """Tests that the filter flag overrides the filtering env. variable."""
568 
569  SetEnvVar(FILTER_ENV_VAR, 'Foo*')
570  args = ['--%s=%s' % (FILTER_FLAG, '*One')]
571  tests_run = RunAndExtractTestList(args)[0]
572  SetEnvVar(FILTER_ENV_VAR, None)
573 
574  self.AssertSetEqual(tests_run, ['BarTest.TestOne', 'BazTest.TestOne'])
575 
def RunAndExtractTestList(args=None)
def SetEnvVar(env_var, value)
def gtest_filter_unittest.GTestFilterUnitTest.testFullName (   self)
Tests filtering by full name.

Definition at line 388 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.GTestFilterUnitTest.testFullName().

388  def testFullName(self):
389  """Tests filtering by full name."""
390 
391  self.RunAndVerify('FooTest.Xyz', ['FooTest.Xyz'])
392  self.RunAndVerifyAllowingDisabled('FooTest.Xyz', ['FooTest.Xyz'])
393  self.RunAndVerifyWithSharding('FooTest.Xyz', 5, ['FooTest.Xyz'])
394 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testFullName (   self)
Tests filtering by full name.

Definition at line 388 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.GTestFilterUnitTest.testFullName().

388  def testFullName(self):
389  """Tests filtering by full name."""
390 
391  self.RunAndVerify('FooTest.Xyz', ['FooTest.Xyz'])
392  self.RunAndVerifyAllowingDisabled('FooTest.Xyz', ['FooTest.Xyz'])
393  self.RunAndVerifyWithSharding('FooTest.Xyz', 5, ['FooTest.Xyz'])
394 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testFullName (   self)
Tests filtering by full name.

Definition at line 388 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testFullName().

388  def testFullName(self):
389  """Tests filtering by full name."""
390 
391  self.RunAndVerify('FooTest.Xyz', ['FooTest.Xyz'])
392  self.RunAndVerifyAllowingDisabled('FooTest.Xyz', ['FooTest.Xyz'])
393  self.RunAndVerifyWithSharding('FooTest.Xyz', 5, ['FooTest.Xyz'])
394 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testNegativeFilters (   self)

Definition at line 514 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testNegativeFilters().

515  self.RunAndVerify('*-BazTest.TestOne', [
516  'FooTest.Abc',
517  'FooTest.Xyz',
518 
519  'BarTest.TestOne',
520  'BarTest.TestTwo',
521  'BarTest.TestThree',
522 
523  'BazTest.TestA',
524  'BazTest.TestB',
525  ] + DEATH_TESTS + PARAM_TESTS)
526 
527  self.RunAndVerify('*-FooTest.Abc:BazTest.*', [
528  'FooTest.Xyz',
529 
530  'BarTest.TestOne',
531  'BarTest.TestTwo',
532  'BarTest.TestThree',
533  ] + DEATH_TESTS + PARAM_TESTS)
534 
535  self.RunAndVerify('BarTest.*-BarTest.TestOne', [
536  'BarTest.TestTwo',
537  'BarTest.TestThree',
538  ])
539 
540  # Tests without leading '*'.
541  self.RunAndVerify('-FooTest.Abc:FooTest.Xyz:BazTest.*', [
542  'BarTest.TestOne',
543  'BarTest.TestTwo',
544  'BarTest.TestThree',
545  ] + DEATH_TESTS + PARAM_TESTS)
546 
547  # Value parameterized tests.
548  self.RunAndVerify('*/*', PARAM_TESTS)
549 
550  # Value parameterized tests filtering by the sequence name.
551  self.RunAndVerify('SeqP/*', [
552  'SeqP/ParamTest.TestX/0',
553  'SeqP/ParamTest.TestX/1',
554  'SeqP/ParamTest.TestY/0',
555  'SeqP/ParamTest.TestY/1',
556  ])
557 
558  # Value parameterized tests filtering by the test name.
559  self.RunAndVerify('*/0', [
560  'SeqP/ParamTest.TestX/0',
561  'SeqP/ParamTest.TestY/0',
562  'SeqQ/ParamTest.TestX/0',
563  'SeqQ/ParamTest.TestY/0',
564  ])
565 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testNegativeFilters (   self)

Definition at line 514 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testNegativeFilters().

515  self.RunAndVerify('*-BazTest.TestOne', [
516  'FooTest.Abc',
517  'FooTest.Xyz',
518 
519  'BarTest.TestOne',
520  'BarTest.TestTwo',
521  'BarTest.TestThree',
522 
523  'BazTest.TestA',
524  'BazTest.TestB',
525  ] + DEATH_TESTS + PARAM_TESTS)
526 
527  self.RunAndVerify('*-FooTest.Abc:BazTest.*', [
528  'FooTest.Xyz',
529 
530  'BarTest.TestOne',
531  'BarTest.TestTwo',
532  'BarTest.TestThree',
533  ] + DEATH_TESTS + PARAM_TESTS)
534 
535  self.RunAndVerify('BarTest.*-BarTest.TestOne', [
536  'BarTest.TestTwo',
537  'BarTest.TestThree',
538  ])
539 
540  # Tests without leading '*'.
541  self.RunAndVerify('-FooTest.Abc:FooTest.Xyz:BazTest.*', [
542  'BarTest.TestOne',
543  'BarTest.TestTwo',
544  'BarTest.TestThree',
545  ] + DEATH_TESTS + PARAM_TESTS)
546 
547  # Value parameterized tests.
548  self.RunAndVerify('*/*', PARAM_TESTS)
549 
550  # Value parameterized tests filtering by the sequence name.
551  self.RunAndVerify('SeqP/*', [
552  'SeqP/ParamTest.TestX/0',
553  'SeqP/ParamTest.TestX/1',
554  'SeqP/ParamTest.TestY/0',
555  'SeqP/ParamTest.TestY/1',
556  ])
557 
558  # Value parameterized tests filtering by the test name.
559  self.RunAndVerify('*/0', [
560  'SeqP/ParamTest.TestX/0',
561  'SeqP/ParamTest.TestY/0',
562  'SeqQ/ParamTest.TestX/0',
563  'SeqQ/ParamTest.TestY/0',
564  ])
565 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testNegativeFilters (   self)

Definition at line 514 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testNegativeFilters().

515  self.RunAndVerify('*-BazTest.TestOne', [
516  'FooTest.Abc',
517  'FooTest.Xyz',
518 
519  'BarTest.TestOne',
520  'BarTest.TestTwo',
521  'BarTest.TestThree',
522 
523  'BazTest.TestA',
524  'BazTest.TestB',
525  ] + DEATH_TESTS + PARAM_TESTS)
526 
527  self.RunAndVerify('*-FooTest.Abc:BazTest.*', [
528  'FooTest.Xyz',
529 
530  'BarTest.TestOne',
531  'BarTest.TestTwo',
532  'BarTest.TestThree',
533  ] + DEATH_TESTS + PARAM_TESTS)
534 
535  self.RunAndVerify('BarTest.*-BarTest.TestOne', [
536  'BarTest.TestTwo',
537  'BarTest.TestThree',
538  ])
539 
540  # Tests without leading '*'.
541  self.RunAndVerify('-FooTest.Abc:FooTest.Xyz:BazTest.*', [
542  'BarTest.TestOne',
543  'BarTest.TestTwo',
544  'BarTest.TestThree',
545  ] + DEATH_TESTS + PARAM_TESTS)
546 
547  # Value parameterized tests.
548  self.RunAndVerify('*/*', PARAM_TESTS)
549 
550  # Value parameterized tests filtering by the sequence name.
551  self.RunAndVerify('SeqP/*', [
552  'SeqP/ParamTest.TestX/0',
553  'SeqP/ParamTest.TestX/1',
554  'SeqP/ParamTest.TestY/0',
555  'SeqP/ParamTest.TestY/1',
556  ])
557 
558  # Value parameterized tests filtering by the test name.
559  self.RunAndVerify('*/0', [
560  'SeqP/ParamTest.TestX/0',
561  'SeqP/ParamTest.TestY/0',
562  'SeqQ/ParamTest.TestX/0',
563  'SeqQ/ParamTest.TestY/0',
564  ])
565 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testShardingWorksWithDeathTests (   self)
Tests integration with death tests and sharding.

Definition at line 614 of file gtest_filter_unittest.py.

References gtest_test_utils.Main(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.GTestFilterUnitTest.testShardingWorksWithDeathTests().

615  """Tests integration with death tests and sharding."""
616 
617  gtest_filter = 'HasDeathTest.*:SeqP/*'
618  expected_tests = [
619  'HasDeathTest.Test1',
620  'HasDeathTest.Test2',
621 
622  'SeqP/ParamTest.TestX/0',
623  'SeqP/ParamTest.TestX/1',
624  'SeqP/ParamTest.TestY/0',
625  'SeqP/ParamTest.TestY/1',
626  ]
627 
628  for flag in ['--gtest_death_test_style=threadsafe',
629  '--gtest_death_test_style=fast']:
630  self.RunAndVerifyWithSharding(gtest_filter, 3, expected_tests,
631  check_exit_0=True, args=[flag])
632  self.RunAndVerifyWithSharding(gtest_filter, 5, expected_tests,
633  check_exit_0=True, args=[flag])
634 
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testShardingWorksWithDeathTests (   self)
Tests integration with death tests and sharding.

Definition at line 614 of file gtest_filter_unittest.py.

References gtest_test_utils.Main(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testShardingWorksWithDeathTests().

615  """Tests integration with death tests and sharding."""
616 
617  gtest_filter = 'HasDeathTest.*:SeqP/*'
618  expected_tests = [
619  'HasDeathTest.Test1',
620  'HasDeathTest.Test2',
621 
622  'SeqP/ParamTest.TestX/0',
623  'SeqP/ParamTest.TestX/1',
624  'SeqP/ParamTest.TestY/0',
625  'SeqP/ParamTest.TestY/1',
626  ]
627 
628  for flag in ['--gtest_death_test_style=threadsafe',
629  '--gtest_death_test_style=fast']:
630  self.RunAndVerifyWithSharding(gtest_filter, 3, expected_tests,
631  check_exit_0=True, args=[flag])
632  self.RunAndVerifyWithSharding(gtest_filter, 5, expected_tests,
633  check_exit_0=True, args=[flag])
634 
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testShardingWorksWithDeathTests (   self)
Tests integration with death tests and sharding.

Definition at line 614 of file gtest_filter_unittest.py.

References gtest_test_utils.Main(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.GTestFilterUnitTest.testShardingWorksWithDeathTests().

615  """Tests integration with death tests and sharding."""
616 
617  gtest_filter = 'HasDeathTest.*:SeqP/*'
618  expected_tests = [
619  'HasDeathTest.Test1',
620  'HasDeathTest.Test2',
621 
622  'SeqP/ParamTest.TestX/0',
623  'SeqP/ParamTest.TestX/1',
624  'SeqP/ParamTest.TestY/0',
625  'SeqP/ParamTest.TestY/1',
626  ]
627 
628  for flag in ['--gtest_death_test_style=threadsafe',
629  '--gtest_death_test_style=fast']:
630  self.RunAndVerifyWithSharding(gtest_filter, 3, expected_tests,
631  check_exit_0=True, args=[flag])
632  self.RunAndVerifyWithSharding(gtest_filter, 5, expected_tests,
633  check_exit_0=True, args=[flag])
634 
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testShardStatusFileIsCreated (   self)
Tests that the shard file is created if specified in the environment.

Definition at line 576 of file gtest_filter_unittest.py.

References gtest_test_utils.GetTempDir(), and gtest_filter_unittest.InvokeWithModifiedEnv().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testShardStatusFileIsCreated().

577  """Tests that the shard file is created if specified in the environment."""
578 
579  shard_status_file = os.path.join(gtest_test_utils.GetTempDir(),
580  'shard_status_file')
581  self.assert_(not os.path.exists(shard_status_file))
582 
583  extra_env = {SHARD_STATUS_FILE_ENV_VAR: shard_status_file}
584  try:
585  InvokeWithModifiedEnv(extra_env, RunAndReturnOutput)
586  finally:
587  self.assert_(os.path.exists(shard_status_file))
588  os.remove(shard_status_file)
589 
def InvokeWithModifiedEnv(extra_env, function, args, kwargs)
def gtest_filter_unittest.GTestFilterUnitTest.testShardStatusFileIsCreated (   self)
Tests that the shard file is created if specified in the environment.

Definition at line 576 of file gtest_filter_unittest.py.

References gtest_test_utils.GetTempDir(), gtest_filter_unittest.InvokeWithModifiedEnv(), and gtest_filter_unittest.GTestFilterUnitTest.testShardStatusFileIsCreated().

577  """Tests that the shard file is created if specified in the environment."""
578 
579  shard_status_file = os.path.join(gtest_test_utils.GetTempDir(),
580  'shard_status_file')
581  self.assert_(not os.path.exists(shard_status_file))
582 
583  extra_env = {SHARD_STATUS_FILE_ENV_VAR: shard_status_file}
584  try:
585  InvokeWithModifiedEnv(extra_env, RunAndReturnOutput)
586  finally:
587  self.assert_(os.path.exists(shard_status_file))
588  os.remove(shard_status_file)
589 
def InvokeWithModifiedEnv(extra_env, function, args, kwargs)
def gtest_filter_unittest.GTestFilterUnitTest.testShardStatusFileIsCreated (   self)
Tests that the shard file is created if specified in the environment.

Definition at line 576 of file gtest_filter_unittest.py.

References gtest_test_utils.GetTempDir(), gtest_filter_unittest.InvokeWithModifiedEnv(), and gtest_filter_unittest.GTestFilterUnitTest.testShardStatusFileIsCreated().

577  """Tests that the shard file is created if specified in the environment."""
578 
579  shard_status_file = os.path.join(gtest_test_utils.GetTempDir(),
580  'shard_status_file')
581  self.assert_(not os.path.exists(shard_status_file))
582 
583  extra_env = {SHARD_STATUS_FILE_ENV_VAR: shard_status_file}
584  try:
585  InvokeWithModifiedEnv(extra_env, RunAndReturnOutput)
586  finally:
587  self.assert_(os.path.exists(shard_status_file))
588  os.remove(shard_status_file)
589 
def InvokeWithModifiedEnv(extra_env, function, args, kwargs)
def gtest_filter_unittest.GTestFilterUnitTest.testShardStatusFileIsCreatedWithListTests (   self)
Tests that the shard file is created with the "list_tests" flag.

Definition at line 590 of file gtest_filter_unittest.py.

References gtest_test_utils.GetTempDir(), and gtest_filter_unittest.InvokeWithModifiedEnv().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testShardStatusFileIsCreatedWithListTests().

591  """Tests that the shard file is created with the "list_tests" flag."""
592 
593  shard_status_file = os.path.join(gtest_test_utils.GetTempDir(),
594  'shard_status_file2')
595  self.assert_(not os.path.exists(shard_status_file))
596 
597  extra_env = {SHARD_STATUS_FILE_ENV_VAR: shard_status_file}
598  try:
599  output = InvokeWithModifiedEnv(extra_env,
600  RunAndReturnOutput,
601  [LIST_TESTS_FLAG])
602  finally:
603  # This assertion ensures that Google Test enumerated the tests as
604  # opposed to running them.
605  self.assert_('[==========]' not in output,
606  'Unexpected output during test enumeration.\n'
607  'Please ensure that LIST_TESTS_FLAG is assigned the\n'
608  'correct flag value for listing Google Test tests.')
609 
610  self.assert_(os.path.exists(shard_status_file))
611  os.remove(shard_status_file)
612 
def InvokeWithModifiedEnv(extra_env, function, args, kwargs)
def gtest_filter_unittest.GTestFilterUnitTest.testShardStatusFileIsCreatedWithListTests (   self)
Tests that the shard file is created with the "list_tests" flag.

Definition at line 590 of file gtest_filter_unittest.py.

References gtest_test_utils.GetTempDir(), gtest_filter_unittest.InvokeWithModifiedEnv(), and gtest_filter_unittest.GTestFilterUnitTest.testShardStatusFileIsCreatedWithListTests().

591  """Tests that the shard file is created with the "list_tests" flag."""
592 
593  shard_status_file = os.path.join(gtest_test_utils.GetTempDir(),
594  'shard_status_file2')
595  self.assert_(not os.path.exists(shard_status_file))
596 
597  extra_env = {SHARD_STATUS_FILE_ENV_VAR: shard_status_file}
598  try:
599  output = InvokeWithModifiedEnv(extra_env,
600  RunAndReturnOutput,
601  [LIST_TESTS_FLAG])
602  finally:
603  # This assertion ensures that Google Test enumerated the tests as
604  # opposed to running them.
605  self.assert_('[==========]' not in output,
606  'Unexpected output during test enumeration.\n'
607  'Please ensure that LIST_TESTS_FLAG is assigned the\n'
608  'correct flag value for listing Google Test tests.')
609 
610  self.assert_(os.path.exists(shard_status_file))
611  os.remove(shard_status_file)
612 
def InvokeWithModifiedEnv(extra_env, function, args, kwargs)
def gtest_filter_unittest.GTestFilterUnitTest.testShardStatusFileIsCreatedWithListTests (   self)
Tests that the shard file is created with the "list_tests" flag.

Definition at line 590 of file gtest_filter_unittest.py.

References gtest_test_utils.GetTempDir(), gtest_filter_unittest.InvokeWithModifiedEnv(), and gtest_filter_unittest.GTestFilterUnitTest.testShardStatusFileIsCreatedWithListTests().

591  """Tests that the shard file is created with the "list_tests" flag."""
592 
593  shard_status_file = os.path.join(gtest_test_utils.GetTempDir(),
594  'shard_status_file2')
595  self.assert_(not os.path.exists(shard_status_file))
596 
597  extra_env = {SHARD_STATUS_FILE_ENV_VAR: shard_status_file}
598  try:
599  output = InvokeWithModifiedEnv(extra_env,
600  RunAndReturnOutput,
601  [LIST_TESTS_FLAG])
602  finally:
603  # This assertion ensures that Google Test enumerated the tests as
604  # opposed to running them.
605  self.assert_('[==========]' not in output,
606  'Unexpected output during test enumeration.\n'
607  'Please ensure that LIST_TESTS_FLAG is assigned the\n'
608  'correct flag value for listing Google Test tests.')
609 
610  self.assert_(os.path.exists(shard_status_file))
611  os.remove(shard_status_file)
612 
def InvokeWithModifiedEnv(extra_env, function, args, kwargs)
def gtest_filter_unittest.GTestFilterUnitTest.testThreePatterns (   self)
Tests filters that consist of three patterns.

Definition at line 485 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testThreePatterns().

485  def testThreePatterns(self):
486  """Tests filters that consist of three patterns."""
487 
488  self.RunAndVerify('*oo*:*A*:*One', [
489  'FooTest.Abc',
490  'FooTest.Xyz',
491 
492  'BarTest.TestOne',
493 
494  'BazTest.TestOne',
495  'BazTest.TestA',
496  ])
497 
498  # The 2nd pattern is empty.
499  self.RunAndVerify('*oo*::*One', [
500  'FooTest.Abc',
501  'FooTest.Xyz',
502 
503  'BarTest.TestOne',
504 
505  'BazTest.TestOne',
506  ])
507 
508  # The last 2 patterns are empty.
509  self.RunAndVerify('*oo*::', [
510  'FooTest.Abc',
511  'FooTest.Xyz',
512  ])
513 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testThreePatterns (   self)
Tests filters that consist of three patterns.

Definition at line 485 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testThreePatterns().

485  def testThreePatterns(self):
486  """Tests filters that consist of three patterns."""
487 
488  self.RunAndVerify('*oo*:*A*:*One', [
489  'FooTest.Abc',
490  'FooTest.Xyz',
491 
492  'BarTest.TestOne',
493 
494  'BazTest.TestOne',
495  'BazTest.TestA',
496  ])
497 
498  # The 2nd pattern is empty.
499  self.RunAndVerify('*oo*::*One', [
500  'FooTest.Abc',
501  'FooTest.Xyz',
502 
503  'BarTest.TestOne',
504 
505  'BazTest.TestOne',
506  ])
507 
508  # The last 2 patterns are empty.
509  self.RunAndVerify('*oo*::', [
510  'FooTest.Abc',
511  'FooTest.Xyz',
512  ])
513 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testThreePatterns (   self)
Tests filters that consist of three patterns.

Definition at line 485 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testThreePatterns().

485  def testThreePatterns(self):
486  """Tests filters that consist of three patterns."""
487 
488  self.RunAndVerify('*oo*:*A*:*One', [
489  'FooTest.Abc',
490  'FooTest.Xyz',
491 
492  'BarTest.TestOne',
493 
494  'BazTest.TestOne',
495  'BazTest.TestA',
496  ])
497 
498  # The 2nd pattern is empty.
499  self.RunAndVerify('*oo*::*One', [
500  'FooTest.Abc',
501  'FooTest.Xyz',
502 
503  'BarTest.TestOne',
504 
505  'BazTest.TestOne',
506  ])
507 
508  # The last 2 patterns are empty.
509  self.RunAndVerify('*oo*::', [
510  'FooTest.Abc',
511  'FooTest.Xyz',
512  ])
513 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testTwoPatterns (   self)
Tests filters that consist of two patterns.

Definition at line 472 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testTwoPatterns().

472  def testTwoPatterns(self):
473  """Tests filters that consist of two patterns."""
474 
475  self.RunAndVerify('Foo*.*:*A*', [
476  'FooTest.Abc',
477  'FooTest.Xyz',
478 
479  'BazTest.TestA',
480  ])
481 
482  # An empty pattern + a non-empty one
483  self.RunAndVerify(':*A*', ['FooTest.Abc', 'BazTest.TestA'])
484 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testTwoPatterns (   self)
Tests filters that consist of two patterns.

Definition at line 472 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testTwoPatterns().

472  def testTwoPatterns(self):
473  """Tests filters that consist of two patterns."""
474 
475  self.RunAndVerify('Foo*.*:*A*', [
476  'FooTest.Abc',
477  'FooTest.Xyz',
478 
479  'BazTest.TestA',
480  ])
481 
482  # An empty pattern + a non-empty one
483  self.RunAndVerify(':*A*', ['FooTest.Abc', 'BazTest.TestA'])
484 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testTwoPatterns (   self)
Tests filters that consist of two patterns.

Definition at line 472 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testTwoPatterns().

472  def testTwoPatterns(self):
473  """Tests filters that consist of two patterns."""
474 
475  self.RunAndVerify('Foo*.*:*A*', [
476  'FooTest.Abc',
477  'FooTest.Xyz',
478 
479  'BazTest.TestA',
480  ])
481 
482  # An empty pattern + a non-empty one
483  self.RunAndVerify(':*A*', ['FooTest.Abc', 'BazTest.TestA'])
484 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testUniversalFilters (   self)
Tests filters that match everything.

Definition at line 395 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.GTestFilterUnitTest.testUniversalFilters().

396  """Tests filters that match everything."""
397 
398  self.RunAndVerify('*', ACTIVE_TESTS)
399  self.RunAndVerify('*.*', ACTIVE_TESTS)
400  self.RunAndVerifyWithSharding('*.*', len(ACTIVE_TESTS) - 3, ACTIVE_TESTS)
401  self.RunAndVerifyAllowingDisabled('*', ACTIVE_TESTS + DISABLED_TESTS)
402  self.RunAndVerifyAllowingDisabled('*.*', ACTIVE_TESTS + DISABLED_TESTS)
403 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testUniversalFilters (   self)
Tests filters that match everything.

Definition at line 395 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding(), and gtest_filter_unittest.GTestFilterUnitTest.testUniversalFilters().

396  """Tests filters that match everything."""
397 
398  self.RunAndVerify('*', ACTIVE_TESTS)
399  self.RunAndVerify('*.*', ACTIVE_TESTS)
400  self.RunAndVerifyWithSharding('*.*', len(ACTIVE_TESTS) - 3, ACTIVE_TESTS)
401  self.RunAndVerifyAllowingDisabled('*', ACTIVE_TESTS + DISABLED_TESTS)
402  self.RunAndVerifyAllowingDisabled('*.*', ACTIVE_TESTS + DISABLED_TESTS)
403 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testUniversalFilters (   self)
Tests filters that match everything.

Definition at line 395 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyAllowingDisabled(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerifyWithSharding().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testUniversalFilters().

396  """Tests filters that match everything."""
397 
398  self.RunAndVerify('*', ACTIVE_TESTS)
399  self.RunAndVerify('*.*', ACTIVE_TESTS)
400  self.RunAndVerifyWithSharding('*.*', len(ACTIVE_TESTS) - 3, ACTIVE_TESTS)
401  self.RunAndVerifyAllowingDisabled('*', ACTIVE_TESTS + DISABLED_TESTS)
402  self.RunAndVerifyAllowingDisabled('*.*', ACTIVE_TESTS + DISABLED_TESTS)
403 
def RunAndVerify(self, gtest_filter, tests_to_run)
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run)
def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run, args=None, check_exit_0=False)
def gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestCaseName (   self)
Tests using wildcard in the test case name.

Definition at line 444 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestCaseName().

445  """Tests using wildcard in the test case name."""
446 
447  self.RunAndVerify('*a*.*', [
448  'BarTest.TestOne',
449  'BarTest.TestTwo',
450  'BarTest.TestThree',
451 
452  'BazTest.TestOne',
453  'BazTest.TestA',
454  'BazTest.TestB', ] + DEATH_TESTS + PARAM_TESTS)
455 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestCaseName (   self)
Tests using wildcard in the test case name.

Definition at line 444 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestCaseName().

445  """Tests using wildcard in the test case name."""
446 
447  self.RunAndVerify('*a*.*', [
448  'BarTest.TestOne',
449  'BarTest.TestTwo',
450  'BarTest.TestThree',
451 
452  'BazTest.TestOne',
453  'BazTest.TestA',
454  'BazTest.TestB', ] + DEATH_TESTS + PARAM_TESTS)
455 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestCaseName (   self)
Tests using wildcard in the test case name.

Definition at line 444 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestCaseName().

445  """Tests using wildcard in the test case name."""
446 
447  self.RunAndVerify('*a*.*', [
448  'BarTest.TestOne',
449  'BarTest.TestTwo',
450  'BarTest.TestThree',
451 
452  'BazTest.TestOne',
453  'BazTest.TestA',
454  'BazTest.TestB', ] + DEATH_TESTS + PARAM_TESTS)
455 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestName (   self)
Tests using wildcard in the test name.

Definition at line 456 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestName().

457  """Tests using wildcard in the test name."""
458 
459  self.RunAndVerify('*.*A*', ['FooTest.Abc', 'BazTest.TestA'])
460 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestName (   self)
Tests using wildcard in the test name.

Definition at line 456 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify().

Referenced by gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestName().

457  """Tests using wildcard in the test name."""
458 
459  self.RunAndVerify('*.*A*', ['FooTest.Abc', 'BazTest.TestA'])
460 
def RunAndVerify(self, gtest_filter, tests_to_run)
def gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestName (   self)
Tests using wildcard in the test name.

Definition at line 456 of file gtest_filter_unittest.py.

References gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest.RunAndVerify(), gtest_filter_unittest.GTestFilterUnitTest.RunAndVerify(), and gtest_filter_unittest.GTestFilterUnitTest.testWildcardInTestName().

457  """Tests using wildcard in the test name."""
458 
459  self.RunAndVerify('*.*A*', ['FooTest.Abc', 'BazTest.TestA'])
460 
def RunAndVerify(self, gtest_filter, tests_to_run)

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