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

Unified Diff: grit/tool/build_unittest.py

Issue 997813004: Allow depfile to depend on a Stamp file instead of the default first input. (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: Add unittest + nit in comment Created 5 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
« grit/tool/build.py ('K') | « grit/tool/build.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/tool/build_unittest.py
diff --git a/grit/tool/build_unittest.py b/grit/tool/build_unittest.py
index d35778334218e3723e9f43c19afc43f1ad5c7249..ac2be107a32abe9a42720f847296034802b15cda 100644
--- a/grit/tool/build_unittest.py
+++ b/grit/tool/build_unittest.py
@@ -301,6 +301,31 @@ class BuildUnittest(unittest.TestCase):
self.assertTrue(abs(second_mtime - UNCHANGED) > 5)
self.assertTrue(abs(third_mtime - UNCHANGED) < 5)
+ def testGenerateDepFileWithDependOnStamp(self):
+ output_dir = tempfile.mkdtemp()
+ builder = build.RcBuilder()
+ class DummyOpts(object):
+ def __init__(self):
+ self.input = util.PathFromRoot('grit/testdata/substitute.grd')
+ self.verbose = False
+ self.extra_verbose = False
+ expected_dep_file = os.path.join(output_dir, 'substitute.grd.stamp.d')
+ builder.Run(DummyOpts(), ['-o', output_dir,
+ '--depdir', output_dir,
+ '--depfile', expected_dep_file,
+ '--depend-on-stamp'])
+
+ self.failUnless(os.path.isfile(expected_dep_file))
+ with open(expected_dep_file) as f:
+ line = f.readline()
+ (dep_output_file, deps_string) = line.split(': ')
+ deps = deps_string.split(' ')
+
+ self.failUnlessEqual("substitute.grd.stamp.d", dep_output_file)
+ self.failUnlessEqual(1, len(deps))
+ self.failUnlessEqual(deps[0],
+ util.PathFromRoot('grit/testdata/substitute.xmb'))
+
if __name__ == '__main__':
unittest.main()
« grit/tool/build.py ('K') | « grit/tool/build.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698