diff options
author | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2010-09-14 05:38:21 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2010-09-14 05:38:21 +0000 |
commit | 53e08c44dd34857ba57581d7c5774d6c96a8d0e1 (patch) | |
tree | 8aee751ab6c88f64cbc2ea4de63e80a6f955fc9e /scripts | |
parent | ad7c462be7ea6041419426f98b5653bd98ad14dc (diff) | |
download | googletest-53e08c44dd34857ba57581d7c5774d6c96a8d0e1.tar.gz googletest-53e08c44dd34857ba57581d7c5774d6c96a8d0e1.tar.bz2 googletest-53e08c44dd34857ba57581d7c5774d6c96a8d0e1.zip |
Include gtest and gmock headers as user headers instead of system headers.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/fuse_gmock_files.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/scripts/fuse_gmock_files.py b/scripts/fuse_gmock_files.py index 4e892e9a..fc0baf79 100755 --- a/scripts/fuse_gmock_files.py +++ b/scripts/fuse_gmock_files.py @@ -75,8 +75,8 @@ sys.path.append(os.path.join(DEFAULT_GMOCK_ROOT_DIR, 'gtest/scripts')) import fuse_gtest_files gtest = fuse_gtest_files -# Regex for matching '#include <gmock/...>'. -INCLUDE_GMOCK_FILE_REGEX = re.compile(r'^\s*#\s*include\s*<(gmock/.+)>') +# Regex for matching '#include "gmock/..."'. +INCLUDE_GMOCK_FILE_REGEX = re.compile(r'^\s*#\s*include\s*"(gmock/.+)"') # Where to find the source seed files. GMOCK_H_SEED = 'include/gmock/gmock.h' @@ -135,19 +135,19 @@ def FuseGMockH(gmock_root, output_dir): for line in file(os.path.join(gmock_root, gmock_header_path), 'r'): m = INCLUDE_GMOCK_FILE_REGEX.match(line) if m: - # It's '#include <gmock/...>' - let's process it recursively. + # It's '#include "gmock/..."' - let's process it recursively. ProcessFile('include/' + m.group(1)) else: m = gtest.INCLUDE_GTEST_FILE_REGEX.match(line) if m: - # It's '#include <gtest/foo.h>'. We translate it to - # <gtest/gtest.h>, regardless of what foo is, since all + # It's '#include "gtest/foo.h"'. We translate it to + # "gtest/gtest.h", regardless of what foo is, since all # gtest headers are fused into gtest/gtest.h. # There is no need to #include gtest.h twice. if not gtest.GTEST_H_SEED in processed_files: processed_files.add(gtest.GTEST_H_SEED) - output_file.write('#include <%s>\n' % (gtest.GTEST_H_OUTPUT,)) + output_file.write('#include "%s"\n' % (gtest.GTEST_H_OUTPUT,)) else: # Otherwise we copy the line unchanged to the output file. output_file.write(line) @@ -174,18 +174,18 @@ def FuseGMockAllCcToFile(gmock_root, output_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 + # 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. + # 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,)) + output_file.write('#include "%s"\n' % (GMOCK_H_OUTPUT,)) else: m = gtest.INCLUDE_GTEST_FILE_REGEX.match(line) if m: - # It's '#include <gtest/...>'. + # It's '#include "gtest/..."'. # There is no need to #include gtest.h as it has been # #included by gtest-all.cc. pass |