INNER CODE UNIT · Python

ProcessFile

Squirrel-Engine/Squirrel-Engine · googletest/googlemock/scripts/fuse_gmock_files.py:164

  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.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…