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

Unified Diff: tools/checkdeps/checkdeps_test.py

Issue 10832062: Add ability to format errors as a list of temp-allow rules to paste (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 5 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 | « tools/checkdeps/checkdeps.py ('k') | tools/checkdeps/cpp_checker.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/checkdeps/checkdeps_test.py
diff --git a/tools/checkdeps/checkdeps_test.py b/tools/checkdeps/checkdeps_test.py
index e650baf6d24b90befb72b5835dc5b52354320bfc..0729a8f3a4032e29f30fbf1e35096fe24d409848 100755
--- a/tools/checkdeps/checkdeps_test.py
+++ b/tools/checkdeps/checkdeps_test.py
@@ -11,6 +11,7 @@ import unittest
import checkdeps
+import results
class CheckDepsTest(unittest.TestCase):
@@ -19,9 +20,10 @@ class CheckDepsTest(unittest.TestCase):
self.deps_checker = checkdeps.DepsChecker(being_tested=True)
def testRegularCheckDepsRun(self):
- problems = self.deps_checker.CheckDirectory(
+ self.deps_checker.CheckDirectory(
os.path.join(self.deps_checker.base_directory,
'tools/checkdeps/testdata'))
+ problems = self.deps_checker.results_formatter.GetResults()
self.failUnlessEqual(3, len(problems))
def VerifySubstringsInProblems(key_path, substrings_in_sequence):
@@ -51,6 +53,17 @@ class CheckDepsTest(unittest.TestCase):
'Because of no rule applying',
'Because of no rule applying'])
+ def testTempRulesGenerator(self):
+ self.deps_checker.results_formatter = results.TemporaryRulesFormatter()
+ self.deps_checker.CheckDirectory(
+ os.path.join(self.deps_checker.base_directory,
+ 'tools/checkdeps/testdata/allowed'))
+ temp_rules = self.deps_checker.results_formatter.GetResults()
+ expected = [u' "!third_party/explicitly_disallowed/bad.h",',
+ u' "!third_party/no_rule/bad.h",',
+ u' "!tools/checkdeps/testdata/disallowed/bad.h",']
+ self.failUnlessEqual(expected, temp_rules)
+
def testCheckAddedIncludesAllGood(self):
problems = self.deps_checker.CheckAddedCppIncludes(
[['tools/checkdeps/testdata/allowed/test.cc',
« no previous file with comments | « tools/checkdeps/checkdeps.py ('k') | tools/checkdeps/cpp_checker.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698