Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: tools/asan/asan_test.py

Issue 7922010: Implement the EmbeddedTool class in valgrind_test.py to allow running tools that are embedded int... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/asan/base_unittests.gtest-asan.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 # asan_test.py
7
8 """Wrapper for running the test under AddressSanitizer."""
9
10 import datetime
11 import logging
12 import os
13 import re
14
15 import common
16 import path_utils
17 import suppressions
18
19
20 class ASanWrapper(object):
21 def __init__(self, supp_files):
22 self._timeout = 1200
23
24 def PutEnvAndLog(self, env_name, env_value):
25 """Sets the env var |env_name| to |env_value| and writes to logging.info.
26 """
27 os.putenv(env_name, env_value)
28 logging.info('export %s=%s', env_name, env_value)
29
30 def Execute(self):
31 """Executes the app to be tested."""
32 logging.info('starting execution...')
33 proc = self._args
34 self.PutEnvAndLog('G_SLICE', 'always-malloc')
35 self.PutEnvAndLog('NSS_DISABLE_ARENA_FREE_LIST', '1')
36 self.PutEnvAndLog('NSS_DISABLE_UNLOAD', '1')
37 self.PutEnvAndLog('GTEST_DEATH_TEST_USE_FORK', '1')
38 return common.RunSubprocess(proc, self._timeout)
39
40 def Main(self, args):
41 self._args = args
42 start = datetime.datetime.now()
43 retcode = -1
44 retcode = self.Execute()
45 end = datetime.datetime.now()
46 seconds = (end - start).seconds
47 hours = seconds / 3600
48 seconds %= 3600
49 minutes = seconds / 60
50 seconds %= 60
51 logging.info('elapsed time: %02d:%02d:%02d', hours, minutes, seconds)
52 logging.info('For more information on the AddressSanitizer bot see '
53 'http://dev.chromium.org/developers/testing/'
54 'addresssanitizer')
55 return retcode
56
57
58 def RunTool(args, supp_files, module):
59 tool = ASanWrapper(supp_files)
60 return tool.Main(args[1:])
OLDNEW
« no previous file with comments | « no previous file | tools/asan/base_unittests.gtest-asan.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698