summaryrefslogtreecommitdiffstats
path: root/tools/heapcheck
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-29 17:25:34 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-29 17:25:34 +0000
commitcb155a802bdc49cfafea1c41e0f0a92168f1da09 (patch)
treebf0fae4855c7f4458d8e959455b9d12d6cd54d9d /tools/heapcheck
parent9bec23957253b83955c4096903ad6293d1c6e1bb (diff)
downloadchromium_src-cb155a802bdc49cfafea1c41e0f0a92168f1da09.zip
chromium_src-cb155a802bdc49cfafea1c41e0f0a92168f1da09.tar.gz
chromium_src-cb155a802bdc49cfafea1c41e0f0a92168f1da09.tar.bz2
Fix python scripts in src/tools/
Make sure that: - shebang is only present for executable files - shebang is #!/usr/bin/env python - __main__ is only present for executable files - file's executable bit is coherent Also fix EOF LF to be only one. TBR=timurrrr@chromium.org BUG=105108 TEST= Review URL: http://codereview.chromium.org/8678023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/heapcheck')
-rwxr-xr-xtools/heapcheck/chrome_tests.py16
-rw-r--r--tools/heapcheck/heapcheck_test.py3
-rwxr-xr-x[-rw-r--r--]tools/heapcheck/suppressions.py7
3 files changed, 10 insertions, 16 deletions
diff --git a/tools/heapcheck/chrome_tests.py b/tools/heapcheck/chrome_tests.py
index e4cadd2..f01231d 100755
--- a/tools/heapcheck/chrome_tests.py
+++ b/tools/heapcheck/chrome_tests.py
@@ -1,5 +1,4 @@
-#!/usr/bin/python
-
+#!/usr/bin/env python
# Copyright (c) 2011 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.
@@ -417,7 +416,11 @@ class ChromeTests(object):
# summary list for long, but will be useful for someone reviewing this bot.
return ret
-def _main(_):
+
+def main():
+ if not sys.platform.startswith('linux'):
+ logging.error("Heap checking works only on Linux at the moment.")
+ return 1
parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> "
"[-t <test> ...]")
parser.disable_interspersed_args()
@@ -457,9 +460,4 @@ def _main(_):
if __name__ == "__main__":
- if sys.platform.startswith('linux'):
- ret = _main(sys.argv)
- else:
- logging.error("Heap checking works only on Linux at the moment.")
- ret = 1
- sys.exit(ret)
+ sys.exit(main())
diff --git a/tools/heapcheck/heapcheck_test.py b/tools/heapcheck/heapcheck_test.py
index 6342589..c80ce0d 100644
--- a/tools/heapcheck/heapcheck_test.py
+++ b/tools/heapcheck/heapcheck_test.py
@@ -1,10 +1,7 @@
-#!/usr/bin/python
# Copyright (c) 2011 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.
-# heapcheck_test.py
-
"""Wrapper for running the test under heapchecker and analyzing the output."""
import datetime
diff --git a/tools/heapcheck/suppressions.py b/tools/heapcheck/suppressions.py
index 91c5238..506caa6 100644..100755
--- a/tools/heapcheck/suppressions.py
+++ b/tools/heapcheck/suppressions.py
@@ -1,10 +1,8 @@
-#!/usr/bin/python
-# Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+#!/usr/bin/env python
+# Copyright (c) 2011 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.
-# suppressions.py
-
"""Valgrind-style suppressions for heapchecker reports.
Suppressions are defined as follows:
@@ -167,5 +165,6 @@ def MatchTest():
assert not re_chars.Match(['foobar'])
print 'PASS'
+
if __name__ == '__main__':
MatchTest()