summaryrefslogtreecommitdiff
path: root/tools/releasetools/test_utils.py
diff options
context:
space:
mode:
author Daniel Norman <danielnorman@google.com> 2022-03-02 16:12:08 -0800
committer Daniel Norman <danielnorman@google.com> 2022-03-08 16:37:14 -0800
commit2b0b9ca1b78b57ad6a42e4cf9735b422b6c6573e (patch)
tree9c7f9d8714e93f490d2db76571b964a052734ad8 /tools/releasetools/test_utils.py
parentff35cbd110f4a438cafd329a8f3e385d52920dd2 (diff)
Moves merge scripts into a new merge folder.
This will be used in the following change to split merge_target_files into a collection of smaller more-focused scripts. Bug: 221858722 Test: m otatools; Use to create merged builds Change-Id: Ie01dac81c5f9f28f1e0fe037259eabd2478e60b6
Diffstat (limited to 'tools/releasetools/test_utils.py')
-rwxr-xr-xtools/releasetools/test_utils.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/releasetools/test_utils.py b/tools/releasetools/test_utils.py
index 808b392015..e30d2b98e3 100755
--- a/tools/releasetools/test_utils.py
+++ b/tools/releasetools/test_utils.py
@@ -33,6 +33,8 @@ import common
# Some test runner doesn't like outputs from stderr.
logging.basicConfig(stream=sys.stdout)
+ALLOWED_TEST_SUBDIRS = ('merge',)
+
# Use ANDROID_BUILD_TOP as an indicator to tell if the needed tools (e.g.
# avbtool, mke2fs) are available while running the tests, unless
# FORCE_RUN_RELEASETOOLS is set to '1'. Not having the required vars means we
@@ -244,9 +246,12 @@ if __name__ == '__main__':
# os walk and load them manually.
test_modules = []
base_path = os.path.dirname(os.path.realpath(__file__))
+ test_dirs = [base_path] + [
+ os.path.join(base_path, subdir) for subdir in ALLOWED_TEST_SUBDIRS
+ ]
for dirpath, _, files in os.walk(base_path):
for fn in files:
- if dirpath == base_path and re.match('test_.*\\.py$', fn):
+ if dirpath in test_dirs and re.match('test_.*\\.py$', fn):
test_modules.append(fn[:-3])
test_suite = unittest.TestLoader().loadTestsFromNames(test_modules)