class_docstr: Tests the env variable or the command line flag to filter tests.
docstr: Checks that binary runs correct tests for the given filter and shard.
  
  Runs all shards of googletest-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.
  If check_exit_0, .
  
  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.
docstr_tok: ["Checks","that","binary","runs","correct","tests","for","the","given","filter","and","shard",".","Runs","all","shards","of","googletest-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",".","If","check_exit_0",",",".","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","."]
code: def 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 googletest-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.
      If check_exit_0, .
  
      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.
      """
  
      tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
  
      # Windows removes empty variables from the environment when passing it
      # to a new process.  This means it is impossible to pass an empty filter
      # into a process using the environment variable.  However, we can still
      # test the case when the variable is not supplied (i.e., gtest_filter is
      # None).
      # pylint: disable-msg=C6403
      if CAN_TEST_EMPTY_FILTER or gtest_filter != "":
          SetEnvVar(FILTER_ENV_VAR, gtest_filter)
          partition = []
          for i in range(0, total_shards):
              (tests_run, exit_code) = RunWithSharding(
                  total_shards, i, args
              )
              if check_exit_0:
                  self.assertEqual(0, exit_code)
              partition.append(tests_run)
  
          self.AssertPartitionIsValid(tests_to_run, partition)
          SetEnvVar(FILTER_ENV_VAR, None)
  
imports: import os
  import re
  import sys
  from googletest.test import gtest_test_utils
label_desc: Use image node_id 5 for calling the GTestFilterUnitTest obj's underlying member method code with example usage: obj.RunAndVerifyWithSharding(gtest_filter, total_shards, tests_to_run, args, check_exit_0) without return types