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
dac3e879
Commit
dac3e879
authored
Sep 14, 2010
by
zhanyong.wan
Browse files
Include gtest headers as user headers instead of system headers.
parent
88e0df62
Changes
87
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
41 additions
and
41 deletions
+41
-41
include/gtest/internal/gtest-type-util.h.pump
include/gtest/internal/gtest-type-util.h.pump
+2
-2
samples/sample10_unittest.cc
samples/sample10_unittest.cc
+1
-1
samples/sample1_unittest.cc
samples/sample1_unittest.cc
+1
-1
samples/sample2_unittest.cc
samples/sample2_unittest.cc
+1
-1
samples/sample3_unittest.cc
samples/sample3_unittest.cc
+1
-1
samples/sample4_unittest.cc
samples/sample4_unittest.cc
+1
-1
samples/sample5_unittest.cc
samples/sample5_unittest.cc
+1
-1
samples/sample6_unittest.cc
samples/sample6_unittest.cc
+1
-1
samples/sample7_unittest.cc
samples/sample7_unittest.cc
+1
-1
samples/sample8_unittest.cc
samples/sample8_unittest.cc
+1
-1
samples/sample9_unittest.cc
samples/sample9_unittest.cc
+1
-1
scripts/fuse_gtest_files.py
scripts/fuse_gtest_files.py
+9
-9
scripts/gen_gtest_pred_impl.py
scripts/gen_gtest_pred_impl.py
+2
-2
src/gtest-all.cc
src/gtest-all.cc
+1
-1
src/gtest-death-test.cc
src/gtest-death-test.cc
+4
-4
src/gtest-filepath.cc
src/gtest-filepath.cc
+3
-3
src/gtest-internal-inl.h
src/gtest-internal-inl.h
+3
-3
src/gtest-port.cc
src/gtest-port.cc
+4
-4
src/gtest-printers.cc
src/gtest-printers.cc
+2
-2
src/gtest-test-part.cc
src/gtest-test-part.cc
+1
-1
No files found.
include/gtest/internal/gtest-type-util.h.pump
View file @
dac3e879
...
...
@@ -42,8 +42,8 @@ $var n = 50 $$ Maximum length of type lists we want to support.
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
#include
<
gtest/internal/gtest-port.h
>
#include
<
gtest/internal/gtest-string.h
>
#include
"
gtest/internal/gtest-port.h
"
#include
"
gtest/internal/gtest-string.h
"
#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
...
...
samples/sample10_unittest.cc
View file @
dac3e879
...
...
@@ -34,7 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
using
::
testing
::
EmptyTestEventListener
;
using
::
testing
::
InitGoogleTest
;
...
...
samples/sample1_unittest.cc
View file @
dac3e879
...
...
@@ -45,7 +45,7 @@
#include <limits.h>
#include "sample1.h"
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
// Step 2. Use the TEST macro to define your tests.
...
...
samples/sample2_unittest.cc
View file @
dac3e879
...
...
@@ -41,7 +41,7 @@
// needed.
#include "sample2.h"
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
// In this example, we test the MyString class (a simple string).
...
...
samples/sample3_unittest.cc
View file @
dac3e879
...
...
@@ -64,7 +64,7 @@
// </TechnicalDetails>
#include "sample3-inl.h"
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
// To use a test fixture, derive a class from testing::Test.
class
QueueTest
:
public
testing
::
Test
{
...
...
samples/sample4_unittest.cc
View file @
dac3e879
...
...
@@ -29,7 +29,7 @@
//
// Author: wan@google.com (Zhanyong Wan)
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
#include "sample4.h"
// Tests the Increment() method.
...
...
samples/sample5_unittest.cc
View file @
dac3e879
...
...
@@ -47,7 +47,7 @@
#include <limits.h>
#include <time.h>
#include "sample3-inl.h"
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
#include "sample1.h"
// In this sample, we want to ensure that every test finishes within
...
...
samples/sample6_unittest.cc
View file @
dac3e879
...
...
@@ -35,7 +35,7 @@
// The interface and its implementations are in this header.
#include "prime_tables.h"
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
// First, we define some factory functions for creating instances of
// the implementations. You may be able to skip this step if all your
...
...
samples/sample7_unittest.cc
View file @
dac3e879
...
...
@@ -38,7 +38,7 @@
// The interface and its implementations are in this header.
#include "prime_tables.h"
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
#if GTEST_HAS_PARAM_TEST
...
...
samples/sample8_unittest.cc
View file @
dac3e879
...
...
@@ -36,7 +36,7 @@
// Use class definitions to test from this header.
#include "prime_tables.h"
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
#if GTEST_HAS_COMBINE
...
...
samples/sample9_unittest.cc
View file @
dac3e879
...
...
@@ -34,7 +34,7 @@
#include <stdio.h>
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
using
::
testing
::
EmptyTestEventListener
;
using
::
testing
::
InitGoogleTest
;
...
...
scripts/fuse_gtest_files.py
View file @
dac3e879
...
...
@@ -67,8 +67,8 @@ import sys
# Test root directory.
DEFAULT_GTEST_ROOT_DIR
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
)
# Regex for matching '#include
<
gtest/...
>
'.
INCLUDE_GTEST_FILE_REGEX
=
re
.
compile
(
r
'^\s*#\s*include\s*
<
(gtest/.+)
>
'
)
# Regex for matching '#include
"
gtest/...
"
'.
INCLUDE_GTEST_FILE_REGEX
=
re
.
compile
(
r
'^\s*#\s*include\s*
"
(gtest/.+)
"
'
)
# Regex for matching '#include "src/..."'.
INCLUDE_SRC_FILE_REGEX
=
re
.
compile
(
r
'^\s*#\s*include\s*"(src/.+)"'
)
...
...
@@ -162,7 +162,7 @@ def FuseGTestH(gtest_root, output_dir):
for
line
in
file
(
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.
# 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.
...
...
@@ -191,19 +191,19 @@ def FuseGTestAllCcToFile(gtest_root, output_file):
m
=
INCLUDE_GTEST_FILE_REGEX
.
match
(
line
)
if
m
:
if
'include/'
+
m
.
group
(
1
)
==
GTEST_SPI_H_SEED
:
# It's '#include
<
gtest/gtest-spi.h
>
'. This file is not
# #included by
<
gtest/gtest.h
>
, so we need to process it.
# It's '#include
"
gtest/gtest-spi.h
"
'. This file is not
# #included by
"
gtest/gtest.h
"
, so we need to process it.
ProcessFile
(
GTEST_SPI_H_SEED
)
else
:
# It's '#include
<
gtest/foo.h
>
' where foo is not gtest-spi.
# We treat it as '#include
<
gtest/gtest.h
>
', as all other
# It's '#include
"
gtest/foo.h
"
' where foo is not gtest-spi.
# We treat it as '#include
"
gtest/gtest.h
"
', as all other
# gtest headers are being fused into gtest.h and cannot be
# #included directly.
# There is no need to #include
<
gtest/gtest.h
>
more than once.
# 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
,))
output_file
.
write
(
'#include
"
%s
"
\n
'
%
(
GTEST_H_OUTPUT
,))
else
:
m
=
INCLUDE_SRC_FILE_REGEX
.
match
(
line
)
if
m
:
...
...
scripts/gen_gtest_pred_impl.py
View file @
dac3e879
...
...
@@ -386,8 +386,8 @@ def UnitTestPreamble():
#include <iostream>
#include
<
gtest/gtest.h
>
#include
<
gtest/gtest-spi.h
>
#include
"
gtest/gtest.h
"
#include
"
gtest/gtest-spi.h
"
// A user-defined data type.
struct Bool {
...
...
src/gtest-all.cc
View file @
dac3e879
...
...
@@ -36,7 +36,7 @@
// This line ensures that gtest.h can be compiled on its own, even
// when it's fused.
#include
<
gtest/gtest.h
>
#include
"
gtest/gtest.h
"
// The following lines pull in the real gtest *.cc files.
#include "src/gtest.cc"
...
...
src/gtest-death-test.cc
View file @
dac3e879
...
...
@@ -31,8 +31,8 @@
//
// This file implements death tests.
#include
<
gtest/gtest-death-test.h
>
#include
<
gtest/internal/gtest-port.h
>
#include
"
gtest/gtest-death-test.h
"
#include
"
gtest/internal/gtest-port.h
"
#if GTEST_HAS_DEATH_TEST
...
...
@@ -54,8 +54,8 @@
#endif // GTEST_HAS_DEATH_TEST
#include
<
gtest/gtest-message.h
>
#include
<
gtest/internal/gtest-string.h
>
#include
"
gtest/gtest-message.h
"
#include
"
gtest/internal/gtest-string.h
"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
...
...
src/gtest-filepath.cc
View file @
dac3e879
...
...
@@ -29,8 +29,8 @@
//
// Authors: keith.ray@gmail.com (Keith Ray)
#include
<
gtest/internal/gtest-filepath.h
>
#include
<
gtest/internal/gtest-port.h
>
#include
"
gtest/internal/gtest-filepath.h
"
#include
"
gtest/internal/gtest-port.h
"
#include <stdlib.h>
...
...
@@ -57,7 +57,7 @@
#define GTEST_PATH_MAX_ _POSIX_PATH_MAX
#endif // GTEST_OS_WINDOWS
#include
<
gtest/internal/gtest-string.h
>
#include
"
gtest/internal/gtest-string.h
"
namespace
testing
{
namespace
internal
{
...
...
src/gtest-internal-inl.h
View file @
dac3e879
...
...
@@ -56,14 +56,14 @@
#include <string>
#include <vector>
#include
<
gtest/internal/gtest-port.h
>
#include
"
gtest/internal/gtest-port.h
"
#if GTEST_OS_WINDOWS
#include <windows.h> // For DWORD.
#endif // GTEST_OS_WINDOWS
#include
<
gtest/gtest.h
>
// NOLINT
#include
<
gtest/gtest-spi.h
>
#include
"
gtest/gtest.h
"
// NOLINT
#include
"
gtest/gtest-spi.h
"
namespace
testing
{
...
...
src/gtest-port.cc
View file @
dac3e879
...
...
@@ -29,7 +29,7 @@
//
// Author: wan@google.com (Zhanyong Wan)
#include
<
gtest/internal/gtest-port.h
>
#include
"
gtest/internal/gtest-port.h
"
#include <limits.h>
#include <stdlib.h>
...
...
@@ -51,9 +51,9 @@
#include <mach/vm_map.h>
#endif // GTEST_OS_MAC
#include
<
gtest/gtest-spi.h
>
#include
<
gtest/gtest-message.h
>
#include
<
gtest/internal/gtest-string.h
>
#include
"
gtest/gtest-spi.h
"
#include
"
gtest/gtest-message.h
"
#include
"
gtest/internal/gtest-string.h
"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
...
...
src/gtest-printers.cc
View file @
dac3e879
...
...
@@ -42,12 +42,12 @@
// or void PrintTo(const Foo&, ::std::ostream*) in the namespace that
// defines Foo.
#include
<
gtest/gtest-printers.h
>
#include
"
gtest/gtest-printers.h
"
#include <ctype.h>
#include <stdio.h>
#include <ostream> // NOLINT
#include <string>
#include
<
gtest/internal/gtest-port.h
>
#include
"
gtest/internal/gtest-port.h
"
namespace
testing
{
...
...
src/gtest-test-part.cc
View file @
dac3e879
...
...
@@ -31,7 +31,7 @@
//
// The Google C++ Testing Framework (Google Test)
#include
<
gtest/gtest-test-part.h
>
#include
"
gtest/gtest-test-part.h
"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
...
...
Prev
1
2
3
4
5
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