[test] Add output for investigating win-asan failures

Also fix asan environment for testing on windows.

TBR=sergiyb@chromium.org

Bug: chromium:726584
Change-Id: Ic9e6afa714f4757ad1b0f2ebfa742e742e1c04b9
Reviewed-on: https://chromium-review.googlesource.com/720811
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48583}
This commit is contained in:
Michael Achenbach 2017-10-16 11:29:50 +02:00 committed by Commit Bot
parent 4b42656dd6
commit 089dd7d244
4 changed files with 15 additions and 8 deletions

View File

@ -47,10 +47,10 @@ class CcTestSuite(testsuite.TestSuite):
shell = os.path.abspath(os.path.join(context.shell_dir, self.shell()))
if utils.IsWindows():
shell += ".exe"
output = commands.Execute(context.command_prefix +
[shell, "--list"] +
context.extra_flags)
cmd = context.command_prefix + [shell, "--list"] + context.extra_flags
output = commands.Execute(cmd)
if output.exit_code != 0:
print ' '.join(cmd)
print output.stdout
print output.stderr
return []

View File

@ -144,6 +144,9 @@ def RunProcess(verbose, timeout, args, additional_env, **rest):
)
# TODO(machenbach): Instead of passing args around, we should introduce an
# immutable Command class (that just represents the command with all flags and
# is pretty-printable) and a member method for running such a command.
def Execute(args, verbose=False, timeout=None, env=None):
args = [ c for c in args if c != "" ]
return RunProcess(verbose, timeout, args, env or {})

View File

@ -318,12 +318,16 @@ class GoogleTestSuite(TestSuite):
output = None
for i in xrange(3): # Try 3 times in case of errors.
output = commands.Execute(context.command_prefix +
[shell, "--gtest_list_tests"] +
context.extra_flags)
cmd = (
context.command_prefix +
[shell, "--gtest_list_tests"] +
context.extra_flags
)
output = commands.Execute(cmd)
if output.exit_code == 0:
break
print "Test executable failed to list the tests (try %d).\n\nStdout:" % i
print ' '.join(cmd)
print output.stdout
print "\nStderr:"
print output.stderr

View File

@ -665,8 +665,8 @@ class StandardTestRunner(base_runner.BaseTestRunner):
if options.asan:
asan_options = [symbolizer, "allow_user_segv_handler=1"]
if not utils.GuessOS() == 'macos':
# LSAN is not available on mac.
if not utils.GuessOS() in ['macos', 'windows']:
# LSAN is not available on mac and windows.
asan_options.append('detect_leaks=1')
os.environ['ASAN_OPTIONS'] = ":".join(asan_options)