Add annotator tags for better debugging. More suppressions and other tweaks.

BUG=None
TEST=

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

git-svn-id: http://src.chromium.org/svn/trunk/src/build@117583 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
jrg@google.com 2012-01-13 02:34:21 +00:00
Родитель 850539653c
Коммит 6a48d3983a
3 изменённых файлов: 39 добавлений и 15 удалений

Просмотреть файл

@ -6,3 +6,10 @@ ReadOnlyFileUtilTest.ContentsEqual
ReadOnlyFileUtilTest.TextContentsEqual ReadOnlyFileUtilTest.TextContentsEqual
SharedMemoryTest.OpenExclusive SharedMemoryTest.OpenExclusive
StackTrace.DebugPrintBacktrace StackTrace.DebugPrintBacktrace
VerifyPathControlledByUserTest.Symlinks
PathServiceTest.Get
SharedMemoryTest.OpenClose
StringPrintfTest.StringPrintfMisc
StringPrintfTest.StringAppendfString
StringPrintfTest.StringAppendfInt
StringPrintfTest.StringPrintfBounds

Просмотреть файл

@ -49,4 +49,7 @@ WebSocketJobTest.ThrottlingSpdySpdyEnabled
X509CertificateWeakDigestTest.* X509CertificateWeakDigestTest.*
FtpDirectoryListingParserTest.* FtpDirectoryListingParserTest.*
*/X509CertificateWeakDigestTest.* */X509CertificateWeakDigestTest.*
TransportSecurityStateTest.BogusPinsHeaders
TransportSecurityStateTest.ValidPinsHeaders
HTTPSRequestTest.ResumeTest
HTTPSRequestTest.SSLSessionCacheShardTest

Просмотреть файл

