INNER CODE UNIT · Python

ProcessFile

sweeneychris/TheiaSfM · libraries/gtest/scripts/fuse_gtest_files.py:155

  def ProcessFile(gtest_header_path):
    """Processes the given gtest header file."""

    # We don't process the same header twice.
    if gtest_header_path in processed_files:
      return

    processed_files.add(gtest_header_path)

    # Reads each line in the given gtest header.
    for line in open(os.path.join(gtest_root, gtest_header_path), 'r'):
      m = INCLUDE_GTEST_FILE_REGEX.match(line)
      if m:
        # It's '#include "gtest/..."' - let's process it recursively.
        ProcessFile('include/' + m.group(1))
      else:
        # Otherwise we copy the line unchanged to the output file.
        output_file.write(line)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…