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

Unified Diff: build/android/gyp/util/md5_check_test.py

Issue 1356873003: CallAndRecordIfStale(): Add knownledge of output_files, depfiles, stamp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@incremental-script-dep
Patch Set: add assert and remove map() Created 5 years, 3 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 | « build/android/gyp/util/md5_check.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/util/md5_check_test.py
diff --git a/build/android/gyp/util/md5_check_test.py b/build/android/gyp/util/md5_check_test.py
old mode 100644
new mode 100755
index 4f89fc2be83267733c4bd979a65f4243b057156a..8df8054c2b31b3e00b6a1e307844f87998003877
--- a/build/android/gyp/util/md5_check_test.py
+++ b/build/android/gyp/util/md5_check_test.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
# Copyright 2013 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.
@@ -26,7 +27,15 @@ class TestMd5Check(unittest.TestCase):
record_path = tempfile.NamedTemporaryFile(suffix='.stamp')
- def CheckCallAndRecord(should_call, message, force=False):
+ def CheckCallAndRecord(should_call, message, force=False,
+ outputs_specified=False, outputs_missing=False):
+ output_paths = None
+ if outputs_specified:
+ output_file1 = tempfile.NamedTemporaryFile()
+ if outputs_missing:
+ output_file1.close() # Gets deleted on close().
+ output_paths = [output_file1.name]
+
self.called = False
def MarkCalled():
self.called = True
@@ -35,11 +44,16 @@ class TestMd5Check(unittest.TestCase):
record_path=record_path.name,
input_paths=input_files,
input_strings=input_strings,
+ output_paths=output_paths,
force=force)
self.failUnlessEqual(should_call, self.called, message)
CheckCallAndRecord(True, 'should call when record doesn\'t exist')
CheckCallAndRecord(False, 'should not call when nothing changed')
+ CheckCallAndRecord(False, 'should not call when nothing changed2',
+ outputs_specified=True, outputs_missing=False)
+ CheckCallAndRecord(True, 'should call when output missing',
+ outputs_specified=True, outputs_missing=True)
CheckCallAndRecord(True, force=True, message='should call when forced')
input_file1.write('some more input')
« no previous file with comments | « build/android/gyp/util/md5_check.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698