summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authormad@google.com <mad@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 23:42:48 +0000
committermad@google.com <mad@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 23:42:48 +0000
commit7d7bc5f16ce0bdf019892c75b2fcc22c5e429f63 (patch)
treed64b5f584293e880d0405009e161f65a3b535e45 /tools
parent3468eee317be11d670fcb47b38a7417cd9be0698 (diff)
downloadchromium_src-7d7bc5f16ce0bdf019892c75b2fcc22c5e429f63.zip
chromium_src-7d7bc5f16ce0bdf019892c75b2fcc22c5e429f63.tar.gz
chromium_src-7d7bc5f16ce0bdf019892c75b2fcc22c5e429f63.tar.bz2
Fix code coverage for Windows.
BUG=0 TEST=Look at the code coverage dashboards... :-) Review URL: http://codereview.chromium.org/3077019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/code_coverage/coverage_posix.py8
-rwxr-xr-xtools/code_coverage/croc.py16
2 files changed, 16 insertions, 8 deletions
diff --git a/tools/code_coverage/coverage_posix.py b/tools/code_coverage/coverage_posix.py
index 5218ced..d28eca2 100755
--- a/tools/code_coverage/coverage_posix.py
+++ b/tools/code_coverage/coverage_posix.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Copyright (c) 2010 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.
@@ -734,9 +734,9 @@ class Coverage(object):
if start_dir.endswith('chrome'):
print 'coverage_posix.py: doing a "cd .." to accomodate Linux/make PWD'
os.chdir('..')
- elif start_dir.endswith('build'):
- print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD'
- os.chdir('src')
+ if start_dir.endswith('build'):
+ print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD'
+ os.chdir('src')
command = [self.mcov,
'--directory',
diff --git a/tools/code_coverage/croc.py b/tools/code_coverage/croc.py
index 1ea21ff..6999bf5 100755
--- a/tools/code_coverage/croc.py
+++ b/tools/code_coverage/croc.py
@@ -1,7 +1,7 @@
-#!/usr/bin/python2.4
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
+#!/usr/bin/env python
+# Copyright (c) 2010 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.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -33,6 +33,7 @@
import optparse
import os
+import platform
import re
import sys
import croc_html
@@ -218,6 +219,10 @@ class Coverage(object):
# Change path separators
filename = filename.replace('\\', '/')
+ # Windows doesn't care about case sensitivity.
+ if platform.system() in ['Windows', 'Microsoft']:
+ filename = filename.lower()
+
# If path is relative, make it absolute
# TODO: Perhaps we should default to relative instead, and only understand
# absolute to be files starting with '\', '/', or '[A-Za-z]:'?
@@ -226,6 +231,9 @@ class Coverage(object):
# Replace alternate roots
for root, alt_name in self.root_dirs:
+ # Windows doesn't care about case sensitivity.
+ if platform.system() in ['Windows', 'Microsoft']:
+ root = root.lower()
filename = re.sub('^' + re.escape(root) + '(?=(/|$))',
alt_name, filename)
return filename