summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/common.gypi6
-rwxr-xr-xchrome/chrome.gyp3
-rwxr-xr-xtools/code_coverage/coverage_posix.py41
3 files changed, 38 insertions, 12 deletions
diff --git a/build/common.gypi b/build/common.gypi
index bd11ee4..101fd46 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -311,10 +311,10 @@
'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
},
- # Add -lgcov for executables, not for static_libraries.
- # This is a delayed conditional.
+ # Add -lgcov for executables and shared_libraries, not for
+ # static_libraries. This is a delayed conditional.
'target_conditions': [
- ['_type=="executable"', {
+ ['_type=="executable" or _type=="shared_library"', {
'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
}],
],
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 39b29d7..7a3f5b9 100755
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -6507,11 +6507,14 @@
# If you add new tests here you may need to update the croc configs.
# E.g. build/{linux|mac}/chrome_linux.croc
'dependencies': [
+ 'automated_ui_tests',
+ '../app/app.gyp:app_unittests',
'../base/base.gyp:base_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
'../printing/printing.gyp:printing_unittests',
+ 'ui_tests',
'unit_tests',
],
'actions': [
diff --git a/tools/code_coverage/coverage_posix.py b/tools/code_coverage/coverage_posix.py
index 47207eb..b6fd1da 100755
--- a/tools/code_coverage/coverage_posix.py
+++ b/tools/code_coverage/coverage_posix.py
@@ -36,6 +36,9 @@ Linux:
--strict: if a test fails, we continue happily. --strict will cause
us to die immediately.
+--trim=False: by default we trim away tests known to be problematic on
+ specific platforms. If set to false we do NOT trim out tests.
+
Strings after all options are considered tests to run. Test names
have all text before a ':' stripped to help with gyp compatibility.
For example, ../base/base.gyp:base_unittests is interpreted as a test
@@ -135,17 +138,30 @@ class Coverage(object):
if not test.endswith('.exe') and os.path.exists(test_exe):
self.tests[ind] = test_exe
- # Temporarily make Windows quick for bringup by filtering
- # out all except base_unittests. Easier than a chrome.cyp change.
- # TODO(jrg): remove this
+ def TrimTests(self):
+ """Trim specific tests for each platform."""
if self.IsWindows():
- t2 = []
+ # special case for now to be fast
+ inclusion = ['base_unittests']
+ keep = []
for test in self.tests:
- if 'base_unittests' in test:
- t2.append(test)
- self.tests = t2
-
-
+ for i in inclusion:
+ if test.endswith(i):
+ keep.append(test)
+ self.tests = keep
+ return
+ if self.IsLinux():
+ return
+ if self.IsMac():
+ exclusion = ['automated_ui_tests']
+ punted = []
+ for test in self.tests:
+ for e in exclusion:
+ if test.endswith(e):
+ punted.append(test)
+ self.tests = filter(lambda t: t not in punted, self.tests)
+ if punted:
+ logging.info('Tests trimmed out: ' + str(punted))
def ConfirmPlatformAndPaths(self):
"""Confirm OS and paths (e.g. lcov)."""
@@ -334,12 +350,19 @@ def main():
dest='src_root',
default='.',
help='Source root (only used on Windows)')
+ parser.add_option('-t',
+ '--trim',
+ dest='trim',
+ default=True,
+ help='Trim out tests? Default True.')
(options, args) = parser.parse_args()
if not options.directory:
parser.error('Directory not specified')
coverage = Coverage(options.directory, options, args)
coverage.ClearData()
coverage.FindTests()
+ if options.trim:
+ coverage.TrimTests()
coverage.BeforeRunTests()
coverage.RunTests()
coverage.AfterRunTests()