@ -140,7 +140,7 @@ class Xvfb(object):
def RunTests(device, test_suite, gtest_filter, test_arguments, rebaseline, def RunTests(device, test_suite, gtest_filter, test_arguments, rebaseline,
timeout, performance_test, cleanup_test_files, tool, timeout, performance_test, cleanup_test_files, tool,
log_dump_name, fast_and_loose=False): log_dump_name, fast_and_loose=False, annotate=False):
"""Runs the tests. """Runs the tests.
Args: Args:
@ -156,6 +156,7 @@ def RunTests(device, test_suite, gtest_filter, test_arguments, rebaseline,
log_dump_name: Name of log dump file. log_dump_name: Name of log dump file.
fast_and_loose: should we go extra-fast but sacrifice stability fast_and_loose: should we go extra-fast but sacrifice stability
and/or correctness? Intended for quick cycle testing; not for bots! and/or correctness? Intended for quick cycle testing; not for bots!
annotate: should we print buildbot-style annotations?
Returns: Returns:
A TestResults object. A TestResults object.
@ -178,27 +179,38 @@ def RunTests(device, test_suite, gtest_filter, test_arguments, rebaseline,
print 'Known suites: ' + str(_TEST_SUITES) print 'Known suites: ' + str(_TEST_SUITES)
print 'Running these: ' + str(fully_qualified_test_suites) print 'Running these: ' + str(fully_qualified_test_suites)
for t in fully_qualified_test_suites: for t in fully_qualified_test_suites:
if annotate:
print '@@@BUILD_STEP Test suite %s@@@' % os.path.basename(t)
test = SingleTestRunner(device, t, gtest_filter, test_arguments, test = SingleTestRunner(device, t, gtest_filter, test_arguments,
timeout, rebaseline, performance_test, timeout, rebaseline, performance_test,
cleanup_test_files, tool, not not log_dump_name, cleanup_test_files, tool, not not log_dump_name,
fast_and_loose=fast_and_loose) fast_and_loose=fast_and_loose)
test.RunTests() test.RunTests()
results += [test.test_results] results += [test.test_results]
# Collect debug info. # Collect debug info.
debug_info_list += [test.dump_debug_info] debug_info_list += [test.dump_debug_info]
if rebaseline: if rebaseline:
test.UpdateFilter(test.test_results.failed) test.UpdateFilter(test.test_results.failed)
elif test.test_results.failed: elif test.test_results.failed:
# Stop running test if encountering failed test.
test.test_results.LogFull() test.test_results.LogFull()
break
# Zip all debug info outputs into a file named by log_dump_name. # Zip all debug info outputs into a file named by log_dump_name.
debug_info.GTestDebugInfo.ZipAndCleanResults( debug_info.GTestDebugInfo.ZipAndCleanResults(
os.path.join(run_tests_helper.CHROME_DIR, 'out', 'Release', os.path.join(run_tests_helper.CHROME_DIR, 'out', 'Release',
'debug_info_dumps'), 'debug_info_dumps'),
log_dump_name, [d for d in debug_info_list if d]) log_dump_name, [d for d in debug_info_list if d])
if annotate:
if test.test_results.timed_out:
print '@@@STEP_WARNINGS@@@'
elif test.test_results.failed:
print '@@@STEP_FAILURE@@@'
else:
print 'Step success!' # No annotation needed
return TestResults.FromTestResults(results) return TestResults.FromTestResults(results)
def _RunATestSuite(options): def _RunATestSuite(options):
"""Run a single test suite. """Run a single test suite.
@ -213,6 +225,8 @@ def _RunATestSuite(options):
0 if successful, number of failing tests otherwise. 0 if successful, number of failing tests otherwise.
""" """
attached_devices = [] attached_devices = []
buildbot_emulator = None
if options.use_emulator: if options.use_emulator:
t = TimeProfile('Emulator launch') t = TimeProfile('Emulator launch')
buildbot_emulator = emulator.Emulator(options.fast_and_loose) buildbot_emulator = emulator.Emulator(options.fast_and_loose)
@ -232,7 +246,8 @@ def _RunATestSuite(options):
options.performance_test, options.performance_test,
options.cleanup_test_files, options.tool, options.cleanup_test_files, options.tool,
options.log_dump, options.log_dump,
fast_and_loose=options.fast_and_loose) fast_and_loose=options.fast_and_loose,
annotate=options.annotate)
if buildbot_emulator: if buildbot_emulator:
buildbot_emulator.Shutdown() buildbot_emulator.Shutdown()
@ -264,19 +279,18 @@ def Dispatch(options):
if options.test_suite == 'help': if options.test_suite == 'help':
ListTestSuites() ListTestSuites()
return 0 return 0
buildbot_emulator = None
if options.use_xvfb: if options.use_xvfb:
xvfb = Xvfb() xvfb = Xvfb()
xvfb.Start() xvfb.Start()
all_test_suites = [options.test_suite] or FullyQualifiedTestSuites() if options.test_suite:
failures = 0 all_test_suites = [options.test_suite]
if options.use_emulator and options.restart_emulator_each_test:
for suite in all_test_suites:
options.test_suite = suite
failures += _RunATestSuite(options)
else: else:
all_test_suites = FullyQualifiedTestSuites()
failures = 0
for suite in all_test_suites:
options.test_suite = suite
failures += _RunATestSuite(options) failures += _RunATestSuite(options)
if options.use_xvfb: if options.use_xvfb:
@ -332,9 +346,9 @@ def main(argv):
option_parser.add_option('--repeat', dest='repeat', type='int', option_parser.add_option('--repeat', dest='repeat', type='int',
default=2, default=2,
help='Repeat count on test timeout') help='Repeat count on test timeout')
option_parser.add_option('--restart_emulator_each_test', option_parser.add_option('--annotate', default=True,
default='True', help='Print buildbot-style annotate messages '
help='Restart the emulator for each test?') 'for each test suite. Default=True')
options, args = option_parser.parse_args(argv) options, args = option_parser.parse_args(argv)
if len(args) > 1: if len(args) > 1:
print 'Unknown argument:', args[1:] print 'Unknown argument:', args[1:]