Index: sky/tools/skypy/find_tests.py |
diff --git a/sky/tools/skypy/find_tests.py b/sky/tools/skypy/find_tests.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7ea9367c120f1c8ac50c64f4c24a591c34402c02 |
--- /dev/null |
+++ b/sky/tools/skypy/find_tests.py |
@@ -0,0 +1,20 @@ |
+# Copyright 2014 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 |
+ |
+ |
+IGNORED_DIRECTORIES = ['resources'] |
+TEST_EXTENSIONS = ['sky'] |
+ |
+ |
+def find_tests(directory): |
+ for root, dirs, files in os.walk(directory): |
+ for file_name in files: |
+ extension = os.path.splitext(file_name)[1] |
+ if extension.lstrip('.') in TEST_EXTENSIONS: |
+ yield os.path.join(root, file_name) |
+ for ignored_directory in IGNORED_DIRECTORIES: |
+ if ignored_directory in dirs: |
+ dirs.remove(ignored_directory) |