Include gtest and gmock headers as user headers instead of system headers.

This commit is contained in:
zhanyong.wan 2010-09-14 05:38:21 +00:00
parent ad7c462be7
commit 53e08c44dd
42 changed files with 124 additions and 124 deletions

View File

@ -43,8 +43,8 @@
#include <errno.h>
#endif
#include <gmock/internal/gmock-internal-utils.h>
#include <gmock/internal/gmock-port.h>
#include "gmock/internal/gmock-internal-utils.h"
#include "gmock/internal/gmock-port.h"
namespace testing {

View File

@ -40,8 +40,8 @@
#include <limits.h>
#include <ostream> // NOLINT
#include <gmock/internal/gmock-port.h>
#include <gtest/gtest.h>
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
namespace testing {

View File

@ -38,8 +38,8 @@
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#include <gmock/gmock-actions.h>
#include <gmock/internal/gmock-port.h>
#include "gmock/gmock-actions.h"
#include "gmock/internal/gmock-port.h"
namespace testing {
namespace internal {

View File

@ -42,8 +42,8 @@ $$}} This meta comment fixes auto-indentation in editors.
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#include <gmock/gmock-actions.h>
#include <gmock/internal/gmock-port.h>
#include "gmock/gmock-actions.h"
#include "gmock/internal/gmock-port.h"
namespace testing {
namespace internal {

View File

@ -38,8 +38,8 @@
#ifndef 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/internal/gmock-internal-utils.h>
#include "gmock/gmock-spec-builders.h"
#include "gmock/internal/gmock-internal-utils.h"
namespace testing {
namespace internal {

View File

@ -41,8 +41,8 @@ $var n = 10 $$ The maximum arity we support.
#ifndef 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/internal/gmock-internal-utils.h>
#include "gmock/gmock-spec-builders.h"
#include "gmock/internal/gmock-internal-utils.h"
namespace testing {
namespace internal {

View File

@ -41,7 +41,7 @@
#include <sstream>
#include <string>
#include <vector>
#include <gmock/gmock-matchers.h>
#include "gmock/gmock-matchers.h"
namespace testing {
namespace internal {

View File

@ -43,7 +43,7 @@ $$ }} This line fixes auto-indentation of the following code in Emacs.
#include <sstream>
#include <string>
#include <vector>
#include <gmock/gmock-matchers.h>
#include "gmock/gmock-matchers.h"
namespace testing {
namespace internal {

View File

@ -59,8 +59,8 @@
#ifndef 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/internal/gmock-port.h>
#include "gmock/gmock-spec-builders.h"
#include "gmock/internal/gmock-port.h"
namespace testing {

View File

@ -62,8 +62,8 @@ $var n = 10 $$ The maximum arity we support.
#ifndef 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/internal/gmock-port.h>
#include "gmock/gmock-spec-builders.h"
#include "gmock/internal/gmock-port.h"
namespace testing {

View File

@ -46,9 +46,9 @@
#include <utility>
#include <vector>
#include <gmock/internal/gmock-internal-utils.h>
#include <gmock/internal/gmock-port.h>
#include <gtest/gtest.h>
#include "gmock/internal/gmock-internal-utils.h"
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
namespace testing {

View File

@ -36,7 +36,7 @@
#ifndef 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 internal {

View File

@ -66,12 +66,12 @@
#include <string>
#include <vector>
#include <gmock/gmock-actions.h>
#include <gmock/gmock-cardinalities.h>
#include <gmock/gmock-matchers.h>
#include <gmock/internal/gmock-internal-utils.h>
#include <gmock/internal/gmock-port.h>
#include <gtest/gtest.h>
#include "gmock/gmock-actions.h"
#include "gmock/gmock-cardinalities.h"
#include "gmock/gmock-matchers.h"
#include "gmock/internal/gmock-internal-utils.h"
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
namespace testing {

View File

@ -55,15 +55,15 @@
//
// where all clauses are optional and WillOnce() can be repeated.
#include <gmock/gmock-actions.h>
#include <gmock/gmock-cardinalities.h>
#include <gmock/gmock-generated-actions.h>
#include <gmock/gmock-generated-function-mockers.h>
#include <gmock/gmock-generated-matchers.h>
#include <gmock/gmock-more-actions.h>
#include <gmock/gmock-generated-nice-strict.h>
#include <gmock/gmock-matchers.h>
#include <gmock/internal/gmock-internal-utils.h>
#include "gmock/gmock-actions.h"
#include "gmock/gmock-cardinalities.h"
#include "gmock/gmock-generated-actions.h"
#include "gmock/gmock-generated-function-mockers.h"
#include "gmock/gmock-generated-matchers.h"
#include "gmock/gmock-more-actions.h"
#include "gmock/gmock-generated-nice-strict.h"
#include "gmock/gmock-matchers.h"
#include "gmock/internal/gmock-internal-utils.h"
namespace testing {

View File

@ -39,7 +39,7 @@
#ifndef 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 {

View File

@ -42,7 +42,7 @@ $var n = 10 $$ The maximum arity we support.
#ifndef 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 {

View File

@ -42,9 +42,9 @@
#include <ostream> // NOLINT
#include <string>
#include <gmock/internal/gmock-generated-internal-utils.h>
#include <gmock/internal/gmock-port.h>
#include <gtest/gtest.h>
#include "gmock/internal/gmock-generated-internal-utils.h"
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
namespace testing {
namespace internal {

View File

@ -42,8 +42,8 @@
// Most of the types needed for porting Google Mock are also required
// for Google Test and are defined in gtest-port.h.
#include <gtest/internal/gtest-linked_ptr.h>
#include <gtest/internal/gtest-port.h>
#include "gtest/internal/gtest-linked_ptr.h"
#include "gtest/internal/gtest-port.h"
// To avoid conditional compilation everywhere, we make it
// gmock-port.h's responsibility to #include the header implementing

View File

@ -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

View File

@ -37,7 +37,7 @@
// This line ensures that gmock.h can be compiled on its own, even
// when it's fused.
#include <gmock/gmock.h>
#include "gmock/gmock.h"
// The following lines pull in the real gmock *.cc files.
#include "src/gmock-cardinalities.cc"

View File

@ -33,14 +33,14 @@
//
// This file implements cardinalities.
#include <gmock/gmock-cardinalities.h>
#include "gmock/gmock-cardinalities.h"
#include <limits.h>
#include <ostream> // NOLINT
#include <sstream>
#include <string>
#include <gmock/internal/gmock-internal-utils.h>
#include <gtest/gtest.h>
#include "gmock/internal/gmock-internal-utils.h"
#include "gtest/gtest.h"
namespace testing {

View File

@ -35,14 +35,14 @@
// Mock. They are subject to change without notice, so please DO NOT
// USE THEM IN USER CODE.
#include <gmock/internal/gmock-internal-utils.h>
#include "gmock/internal/gmock-internal-utils.h"
#include <ctype.h>
#include <ostream> // NOLINT
#include <string>
#include <gmock/gmock.h>
#include <gmock/internal/gmock-port.h>
#include <gtest/gtest.h>
#include "gmock/gmock.h"
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
namespace testing {
namespace internal {

View File

@ -34,8 +34,8 @@
// This file implements Matcher<const string&>, Matcher<string>, and
// utilities for defining matchers.
#include <gmock/gmock-matchers.h>
#include <gmock/gmock-generated-matchers.h>
#include "gmock/gmock-matchers.h"
#include "gmock/gmock-generated-matchers.h"
#include <string.h>
#include <sstream>

View File

@ -34,15 +34,15 @@
// This file implements the spec builder syntax (ON_CALL and
// EXPECT_CALL).
#include <gmock/gmock-spec-builders.h>
#include "gmock/gmock-spec-builders.h"
#include <stdlib.h>
#include <iostream> // NOLINT
#include <map>
#include <set>
#include <string>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC
#include <unistd.h> // NOLINT

View File

@ -29,8 +29,8 @@
//
// Author: wan@google.com (Zhanyong Wan)
#include <gmock/gmock.h>
#include <gmock/internal/gmock-port.h>
#include "gmock/gmock.h"
#include "gmock/internal/gmock-port.h"
namespace testing {

View File

@ -30,8 +30,8 @@
// Author: wan@google.com (Zhanyong Wan)
#include <iostream>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
// MS C++ compiler/linker has a bug on Windows (not on Windows CE), which
// causes a link error when _tmain is defined in a static library and UNICODE

View File

@ -33,14 +33,14 @@
//
// This file tests the built-in actions.
#include <gmock/gmock-actions.h>
#include "gmock/gmock-actions.h"
#include <algorithm>
#include <iterator>
#include <string>
#include <gmock/gmock.h>
#include <gmock/internal/gmock-port.h>
#include <gtest/gtest.h>
#include <gtest/gtest-spi.h>
#include "gmock/gmock.h"
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
#include "gtest/gtest-spi.h"
namespace {

View File

@ -33,9 +33,9 @@
//
// This file tests the built-in cardinalities.
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <gtest/gtest-spi.h>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "gtest/gtest-spi.h"
namespace {

View File

@ -33,13 +33,13 @@
//
// This file tests the built-in actions generated by a script.
#include <gmock/gmock-generated-actions.h>
#include "gmock/gmock-generated-actions.h"
#include <functional>
#include <sstream>
#include <string>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
namespace testing {
namespace gmock_generated_actions_test {

View File

@ -33,12 +33,12 @@
//
// This file tests the function mocker classes.
#include <gmock/gmock-generated-function-mockers.h>
#include "gmock/gmock-generated-function-mockers.h"
#include <map>
#include <string>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#if GTEST_OS_WINDOWS
// MSDN says the header file to be included for STDMETHOD is BaseTyps.h but

View File

@ -33,9 +33,9 @@
//
// This file tests the internal utilities.
#include <gmock/internal/gmock-generated-internal-utils.h>
#include <gmock/internal/gmock-internal-utils.h>
#include <gtest/gtest.h>
#include "gmock/internal/gmock-generated-internal-utils.h"
#include "gmock/internal/gmock-internal-utils.h"
#include "gtest/gtest.h"
namespace {

View File

@ -31,7 +31,7 @@
//
// This file tests the built-in matchers generated by a script.
#include <gmock/gmock-generated-matchers.h>
#include "gmock/gmock-generated-matchers.h"
#include <list>
#include <map>
@ -41,9 +41,9 @@
#include <utility>
#include <vector>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <gtest/gtest-spi.h>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "gtest/gtest-spi.h"
namespace {

View File

@ -33,16 +33,16 @@
//
// This file tests the internal utilities.
#include <gmock/internal/gmock-internal-utils.h>
#include "gmock/internal/gmock-internal-utils.h"
#include <stdlib.h>
#include <map>
#include <string>
#include <sstream>
#include <vector>
#include <gmock/gmock.h>
#include <gmock/internal/gmock-port.h>
#include <gtest/gtest.h>
#include <gtest/gtest-spi.h>
#include "gmock/gmock.h"
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
#include "gtest/gtest-spi.h"
#if GTEST_OS_CYGWIN
#include <sys/types.h> // For ssize_t. NOLINT

View File

@ -33,7 +33,7 @@
//
// This file tests some commonly used argument matchers.
#include <gmock/gmock-matchers.h>
#include "gmock/gmock-matchers.h"
#include <string.h>
#include <functional>
@ -45,9 +45,9 @@
#include <string>
#include <utility>
#include <vector>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <gtest/gtest-spi.h>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "gtest/gtest-spi.h"
namespace testing {

View File

@ -33,13 +33,13 @@
//
// This file tests the built-in actions in gmock-more-actions.h.
#include <gmock/gmock-more-actions.h>
#include "gmock/gmock-more-actions.h"
#include <functional>
#include <sstream>
#include <string>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
namespace testing {
namespace gmock_more_actions_test {

View File

@ -29,12 +29,12 @@
//
// Author: wan@google.com (Zhanyong Wan)
#include <gmock/gmock-generated-nice-strict.h>
#include "gmock/gmock-generated-nice-strict.h"
#include <string>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <gtest/gtest-spi.h>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "gtest/gtest-spi.h"
// This must not be defined inside the ::testing namespace, or it will
// clash with ::testing::Mock.

View File

@ -33,8 +33,8 @@
//
// This file tests the internal cross-platform support utilities.
#include <gmock/internal/gmock-port.h>
#include <gtest/gtest.h>
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
// NOTE: if this file is left without tests for some reason, put a dummy
// test here to make references to symbols in the gtest library and avoid

View File

@ -33,16 +33,16 @@
//
// This file tests the spec builder syntax.
#include <gmock/gmock-spec-builders.h>
#include "gmock/gmock-spec-builders.h"
#include <ostream> // NOLINT
#include <sstream>
#include <string>
#include <gmock/gmock.h>
#include <gmock/internal/gmock-port.h>
#include <gtest/gtest.h>
#include <gtest/gtest-spi.h>
#include "gmock/gmock.h"
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
#include "gtest/gtest-spi.h"
namespace testing {
namespace internal {

View File

@ -34,7 +34,7 @@
// This program is for verifying that a leaked mock object can be
// caught by Google Mock's leak detector.
#include <gmock/gmock.h>
#include "gmock/gmock.h"
namespace {

View File

@ -114,14 +114,14 @@
#ifndef GMOCK_TEST_GMOCK_LINK_TEST_H_
#define GMOCK_TEST_GMOCK_LINK_TEST_H_
#include <gmock/gmock.h>
#include "gmock/gmock.h"
#if !GTEST_OS_WINDOWS_MOBILE
#include <errno.h>
#endif
#include <gmock/internal/gmock-port.h>
#include <gtest/gtest.h>
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
#include <iostream>
#include <vector>

View File

@ -32,12 +32,12 @@
// Tests Google Mock's output in various scenarios. This ensures that
// Google Mock's messages are readable and useful.
#include <gmock/gmock.h>
#include "gmock/gmock.h"
#include <stdio.h>
#include <string>
#include <gtest/gtest.h>
#include "gtest/gtest.h"
using testing::_;
using testing::AnyNumber;

View File

@ -33,10 +33,10 @@
//
// This file tests code in gmock.cc.
#include <gmock/gmock.h>
#include "gmock/gmock.h"
#include <string>
#include <gtest/gtest.h>
#include "gtest/gtest.h"
using testing::GMOCK_FLAG(verbose);
using testing::InitGoogleMock;