Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
6044c267
Commit
6044c267
authored
May 30, 2019
by
Kalon Mills
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fuse gtest-spi.h into the resulting header.
Previously this was fused into the source file, but this prevents users of the fused file from using those utilities directly.
parent
8ffb7e5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
fuse_gtest_files.py
googletest/scripts/fuse_gtest_files.py
+10
-14
No files found.
googletest/scripts/fuse_gtest_files.py
View file @
6044c267
...
@@ -172,6 +172,7 @@ def FuseGTestH(gtest_root, output_dir):
...
@@ -172,6 +172,7 @@ def FuseGTestH(gtest_root, output_dir):
output_file
.
write
(
line
)
output_file
.
write
(
line
)
ProcessFile
(
GTEST_H_SEED
)
ProcessFile
(
GTEST_H_SEED
)
ProcessFile
(
GTEST_SPI_H_SEED
)
output_file
.
close
()
output_file
.
close
()
...
@@ -193,20 +194,15 @@ def FuseGTestAllCcToFile(gtest_root, output_file):
...
@@ -193,20 +194,15 @@ def FuseGTestAllCcToFile(gtest_root, output_file):
for
line
in
open
(
os
.
path
.
join
(
gtest_root
,
gtest_source_file
),
'r'
):
for
line
in
open
(
os
.
path
.
join
(
gtest_root
,
gtest_source_file
),
'r'
):
m
=
INCLUDE_GTEST_FILE_REGEX
.
match
(
line
)
m
=
INCLUDE_GTEST_FILE_REGEX
.
match
(
line
)
if
m
:
if
m
:
if
'include/'
+
m
.
group
(
1
)
==
GTEST_SPI_H_SEED
:
# It's '#include "gtest/foo.h"'.
# It's '#include "gtest/gtest-spi.h"'. This file is not
# We treat it as '#include "gtest/gtest.h"', as all other
# #included by "gtest/gtest.h", so we need to process it.
# gtest headers are being fused into gtest.h and cannot be
ProcessFile
(
GTEST_SPI_H_SEED
)
# #included directly.
else
:
# It's '#include "gtest/foo.h"' where foo is not gtest-spi.
# There is no need to #include "gtest/gtest.h" more than once.
# We treat it as '#include "gtest/gtest.h"', as all other
if
not
GTEST_H_SEED
in
processed_files
:
# gtest headers are being fused into gtest.h and cannot be
processed_files
.
add
(
GTEST_H_SEED
)
# #included directly.
output_file
.
write
(
'#include "
%
s"
\n
'
%
(
GTEST_H_OUTPUT
,))
# There is no need to #include "gtest/gtest.h" more than once.
if
not
GTEST_H_SEED
in
processed_files
:
processed_files
.
add
(
GTEST_H_SEED
)
output_file
.
write
(
'#include "
%
s"
\n
'
%
(
GTEST_H_OUTPUT
,))
else
:
else
:
m
=
INCLUDE_SRC_FILE_REGEX
.
match
(
line
)
m
=
INCLUDE_SRC_FILE_REGEX
.
match
(
line
)
if
m
:
if
m
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment