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

Unified Diff: 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, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/tools/metrics/testdata/subdir/foo_test.mm ('k') | tools/metrics/count_ifdefs.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/metrics/browser_components_metrics.py
diff --git a/tools/metrics/browser_components_metrics.py b/tools/metrics/browser_components_metrics.py
deleted file mode 100755
index b841fd2d804aef09e0c1c73cd4e50e20ca3d1aba..0000000000000000000000000000000000000000
--- a/tools/metrics/browser_components_metrics.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-# 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.
-
-"""Generates the metrics collected weekly for the Browser Components project.
-
-See
-http://www.chromium.org/developers/design-documents/browser-components
-for details.
-"""
-
-import os
-import sys
-
-
-# This is done so that we can import checkdeps. If not invoked as
-# main, our user must ensure it is in PYTHONPATH.
-if __name__ == '__main__':
- sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'checkdeps'))
-
-
-import count_ifdefs
-import checkdeps
-import results
-
-
-# Preprocessor pattern to find OS_XYZ defines.
-PREPROCESSOR_PATTERN = 'OS_[A-Z]+'
-
-
-class BrowserComponentsMetricsGenerator(object):
- def __init__(self, checkout_root):
- self.checkout_root = checkout_root
- self.chrome_browser = os.path.join(checkout_root, 'chrome', 'browser')
-
- def CountIfdefs(self, skip_tests):
- return count_ifdefs.CountIfdefs(
- PREPROCESSOR_PATTERN, self.chrome_browser, skip_tests)
-
- def CountViolations(self, skip_tests):
- deps_checker = checkdeps.DepsChecker(self.checkout_root,
- ignore_temp_rules=True,
- skip_tests=skip_tests)
- deps_checker.results_formatter = results.CountViolationsFormatter()
- deps_checker.CheckDirectory(os.path.join('chrome', 'browser'))
- return int(deps_checker.results_formatter.GetResults())
-
-
-def main():
- generator = BrowserComponentsMetricsGenerator(
- os.path.join(os.path.dirname(__file__), '..', '..'))
-
- print "All metrics are for chrome/browser.\n"
- print "OS ifdefs, all: %d" % generator.CountIfdefs(False)
- print "OS ifdefs, -tests: %d" % generator.CountIfdefs(True)
- print ("Intended DEPS violations, all: %d" %
- generator.CountViolations(False))
- print "Intended DEPS violations, -tests: %d" % generator.CountViolations(True)
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main())
« no previous file with comments | « components/tools/metrics/testdata/subdir/foo_test.mm ('k') | tools/metrics/count_ifdefs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698