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

Unified Diff: chrome/tools/build/list_test_installer_sources.py

Issue 935913002: Make changes to mini_installer test files trigger tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better Created 5 years, 10 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: chrome/tools/build/list_test_installer_sources.py
diff --git a/chrome/tools/build/list_test_installer_sources.py b/chrome/tools/build/list_test_installer_sources.py
new file mode 100644
index 0000000000000000000000000000000000000000..783122a7eaccacf3191a0f384fb09668a0837bf8
--- /dev/null
+++ b/chrome/tools/build/list_test_installer_sources.py
@@ -0,0 +1,50 @@
+# Copyright 2015 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 pipes
+import sys
+
+def GetSources(dirname):
+ """Returns a quoted list of source files.
+
+ Args:
+ dirname: A (possibly relative) path to the directory holding sources in
+ question.
+
+ Returns:
+ A list of filenames. Items in the list will be quoted if needed.
+ """
+ sources = []
+ for root, dirs, files in os.walk(dirname):
+ for file in files:
+ if file != 'OWNERS' and os.path.splitext(file)[1] != '.pyc':
+ sources.append(pipes.quote(os.path.join(root, file).replace('\\', '/')))
+ return sources
+
+
+def DoMain(args):
+ """Returns a space-separated list of source files.
+
+ Args:
+ args: An agument list, the first item of which is the directory to scan.
+
+ Returns:
+ A string containing a space-separated list of source files.
+ """
+ return ' '.join(GetSources(args[0]))
+
+
+def main(args):
+ """Prints the sources in a directory.
+
+ Args:
+ args: An argument list, the first item of which is the directory to scan.
+ """
+ sys.stdout.write('\n'.join(GetSources(args[0])))
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))

Powered by Google App Engine
This is Rietveld 408576698