Skip to content

Commit

Permalink
Roll gtest.
Browse files Browse the repository at this point in the history
The change in directory structure requires the checkout to be moved to
a different directory, and some dummy header files that re-direct to the
new location.

[email protected]

Review-Url: https://codereview.chromium.org/2163573002
Cr-Commit-Position: refs/heads/master@{#406741}
  • Loading branch information
akmistry authored and Commit bot committed Jul 21, 2016
1 parent e0a5b1e commit 4266a7d
Show file tree
Hide file tree
Showing 30 changed files with 183 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ vs-chromium-project.txt
/sync/sync.xml
/sync_testserver.log
/testing/gmock
/testing/gtest
/testing/gtest/third_party/googletest
/testserver.log
/tools/luci-go/linux64/isolate
/tools/luci-go/mac64/isolate
Expand Down
4 changes: 2 additions & 2 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ deps = {
'src/sdch/open-vcdiff':
Var('chromium_git') + '/external/github.com/google/open-vcdiff.git' + '@' + '21d7d0b9c3d0c3ccbdb221c85ae889373f0a2a58',

'src/testing/gtest':
Var('chromium_git') + '/external/github.com/google/googletest.git' + '@' + '6f8a66431cb592dad629028a50b3dd418a408c87',
'src/testing/third_party/googletest':
Var('chromium_git') + '/external/github.com/google/googletest.git' + '@' + 'ec44c6c1675c25b9827aacd08c02433cccde7780',

'src/testing/gmock':
Var('chromium_git') + '/external/googlemock.git' + '@' + '0421b6f358139f02e102c9c332ce19a33faf75be', # from svn revision 566
Expand Down
4 changes: 2 additions & 2 deletions net/socket/sequenced_socket_data_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,8 @@ TEST_F(SequencedSocketDataTest, SingleSyncWriteTooSmall) {

static const char* kExpectedFailures[] = {
"Expected: (data.length()) >= (expected_data.length())",
"Value of: actual_data",
"Value of: sock_->Write(buf.get(), len, failing_callback_)"};
"To be equal to: actual_data",
"To be equal to: sock_->Write(buf.get(), len, failing_callback_)"};
ASSERT_EQ(arraysize(kExpectedFailures),
static_cast<size_t>(gtest_failures.size()));

Expand Down
9 changes: 5 additions & 4 deletions testing/gtest.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
'<@(gtest_sources)',
],
'include_dirs': [
'gtest',
'gtest/include',
'third_party/googletest/googletest',
'third_party/googletest/googletest/include',
],
'dependencies': [
'gtest_prod',
Expand Down Expand Up @@ -158,7 +158,7 @@
'UNIT_TEST',
],
'include_dirs': [
'gtest/include', # So that gtest headers can find themselves.
'third_party/googletest/googletest/include', # So that gtest headers can find themselves.
],
'target_conditions': [
['_type=="executable"', {
Expand Down Expand Up @@ -198,7 +198,7 @@
'gtest',
],
'sources': [
'gtest/src/gtest_main.cc',
'third_party/googletest/googletest/src/gtest_main.cc',
],
},
{
Expand All @@ -207,6 +207,7 @@
'type': 'none',
'sources': [
'gtest/include/gtest/gtest_prod.h',
'third_party/googletest/googletest/include/gtest/gtest_prod.h',
],
},
],
Expand Down
36 changes: 28 additions & 8 deletions testing/gtest.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,34 @@
'gtest/include/gtest/internal/gtest-string.h',
'gtest/include/gtest/internal/gtest-tuple.h',
'gtest/include/gtest/internal/gtest-type-util.h',
'gtest/src/gtest-death-test.cc',
'gtest/src/gtest-filepath.cc',
'gtest/src/gtest-internal-inl.h',
'gtest/src/gtest-port.cc',
'gtest/src/gtest-printers.cc',
'gtest/src/gtest-test-part.cc',
'gtest/src/gtest-typed-test.cc',
'gtest/src/gtest.cc',
'third_party/googletest/googletest/include/gtest/gtest-death-test.h',
'third_party/googletest/googletest/include/gtest/gtest-message.h',
'third_party/googletest/googletest/include/gtest/gtest-param-test.h',
'third_party/googletest/googletest/include/gtest/gtest-printers.h',
'third_party/googletest/googletest/include/gtest/gtest-spi.h',
'third_party/googletest/googletest/include/gtest/gtest-test-part.h',
'third_party/googletest/googletest/include/gtest/gtest-typed-test.h',
'third_party/googletest/googletest/include/gtest/gtest.h',
'third_party/googletest/googletest/include/gtest/gtest_pred_impl.h',
'third_party/googletest/googletest/include/gtest/gtest_prod.h',
'third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h',
'third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h',
'third_party/googletest/googletest/include/gtest/internal/gtest-internal.h',
'third_party/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h',
'third_party/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h',
'third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h',
'third_party/googletest/googletest/include/gtest/internal/gtest-port.h',
'third_party/googletest/googletest/include/gtest/internal/gtest-string.h',
'third_party/googletest/googletest/include/gtest/internal/gtest-tuple.h',
'third_party/googletest/googletest/include/gtest/internal/gtest-type-util.h',
'third_party/googletest/googletest/src/gtest-death-test.cc',
'third_party/googletest/googletest/src/gtest-filepath.cc',
'third_party/googletest/googletest/src/gtest-internal-inl.h',
'third_party/googletest/googletest/src/gtest-port.cc',
'third_party/googletest/googletest/src/gtest-printers.cc',
'third_party/googletest/googletest/src/gtest-test-part.cc',
'third_party/googletest/googletest/src/gtest-typed-test.cc',
'third_party/googletest/googletest/src/gtest.cc',
'multiprocess_func_list.cc',
'multiprocess_func_list.h',
'platform_test.h',
Expand Down
57 changes: 31 additions & 26 deletions build/secondary/testing/gtest/BUILD.gn → testing/gtest/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ config("gtest_config") {
]

# Gtest headers need to be able to find themselves.
include_dirs = [ "include" ]
include_dirs = [ "../third_party/googletest/googletest/include" ]

if (is_win) {
cflags = [ "/wd4800" ] # Unused variable warning.
Expand Down Expand Up @@ -60,18 +60,28 @@ config("gtest_direct_config") {
defines = [ "UNIT_TEST" ]
}

config("gtest_warnings") {
if (is_win && is_clang) {
# The Mutex constructor initializer list in gtest-port.cc is incorrectly
# ordered. See
# https://groups.google.com/d/msg/googletestframework/S5uSV8L2TX8/U1FaTDa6J6sJ.
cflags = [ "-Wno-reorder" ]
}
}

static_library("gtest") {
testonly = true
sources = [
"../third_party/googletest/googletest/include/gtest/gtest-death-test.h",
"../third_party/googletest/googletest/include/gtest/gtest-message.h",
"../third_party/googletest/googletest/include/gtest/gtest-param-test.h",
"../third_party/googletest/googletest/include/gtest/gtest-printers.h",
"../third_party/googletest/googletest/include/gtest/gtest-spi.h",
"../third_party/googletest/googletest/include/gtest/gtest-test-part.h",
"../third_party/googletest/googletest/include/gtest/gtest-typed-test.h",
"../third_party/googletest/googletest/include/gtest/gtest.h",
"../third_party/googletest/googletest/include/gtest/gtest_pred_impl.h",
"../third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h",
"../third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h",
"../third_party/googletest/googletest/include/gtest/internal/gtest-internal.h",
"../third_party/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h",
"../third_party/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h",
"../third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h",
"../third_party/googletest/googletest/include/gtest/internal/gtest-port.h",
"../third_party/googletest/googletest/include/gtest/internal/gtest-string.h",
"../third_party/googletest/googletest/include/gtest/internal/gtest-tuple.h",
"../third_party/googletest/googletest/include/gtest/internal/gtest-type-util.h",
"include/gtest/gtest-death-test.h",
"include/gtest/gtest-message.h",
"include/gtest/gtest-param-test.h",
Expand All @@ -93,14 +103,14 @@ static_library("gtest") {
"include/gtest/internal/gtest-type-util.h",

#"gtest/src/gtest-all.cc", # Not needed by our build.
"src/gtest-death-test.cc",
"src/gtest-filepath.cc",
"src/gtest-internal-inl.h",
"src/gtest-port.cc",
"src/gtest-printers.cc",
"src/gtest-test-part.cc",
"src/gtest-typed-test.cc",
"src/gtest.cc",
"../third_party/googletest/googletest/src/gtest-death-test.cc",
"../third_party/googletest/googletest/src/gtest-filepath.cc",
"../third_party/googletest/googletest/src/gtest-internal-inl.h",
"../third_party/googletest/googletest/src/gtest-port.cc",
"../third_party/googletest/googletest/src/gtest-printers.cc",
"../third_party/googletest/googletest/src/gtest-test-part.cc",
"../third_party/googletest/googletest/src/gtest-typed-test.cc",
"../third_party/googletest/googletest/src/gtest.cc",
]

if (gtest_include_multiprocess) {
Expand Down Expand Up @@ -135,24 +145,19 @@ static_library("gtest") {
]
}

include_dirs = [ "." ]
include_dirs = [ "../third_party/googletest/googletest" ]

all_dependent_configs = [ ":gtest_config" ]
public_configs = [ ":gtest_direct_config" ]

configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",

# Must be after no_chromium_code for warning flags to be ordered correctly.
":gtest_warnings",
]
configs += [ "//build/config/compiler:no_chromium_code" ]
}

source_set("gtest_main") {
testonly = true
sources = [
"src/gtest_main.cc",
"../third_party/googletest/googletest/src/gtest_main.cc",
]
deps = [
":gtest",
Expand Down
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/gtest-death-test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/gtest-death-test.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/gtest-message.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/gtest-message.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/gtest-param-test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/gtest-param-test.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/gtest-printers.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/gtest-printers.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/gtest-spi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/gtest-spi.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/gtest-test-part.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/gtest-test-part.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/gtest-typed-test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/gtest-typed-test.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/gtest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/gtest.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/gtest_pred_impl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/gtest_pred_impl.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/gtest_prod.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/gtest_prod.h"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/internal/gtest-filepath.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/internal/gtest-internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/internal/gtest-linked_ptr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/internal/gtest-param-util.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/internal/gtest-port-arch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/internal/gtest-port-arch.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/internal/gtest-port.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/internal/gtest-port.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/internal/gtest-string.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/internal/gtest-string.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/internal/gtest-tuple.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/internal/gtest-tuple.h"
5 changes: 5 additions & 0 deletions testing/gtest/include/gtest/internal/gtest-type-util.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/third_party/googletest/googletest/include/gtest/internal/gtest-type-util.h"
8 changes: 4 additions & 4 deletions testing/gtest_nacl.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
'<@(gtest_sources)',
],
'include_dirs': [
'gtest',
'gtest/include',
'third_party/googletest/googletest',
'third_party/googletest/googletest/include',
],
'defines': [
# In order to allow regex matches in gtest to be shared between
Expand Down Expand Up @@ -61,7 +61,7 @@
'GTEST_HAS_RTTI=0',
],
'include_dirs': [
'gtest/include', # So that gtest headers can find themselves.
'third_party/googletest/googletest/include', # So that gtest headers can find themselves.
],
},
},
Expand All @@ -80,7 +80,7 @@
'gtest_nacl',
],
'sources': [
'gtest/src/gtest_main.cc',
'third_party/googletest/googletest/src/gtest_main.cc',
],
'all_dependent_settings': {
'link_flags': [
Expand Down
4 changes: 4 additions & 0 deletions tools/checklicenses/checklicenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,10 @@ def PrintUsage():
# https://github.com/PyCQA/pylint/issues/894
'UNKNOWN',
],
# Trivial script lacking a license. Not used by Chromium.
'testing/third_party/googletest/travis.sh': [
'UNKNOWN',
],
}

EXCLUDED_PATHS = [
Expand Down
3 changes: 1 addition & 2 deletions tools/licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
os.path.join('net', 'tools', 'spdyshark'),
os.path.join('sdch', 'open-vcdiff'),
os.path.join('testing', 'gmock'),
os.path.join('testing', 'gtest'),
os.path.join('tools', 'gyp'),
os.path.join('tools', 'page_cycler', 'acid3'),
os.path.join('url', 'third_party', 'mozilla'),
Expand Down Expand Up @@ -142,7 +141,7 @@
"License": "BSD",
"License File": "NOT_SHIPPED",
},
os.path.join('testing', 'gtest'): {
os.path.join('testing', 'third_party', 'googletest'): {
"Name": "gtest",
"URL": "http://code.google.com/p/googletest",
"License": "BSD",
Expand Down

0 comments on commit 4266a7d

Please sign in to comment.