Skip to content

Commit

Permalink
Add a new 'run_all_unittests' target in base
Browse files Browse the repository at this point in the history
Make all the places that include run_all_unittests.cc manually depend
on this target instead.

BUG=
TEST=


Review URL: http://codereview.chromium.org/9691067

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127911 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
akalin@chromium.org committed Mar 21, 2012
1 parent e14c6de commit c554906
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 29 deletions.
16 changes: 13 additions & 3 deletions base/base.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,22 @@
}
],
},
# Include this target for a main() function that simply instantiates
# and runs a base::TestSuite.
{
'target_name': 'run_all_unittests',
'type': 'static_library',
'dependencies': [
'test_support_base',
],
'sources': [
'test/run_all_unittests.cc',
],
},
{
'target_name': 'base_unittests',
'type': 'executable',
'sources': [
# Infrastructure files.
'test/run_all_unittests.cc',

# Tests.
'android/jni_android_unittest.cc',
'android/scoped_java_ref_unittest.cc',
Expand Down Expand Up @@ -295,6 +304,7 @@
'base',
'base_i18n',
'base_static',
'run_all_unittests',
'test_support_base',
'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../testing/gmock.gyp:gmock',
Expand Down
7 changes: 2 additions & 5 deletions build/temp_gyp/googleurl.gyp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Copyright (c) 2012 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.

Expand Down Expand Up @@ -71,7 +71,7 @@
'dependencies': [
'googleurl',
'../../base/base.gyp:base_i18n',
'../../base/base.gyp:test_support_base',
'../../base/base.gyp:run_all_unittests',
'../../testing/gtest.gyp:gtest',
'../../third_party/icu/icu.gyp:icuuc',
],
Expand All @@ -81,9 +81,6 @@
'../../googleurl/src/url_parse_unittest.cc',
'../../googleurl/src/url_test_utils.h',
'../../googleurl/src/url_util_unittest.cc',
# Make sure base and ICU are started up the 'Chromium way' since the
# build is using the Chromium base & ICU.
'../../base/test/run_all_unittests.cc',
],
'conditions': [
['os_posix==1 and OS!="mac"', {
Expand Down
6 changes: 3 additions & 3 deletions chrome/chrome_tests.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@
'type': 'executable',
'dependencies': [
'chromedriver_lib',
'../base/base.gyp:run_all_unittests',
'../base/base.gyp:test_support_base',
'../testing/gtest.gyp:gtest',
'../skia/skia.gyp:skia',
Expand All @@ -1143,7 +1144,6 @@
'..',
],
'sources': [
'../base/test/run_all_unittests.cc',
'test/webdriver/commands/set_timeout_commands_unittest.cc',
'test/webdriver/frame_path_unittest.cc',
'test/webdriver/http_response_unittest.cc',
Expand Down Expand Up @@ -3631,7 +3631,6 @@
'target_name': 'sync_unit_tests',
'type': 'executable',
'sources': [
'../base/test/run_all_unittests.cc',
'browser/sync/api/sync_change_unittest.cc',
'browser/sync/api/sync_error_unittest.cc',
'browser/sync/internal_api/change_record_unittest.cc',
Expand All @@ -3653,11 +3652,12 @@
'..',
],
'dependencies': [
'../sync/sync.gyp:sync_tests',
'../base/base.gyp:run_all_unittests',
'../base/base.gyp:test_support_base',
'../jingle/jingle.gyp:notifier_test_util',
'../net/net.gyp:net',
'../net/net.gyp:net_test_support',
'../sync/sync.gyp:sync_tests',
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
'syncapi_core',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Copyright (c) 2012 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.

Expand Down Expand Up @@ -57,13 +57,11 @@
'type': 'executable',
'dependencies': [
'../../../../base/base.gyp:base',
'../../../../base/base.gyp:test_support_base',
'../../../../base/base.gyp:run_all_unittests',
'../../../../testing/gmock.gyp:gmock',
'../../../../testing/gtest.gyp:gtest',
],
'sources': [
# Infrastructure files.
'../../../../base/test/run_all_unittests.cc',
'port_monitor_unittest.cc',
],
},
Expand Down
2 changes: 1 addition & 1 deletion dbus/dbus.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
'target_name': 'dbus_unittests',
'type': 'executable',
'dependencies': [
'../base/base.gyp:run_all_unittests',
'../base/base.gyp:test_support_base',
'../build/linux/system.gyp:dbus',
'../testing/gmock.gyp:gmock',
Expand All @@ -81,7 +82,6 @@
'dbus_test_support',
],
'sources': [
'../base/test/run_all_unittests.cc',
'bus_unittest.cc',
'end_to_end_async_unittest.cc',
'end_to_end_sync_unittest.cc',
Expand Down
8 changes: 1 addition & 7 deletions sync/sync.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -324,17 +324,11 @@
#
# TODO(akalin): Rename this to sync_unit_tests once we've moved
# everything from chrome.gyp.
#
# TODO(akalin): Make base.gyp have a test_main target that
# includes run_all_unittests.cc and the possible tcmalloc
# dependency and use that everywhere.
{
'target_name': 'sync_unit_tests_canary',
'type': 'executable',
'sources': [
'../base/test/run_all_unittests.cc',
],
'dependencies': [
'../base/base.gyp:run_all_unittests',
'sync_tests',
],

Expand Down
4 changes: 1 addition & 3 deletions third_party/cacheinvalidation/cacheinvalidation.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@
'target_name': 'cacheinvalidation_unittests',
'type': 'executable',
'sources': [
'../../base/test/run_all_unittests.cc',
'files/src/google/cacheinvalidation/test/deterministic-scheduler.cc',
'files/src/google/cacheinvalidation/test/deterministic-scheduler.h',
'files/src/google/cacheinvalidation/test/test-logger.cc',
Expand All @@ -204,8 +203,7 @@
],
'dependencies': [
'../../base/base.gyp:base',
# Needed by run_all_unittests.cc.
'../../base/base.gyp:test_support_base',
'../../base/base.gyp:run_all_unittests',
'../../testing/gmock.gyp:gmock',
'../../testing/gtest.gyp:gtest',
'cacheinvalidation',
Expand Down
5 changes: 2 additions & 3 deletions third_party/libphonenumber/libphonenumber.gyp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Copyright (c) 2012 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.

Expand Down Expand Up @@ -77,7 +77,6 @@
'target_name': 'libphonenumber_unittests',
'type': 'executable',
'sources': [
'../../base/test/run_all_unittests.cc',
'src/phonenumbers/test_metadata.cc',
'src/test/phonenumbers/asyoutypeformatter_test.cc',
'src/test/phonenumbers/phonenumbermatch_test.cc',
Expand All @@ -92,7 +91,7 @@
'../icu/icu.gyp:icui18n',
'../icu/icu.gyp:icuuc',
'../../base/base.gyp:base',
'../../base/base.gyp:test_support_base',
'../../base/base.gyp:run_all_unittests',
'../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../../testing/gmock.gyp:gmock',
'../../testing/gtest.gyp:gtest',
Expand Down

0 comments on commit c554906

Please sign in to comment.