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

Side by Side Diff: components/tools/metrics/browser_components_metrics.py

Issue 12782019: Move browser_components_metrics.py into a subdirectory of tools/metrics/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move files to //compontents/tools/metrics Created 7 years, 8 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 | components/tools/metrics/count_ifdefs.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Generates the metrics collected weekly for the Browser Components project. 6 """Generates the metrics collected weekly for the Browser Components project.
7 7
8 See 8 See
9 http://www.chromium.org/developers/design-documents/browser-components 9 http://www.chromium.org/developers/design-documents/browser-components
10 for details. 10 for details.
11 """ 11 """
12 12
13 import os 13 import os
14 import sys 14 import sys
15 15
16 16
17 # This is done so that we can import checkdeps. If not invoked as 17 # This is done so that we can import checkdeps. If not invoked as
18 # main, our user must ensure it is in PYTHONPATH. 18 # main, our user must ensure it is in PYTHONPATH.
19 if __name__ == '__main__': 19 if __name__ == '__main__':
20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'checkdeps')) 20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..',
21 'tools', 'checkdeps'))
21 22
22 23
23 import count_ifdefs 24 import count_ifdefs
24 import checkdeps 25 import checkdeps
25 import results 26 import results
26 27
27 28
28 # Preprocessor pattern to find OS_XYZ defines. 29 # Preprocessor pattern to find OS_XYZ defines.
29 PREPROCESSOR_PATTERN = 'OS_[A-Z]+' 30 PREPROCESSOR_PATTERN = 'OS_[A-Z]+'
30 31
(...skipping 11 matching lines...) Expand all
42 deps_checker = checkdeps.DepsChecker(self.checkout_root, 43 deps_checker = checkdeps.DepsChecker(self.checkout_root,
43 ignore_temp_rules=True, 44 ignore_temp_rules=True,
44 skip_tests=skip_tests) 45 skip_tests=skip_tests)
45 deps_checker.results_formatter = results.CountViolationsFormatter() 46 deps_checker.results_formatter = results.CountViolationsFormatter()
46 deps_checker.CheckDirectory(os.path.join('chrome', 'browser')) 47 deps_checker.CheckDirectory(os.path.join('chrome', 'browser'))
47 return int(deps_checker.results_formatter.GetResults()) 48 return int(deps_checker.results_formatter.GetResults())
48 49
49 50
50 def main(): 51 def main():
51 generator = BrowserComponentsMetricsGenerator( 52 generator = BrowserComponentsMetricsGenerator(
52 os.path.join(os.path.dirname(__file__), '..', '..')) 53 os.path.join(os.path.dirname(__file__), '..', '..', '..'))
53 54
54 print "All metrics are for chrome/browser.\n" 55 print "All metrics are for chrome/browser.\n"
55 print "OS ifdefs, all: %d" % generator.CountIfdefs(False) 56 print "OS ifdefs, all: %d" % generator.CountIfdefs(False)
56 print "OS ifdefs, -tests: %d" % generator.CountIfdefs(True) 57 print "OS ifdefs, -tests: %d" % generator.CountIfdefs(True)
57 print ("Intended DEPS violations, all: %d" % 58 print ("Intended DEPS violations, all: %d" %
58 generator.CountViolations(False)) 59 generator.CountViolations(False))
59 print "Intended DEPS violations, -tests: %d" % generator.CountViolations(True) 60 print "Intended DEPS violations, -tests: %d" % generator.CountViolations(True)
60 return 0 61 return 0
61 62
62 63
63 if __name__ == '__main__': 64 if __name__ == '__main__':
64 sys.exit(main()) 65 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | components/tools/metrics/count_ifdefs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698