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

Unified Diff: tools/isolate/data/isolate/child.py

Issue 10019014: Convert isolate.py to exclusively use .isolate files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not read as binary Created 8 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 side-by-side diff with in-line comments
Download patch
Index: tools/isolate/data/isolate/child.py
diff --git a/tools/isolate/data/isolate/child.py b/tools/isolate/data/isolate/child.py
new file mode 100755
index 0000000000000000000000000000000000000000..b3f1854e33ad0ef9ce1f3fd8df94b3c520f8a391
--- /dev/null
+++ b/tools/isolate/data/isolate/child.py
@@ -0,0 +1,42 @@
+#!/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.
+
+import os
+import sys
+
+
+def main():
+ print 'child: verify the test data files were mapped properly'
+ files = sorted(os.listdir('files1'))
+ tree = {
+ 'test_file1.txt': 'Foo\n',
+ 'test_file2.txt': 'Bar\n',
+ }
+
+ # For now, ignore .svn directory, which happens to be there with --mode=trace
+ # from a svn checkout. The file shouldn't be there when --mode=run is used.
+ # TODO(maruel): Differentiate between the two modes and detect .svn
+ # directories in --mode=run.
+ if '.svn' in files:
+ files.remove('.svn')
+
+ if files != sorted(tree):
+ print '%s != %s' % (files, sorted(tree))
+ return 2
+ for k, v in tree.iteritems():
+ content = open(os.path.join('files1', k), 'rb').read()
+ if v != content:
+ print '%s: %r != %r' % (k, v, content)
+ return 3
+
+ if sys.argv[1] == '--ok':
+ return 0
+ elif sys.argv[1] == '--fail':
+ return 1
+ return 4
+
+
+if __name__ == '__main__':
+ sys.exit(main())
« no previous file with comments | « third_party/cacheinvalidation/cacheinvalidation_unittests.isolate ('k') | tools/isolate/data/isolate/fail.isolate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698