Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
53e08c44
Commit
53e08c44
authored
Sep 14, 2010
by
zhanyong.wan
Browse files
Include gtest and gmock headers as user headers instead of system headers.
parent
ad7c462b
Changes
42
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
56 additions
and
56 deletions
+56
-56
include/gmock/gmock-actions.h
include/gmock/gmock-actions.h
+2
-2
include/gmock/gmock-cardinalities.h
include/gmock/gmock-cardinalities.h
+2
-2
include/gmock/gmock-generated-actions.h
include/gmock/gmock-generated-actions.h
+2
-2
include/gmock/gmock-generated-actions.h.pump
include/gmock/gmock-generated-actions.h.pump
+2
-2
include/gmock/gmock-generated-function-mockers.h
include/gmock/gmock-generated-function-mockers.h
+2
-2
include/gmock/gmock-generated-function-mockers.h.pump
include/gmock/gmock-generated-function-mockers.h.pump
+2
-2
include/gmock/gmock-generated-matchers.h
include/gmock/gmock-generated-matchers.h
+1
-1
include/gmock/gmock-generated-matchers.h.pump
include/gmock/gmock-generated-matchers.h.pump
+1
-1
include/gmock/gmock-generated-nice-strict.h
include/gmock/gmock-generated-nice-strict.h
+2
-2
include/gmock/gmock-generated-nice-strict.h.pump
include/gmock/gmock-generated-nice-strict.h.pump
+2
-2
include/gmock/gmock-matchers.h
include/gmock/gmock-matchers.h
+3
-3
include/gmock/gmock-more-actions.h
include/gmock/gmock-more-actions.h
+1
-1
include/gmock/gmock-spec-builders.h
include/gmock/gmock-spec-builders.h
+6
-6
include/gmock/gmock.h
include/gmock/gmock.h
+9
-9
include/gmock/internal/gmock-generated-internal-utils.h
include/gmock/internal/gmock-generated-internal-utils.h
+1
-1
include/gmock/internal/gmock-generated-internal-utils.h.pump
include/gmock/internal/gmock-generated-internal-utils.h.pump
+1
-1
include/gmock/internal/gmock-internal-utils.h
include/gmock/internal/gmock-internal-utils.h
+3
-3
include/gmock/internal/gmock-port.h
include/gmock/internal/gmock-port.h
+2
-2
scripts/fuse_gmock_files.py
scripts/fuse_gmock_files.py
+11
-11
src/gmock-all.cc
src/gmock-all.cc
+1
-1
No files found.
include/gmock/gmock-actions.h
View file @
53e08c44
...
@@ -43,8 +43,8 @@
...
@@ -43,8 +43,8 @@
#include <errno.h>
#include <errno.h>
#endif
#endif
#include
<
gmock/internal/gmock-internal-utils.h
>
#include
"
gmock/internal/gmock-internal-utils.h
"
#include
<
gmock/internal/gmock-port.h
>
#include
"
gmock/internal/gmock-port.h
"
namespace
testing
{
namespace
testing
{
...
...
include/gmock/gmock-cardinalities.h
View file @
53e08c44
...
@@ -40,8 +40,8 @@
...
@@ -40,8 +40,8 @@
#include <limits.h>
#include <limits.h>
#include <ostream> // NOLINT
#include <ostream> // NOLINT
#include
<
gmock/internal/gmock-port.h
>
#include
"
gmock/internal/gmock-port.h
"
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
namespace
testing
{
namespace
testing
{
...
...
include/gmock/gmock-generated-actions.h
View file @
53e08c44
...
@@ -38,8 +38,8 @@
...
@@ -38,8 +38,8 @@
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#include
<
gmock/gmock-actions.h
>
#include
"
gmock/gmock-actions.h
"
#include
<
gmock/internal/gmock-port.h
>
#include
"
gmock/internal/gmock-port.h
"
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
...
include/gmock/gmock-generated-actions.h.pump
View file @
53e08c44
...
@@ -42,8 +42,8 @@ $$}} This meta comment fixes auto-indentation in editors.
...
@@ -42,8 +42,8 @@ $$}} This meta comment fixes auto-indentation in editors.
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#include
<
gmock/gmock-actions.h
>
#include
"
gmock/gmock-actions.h
"
#include
<
gmock/internal/gmock-port.h
>
#include
"
gmock/internal/gmock-port.h
"
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
...
include/gmock/gmock-generated-function-mockers.h
View file @
53e08c44
...
@@ -38,8 +38,8 @@
...
@@ -38,8 +38,8 @@
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#include
<
gmock/gmock-spec-builders.h
>
#include
"
gmock/gmock-spec-builders.h
"
#include
<
gmock/internal/gmock-internal-utils.h
>
#include
"
gmock/internal/gmock-internal-utils.h
"
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
...
include/gmock/gmock-generated-function-mockers.h.pump
View file @
53e08c44
...
@@ -41,8 +41,8 @@ $var n = 10 $$ The maximum arity we support.
...
@@ -41,8 +41,8 @@ $var n = 10 $$ The maximum arity we support.
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#include
<
gmock/gmock-spec-builders.h
>
#include
"
gmock/gmock-spec-builders.h
"
#include
<
gmock/internal/gmock-internal-utils.h
>
#include
"
gmock/internal/gmock-internal-utils.h
"
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
...
include/gmock/gmock-generated-matchers.h
View file @
53e08c44
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
#include <sstream>
#include <sstream>
#include <string>
#include <string>
#include <vector>
#include <vector>
#include
<
gmock/gmock-matchers.h
>
#include
"
gmock/gmock-matchers.h
"
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
...
include/gmock/gmock-generated-matchers.h.pump
View file @
53e08c44
...
@@ -43,7 +43,7 @@ $$ }} This line fixes auto-indentation of the following code in Emacs.
...
@@ -43,7 +43,7 @@ $$ }} This line fixes auto-indentation of the following code in Emacs.
#include <sstream>
#include <sstream>
#include <string>
#include <string>
#include <vector>
#include <vector>
#include
<
gmock/gmock-matchers.h
>
#include
"
gmock/gmock-matchers.h
"
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
...
include/gmock/gmock-generated-nice-strict.h
View file @
53e08c44
...
@@ -59,8 +59,8 @@
...
@@ -59,8 +59,8 @@
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
#include
<
gmock/gmock-spec-builders.h
>
#include
"
gmock/gmock-spec-builders.h
"
#include
<
gmock/internal/gmock-port.h
>
#include
"
gmock/internal/gmock-port.h
"
namespace
testing
{
namespace
testing
{
...
...
include/gmock/gmock-generated-nice-strict.h.pump
View file @
53e08c44
...
@@ -62,8 +62,8 @@ $var n = 10 $$ The maximum arity we support.
...
@@ -62,8 +62,8 @@ $var n = 10 $$ The maximum arity we support.
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
#include
<
gmock/gmock-spec-builders.h
>
#include
"
gmock/gmock-spec-builders.h
"
#include
<
gmock/internal/gmock-port.h
>
#include
"
gmock/internal/gmock-port.h
"
namespace
testing
{
namespace
testing
{
...
...
include/gmock/gmock-matchers.h
View file @
53e08c44
...
@@ -46,9 +46,9 @@
...
@@ -46,9 +46,9 @@
#include <utility>
#include <utility>
#include <vector>
#include <vector>
#include
<
gmock/internal/gmock-internal-utils.h
>
#include
"
gmock/internal/gmock-internal-utils.h
"
#include
<
gmock/internal/gmock-port.h
>
#include
"
gmock/internal/gmock-port.h
"
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
namespace
testing
{
namespace
testing
{
...
...
include/gmock/gmock-more-actions.h
View file @
53e08c44
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
#include
<
gmock/gmock-generated-actions.h
>
#include
"
gmock/gmock-generated-actions.h
"
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
...
include/gmock/gmock-spec-builders.h
View file @
53e08c44
...
@@ -66,12 +66,12 @@
...
@@ -66,12 +66,12 @@
#include <string>
#include <string>
#include <vector>
#include <vector>
#include
<
gmock/gmock-actions.h
>
#include
"
gmock/gmock-actions.h
"
#include
<
gmock/gmock-cardinalities.h
>
#include
"
gmock/gmock-cardinalities.h
"
#include
<
gmock/gmock-matchers.h
>
#include
"
gmock/gmock-matchers.h
"
#include
<
gmock/internal/gmock-internal-utils.h
>
#include
"
gmock/internal/gmock-internal-utils.h
"
#include
<
gmock/internal/gmock-port.h
>
#include
"
gmock/internal/gmock-port.h
"
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
namespace
testing
{
namespace
testing
{
...
...
include/gmock/gmock.h
View file @
53e08c44
...
@@ -55,15 +55,15 @@
...
@@ -55,15 +55,15 @@
//
//
// where all clauses are optional and WillOnce() can be repeated.
// where all clauses are optional and WillOnce() can be repeated.
#include
<
gmock/gmock-actions.h
>
#include
"
gmock/gmock-actions.h
"
#include
<
gmock/gmock-cardinalities.h
>
#include
"
gmock/gmock-cardinalities.h
"
#include
<
gmock/gmock-generated-actions.h
>
#include
"
gmock/gmock-generated-actions.h
"
#include
<
gmock/gmock-generated-function-mockers.h
>
#include
"
gmock/gmock-generated-function-mockers.h
"
#include
<
gmock/gmock-generated-matchers.h
>
#include
"
gmock/gmock-generated-matchers.h
"
#include
<
gmock/gmock-more-actions.h
>
#include
"
gmock/gmock-more-actions.h
"
#include
<
gmock/gmock-generated-nice-strict.h
>
#include
"
gmock/gmock-generated-nice-strict.h
"
#include
<
gmock/gmock-matchers.h
>
#include
"
gmock/gmock-matchers.h
"
#include
<
gmock/internal/gmock-internal-utils.h
>
#include
"
gmock/internal/gmock-internal-utils.h
"
namespace
testing
{
namespace
testing
{
...
...
include/gmock/internal/gmock-generated-internal-utils.h
View file @
53e08c44
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#include
<
gmock/internal/gmock-port.h
>
#include
"
gmock/internal/gmock-port.h
"
namespace
testing
{
namespace
testing
{
...
...
include/gmock/internal/gmock-generated-internal-utils.h.pump
View file @
53e08c44
...
@@ -42,7 +42,7 @@ $var n = 10 $$ The maximum arity we support.
...
@@ -42,7 +42,7 @@ $var n = 10 $$ The maximum arity we support.
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#include
<
gmock/internal/gmock-port.h
>
#include
"
gmock/internal/gmock-port.h
"
namespace
testing
{
namespace
testing
{
...
...
include/gmock/internal/gmock-internal-utils.h
View file @
53e08c44
...
@@ -42,9 +42,9 @@
...
@@ -42,9 +42,9 @@
#include <ostream> // NOLINT
#include <ostream> // NOLINT
#include <string>
#include <string>
#include
<
gmock/internal/gmock-generated-internal-utils.h
>
#include
"
gmock/internal/gmock-generated-internal-utils.h
"
#include
<
gmock/internal/gmock-port.h
>
#include
"
gmock/internal/gmock-port.h
"
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
...
include/gmock/internal/gmock-port.h
View file @
53e08c44
...
@@ -42,8 +42,8 @@
...
@@ -42,8 +42,8 @@
// Most of the types needed for porting Google Mock are also required
// Most of the types needed for porting Google Mock are also required
// for Google Test and are defined in gtest-port.h.
// for Google Test and are defined in gtest-port.h.
#include
<
gtest/internal/gtest-linked_ptr.h
>
#include
"
gtest/internal/gtest-linked_ptr.h
"
#include
<
gtest/internal/gtest-port.h
>
#include
"
gtest/internal/gtest-port.h
"
// To avoid conditional compilation everywhere, we make it
// To avoid conditional compilation everywhere, we make it
// gmock-port.h's responsibility to #include the header implementing
// gmock-port.h's responsibility to #include the header implementing
...
...
scripts/fuse_gmock_files.py
View file @
53e08c44
...
@@ -75,8 +75,8 @@ sys.path.append(os.path.join(DEFAULT_GMOCK_ROOT_DIR, 'gtest/scripts'))
...
@@ -75,8 +75,8 @@ sys.path.append(os.path.join(DEFAULT_GMOCK_ROOT_DIR, 'gtest/scripts'))
import
fuse_gtest_files
import
fuse_gtest_files
gtest
=
fuse_gtest_files
gtest
=
fuse_gtest_files
# Regex for matching '#include
<
gmock/...
>
'.
# Regex for matching '#include
"
gmock/...
"
'.
INCLUDE_GMOCK_FILE_REGEX
=
re
.
compile
(
r
'^\s*#\s*include\s*
<
(gmock/.+)
>
'
)
INCLUDE_GMOCK_FILE_REGEX
=
re
.
compile
(
r
'^\s*#\s*include\s*
"
(gmock/.+)
"
'
)
# Where to find the source seed files.
# Where to find the source seed files.
GMOCK_H_SEED
=
'include/gmock/gmock.h'
GMOCK_H_SEED
=
'include/gmock/gmock.h'
...
@@ -135,19 +135,19 @@ def FuseGMockH(gmock_root, output_dir):
...
@@ -135,19 +135,19 @@ def FuseGMockH(gmock_root, output_dir):
for
line
in
file
(
os
.
path
.
join
(
gmock_root
,
gmock_header_path
),
'r'
):
for
line
in
file
(
os
.
path
.
join
(
gmock_root
,
gmock_header_path
),
'r'
):
m
=
INCLUDE_GMOCK_FILE_REGEX
.
match
(
line
)
m
=
INCLUDE_GMOCK_FILE_REGEX
.
match
(
line
)
if
m
:
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
))
ProcessFile
(
'include/'
+
m
.
group
(
1
))
else
:
else
:
m
=
gtest
.
INCLUDE_GTEST_FILE_REGEX
.
match
(
line
)
m
=
gtest
.
INCLUDE_GTEST_FILE_REGEX
.
match
(
line
)
if
m
:
if
m
:
# It's '#include
<
gtest/foo.h
>
'. We translate it to
# It's '#include
"
gtest/foo.h
"
'. We translate it to
#
<
gtest/gtest.h
>
, regardless of what foo is, since all
#
"
gtest/gtest.h
"
, regardless of what foo is, since all
# gtest headers are fused into gtest/gtest.h.
# gtest headers are fused into gtest/gtest.h.
# There is no need to #include gtest.h twice.
# There is no need to #include gtest.h twice.
if
not
gtest
.
GTEST_H_SEED
in
processed_files
:
if
not
gtest
.
GTEST_H_SEED
in
processed_files
:
processed_files
.
add
(
gtest
.
GTEST_H_SEED
)
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
:
else
:
# Otherwise we copy the line unchanged to the output file.
# Otherwise we copy the line unchanged to the output file.
output_file
.
write
(
line
)
output_file
.
write
(
line
)
...
@@ -174,18 +174,18 @@ def FuseGMockAllCcToFile(gmock_root, output_file):
...
@@ -174,18 +174,18 @@ def FuseGMockAllCcToFile(gmock_root, output_file):
for
line
in
file
(
os
.
path
.
join
(
gmock_root
,
gmock_source_file
),
'r'
):
for
line
in
file
(
os
.
path
.
join
(
gmock_root
,
gmock_source_file
),
'r'
):
m
=
INCLUDE_GMOCK_FILE_REGEX
.
match
(
line
)
m
=
INCLUDE_GMOCK_FILE_REGEX
.
match
(
line
)
if
m
:
if
m
:
# It's '#include
<
gmock/foo.h
>
'. We treat it as '#include
# It's '#include
"
gmock/foo.h
"
'. We treat it as '#include
#
<
gmock/gmock.h
>
', as all other gmock headers are being fused
#
"
gmock/gmock.h
"
', as all other gmock headers are being fused
# into gmock.h and cannot be #included directly.
# 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
:
if
not
GMOCK_H_SEED
in
processed_files
:
processed_files
.
add
(
GMOCK_H_SEED
)
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
:
else
:
m
=
gtest
.
INCLUDE_GTEST_FILE_REGEX
.
match
(
line
)
m
=
gtest
.
INCLUDE_GTEST_FILE_REGEX
.
match
(
line
)
if
m
:
if
m
:
# It's '#include
<
gtest/...
>
'.
# It's '#include
"
gtest/...
"
'.
# There is no need to #include gtest.h as it has been
# There is no need to #include gtest.h as it has been
# #included by gtest-all.cc.
# #included by gtest-all.cc.
pass
pass
...
...
src/gmock-all.cc
View file @
53e08c44
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
// This line ensures that gmock.h can be compiled on its own, even
// This line ensures that gmock.h can be compiled on its own, even
// when it's fused.
// when it's fused.
#include
<
gmock/gmock.h
>
#include
"
gmock/gmock.h
"
// The following lines pull in the real gmock *.cc files.
// The following lines pull in the real gmock *.cc files.
#include "src/gmock-cardinalities.cc"
#include "src/gmock-cardinalities.cc"
...
...
Prev
1
2
3
Next
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