]> git-server-git.apps.pok.os.sepia.ceph.com Git - googletest.git/commitdiff
Googletest export
authorAbseil Team <absl-team@google.com>
Thu, 15 Oct 2020 21:14:57 +0000 (17:14 -0400)
committerDerek Mauro <dmauro@google.com>
Mon, 19 Oct 2020 18:01:26 +0000 (14:01 -0400)
Fix some issues when running fuse_gmock_files.

The module path should be updated before importing `fuse_gtest_files`, since
the script may not run from the googletest repo root. We also need a non-frozen
set in order to track progress.

PiperOrigin-RevId: 337380466

googlemock/scripts/fuse_gmock_files.py

index 0c5bb9f48c9ce7d25523a9477f8f893d4faa6aee..c3ba3b833796330b11b5a99fac532f8ade69967b 100755 (executable)
@@ -66,8 +66,6 @@ import os
 import re
 import sys
 
-import fuse_gtest_files
-
 __author__ = 'wan@google.com (Zhanyong Wan)'
 
 # We assume that this file is in the scripts/ directory in the Google
@@ -76,7 +74,7 @@ DEFAULT_GMOCK_ROOT_DIR = os.path.join(os.path.dirname(__file__), '..')
 
 # We need to call into googletest/scripts/fuse_gtest_files.py.
 sys.path.append(os.path.join(DEFAULT_GMOCK_ROOT_DIR, '../googletest/scripts'))
-gtest = fuse_gtest_files
+import fuse_gtest_files as gtest  # pylint:disable=g-import-not-at-top
 
 # Regex for matching
 # '#include "gmock/..."'.
@@ -130,7 +128,7 @@ def FuseGMockH(gmock_root, output_dir):
   """Scans folder gmock_root to generate gmock/gmock.h in output_dir."""
 
   output_file = open(os.path.join(output_dir, GMOCK_H_OUTPUT), 'w')
-  processed_files = frozenset()  # Holds all gmock headers we've processed.
+  processed_files = set()  # Holds all gmock headers we've processed.
 
   def ProcessFile(gmock_header_path):
     """Processes the given gmock header file."""
@@ -173,7 +171,7 @@ def FuseGMockH(gmock_root, output_dir):
 def FuseGMockAllCcToFile(gmock_root, output_file):
   """Scans folder gmock_root to fuse gmock-all.cc into output_file."""
 
-  processed_files = frozenset()
+  processed_files = set()
 
   def ProcessFile(gmock_source_file):
     """Processes the given gmock source file."""