parameters: (gmock_root, output_file)
docstring: Scans folder gmock_root to fuse gmock-all.cc into output_file.
docstring_summary: Scans folder gmock_root to fuse gmock-all.cc into output_file.
docstring_tokens: Scans folder gmock_root to fuse gmock - all . cc into output_file .
function: def FuseGMockAllCcToFile(gmock_root, output_file):
    """Scans folder gmock_root to fuse gmock-all.cc into output_file."""
  
    processed_files = sets.Set()
  
    def ProcessFile(gmock_source_file):
      """Processes the given gmock source file."""
  
      # We don't process the same #included file twice.
      if gmock_source_file in processed_files:
        return
  
      processed_files.add(gmock_source_file)
  
      # Reads each line in the given gmock source file.
      for line in file(os.path.join(gmock_root, gmock_source_file), 'r'):
        m = INCLUDE_GMOCK_FILE_REGEX.match(line)
        if m:
          # It's '#include "gmock/foo.h"'.  We treat it as '#include
          # "gmock/gmock.h"', as all other gmock headers are being fused
          # into gmock.h and cannot be #included directly.
  
          # There is no need to #include "gmock/gmock.h" more than once.
          if not GMOCK_H_SEED in processed_files:
            processed_files.add(GMOCK_H_SEED)
            output_file.write('#include "%s"\n' % (GMOCK_H_OUTPUT,))
        else:
          m = gtest.INCLUDE_GTEST_FILE_REGEX.match(line)
          if m:
            # It's '#include "gtest/..."'.
            # There is no need to #include gtest.h as it has been
            # #included by gtest-all.cc.
            pass
          else:
            m = gtest.INCLUDE_SRC_FILE_REGEX.match(line)
            if m:
              # It's '#include "src/foo"' - let's process it recursively.
              ProcessFile(m.group(1))
            else:
              # Otherwise we copy the line unchanged to the output file.
              output_file.write(line)
  
    ProcessFile(GMOCK_ALL_CC_SEED)
function_tokens: def FuseGMockAllCcToFile ( gmock_root , output_file ) : processed_files = sets . Set ( ) def ProcessFile ( gmock_source_file ) : """Processes the given gmock source file.""" # We don't process the same #included file twice. if gmock_source_file in processed_files : return processed_files . add ( gmock_source_file ) # Reads each line in the given gmock source file. for line in file ( os . path . join ( gmock_root , gmock_source_file ) , 'r' ) : m = INCLUDE_GMOCK_FILE_REGEX . match ( line ) if m : # It's '#include "gmock/foo.h"'.  We treat it as '#include # "gmock/gmock.h"', as all other gmock headers are being fused # into gmock.h and cannot be #included directly. # There is no need to #include "gmock/gmock.h" more than once. if not GMOCK_H_SEED in processed_files : processed_files . add ( GMOCK_H_SEED ) output_file . write ( '#include "%s"\n' % ( GMOCK_H_OUTPUT , ) ) else : m = gtest . INCLUDE_GTEST_FILE_REGEX . match ( line ) if m : # It's '#include "gtest/..."'. # There is no need to #include gtest.h as it has been # #included by gtest-all.cc. pass else : m = gtest . INCLUDE_SRC_FILE_REGEX . match ( line ) if m : # It's '#include "src/foo"' - let's process it recursively. ProcessFile ( m . group ( 1 ) ) else : # Otherwise we copy the line unchanged to the output file. output_file . write ( line ) ProcessFile ( GMOCK_ALL_CC_SEED )