diff options
author | rnk@chromium.org <rnk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-12 14:41:00 +0000 |
---|---|---|
committer | rnk@chromium.org <rnk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-12 14:41:00 +0000 |
commit | d4674a03033bd093b078e7d38363a69c58f1fcf6 (patch) | |
tree | 73fc32bf19b4105da833be01f8a83417213cf9c4 /tools/valgrind/common.py | |
parent | 84004c5e3965a13beb46c7052bbd200cfa3707ac (diff) | |
download | chromium_src-d4674a03033bd093b078e7d38363a69c58f1fcf6.zip chromium_src-d4674a03033bd093b078e7d38363a69c58f1fcf6.tar.gz chromium_src-d4674a03033bd093b078e7d38363a69c58f1fcf6.tar.bz2 |
Allow gtest exclusion from memory tool runs based on Windows version.
I need this so that I can exclude a bunch of tests that are only failing
under DrMemory on XP.
R=timurrrr@chromium.org,bruening@chromium.org
TEST=Ran googleurl tests under drmemory with win-7 exclusions, worked.
Review URL: https://chromiumcodereview.appspot.com/9630020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126141 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/valgrind/common.py')
-rw-r--r-- | tools/valgrind/common.py | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/tools/valgrind/common.py b/tools/valgrind/common.py index 05c8999..a333fde 100644 --- a/tools/valgrind/common.py +++ b/tools/valgrind/common.py @@ -1,8 +1,9 @@ -# 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. import logging +import platform import os import signal import subprocess @@ -134,6 +135,42 @@ def IsWindows(): return sys.platform == 'cygwin' or sys.platform.startswith('win') +def WindowsVersionName(): + """Returns the name of the Windows version if it is known, or None. + + Possible return values are: xp, vista, 7, 8, or None + """ + if sys.platform == 'cygwin': + # Windows version number is hiding in system name. Looks like: + # CYGWIN_NT-6.1-WOW64 + try: + version_str = platform.uname()[0].split('-')[1] + except: + return None + elif sys.platform.startswith('win'): + # Normal Windows version string. Mine: 6.1.7601 + version_str = platform.version() + else: + return None + + parts = version_str.split('.') + try: + major = int(parts[0]) + minor = int(parts[1]) + except: + return None # Can't parse, unknown version. + + if major == 5: + return 'xp' + elif major == 6 and minor == 0: + return 'vista' + elif major == 6 and minor == 1: + return '7' + elif major == 6 and minor == 2: + return '8' # Future proof. ;) + return None + + def PlatformNames(): """Return an array of string to be used in paths for the platform (e.g. suppressions, gtest filters, ignore files etc.) @@ -144,7 +181,11 @@ def PlatformNames(): if IsMac(): return ['mac'] if IsWindows(): - return ['win32'] + names = ['win32'] + version_name = WindowsVersionName() + if version_name is not None: + names.append('win-%s' % version_name) + return names raise NotImplementedError('Unknown platform "%s".' % sys.platform) |