summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Herouart <rherouart@google.com>2024-02-16 04:55:51 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2024-02-16 04:55:51 +0000
commitebb6fd6d1c73dd948df3c026328d9faac2615702 (patch)
tree2abd4a04dfb64b04bbee3b9cd74399a14df6389a
parent5d40debeb396aff484699e9deeb62b15a6ef1f6f (diff)
parentb4b96ca8a303a852188d2d5d992b52ef9fcc9022 (diff)
downloadaosp-ebb6fd6d1c73dd948df3c026328d9faac2615702.tar.gz
scripts: Skip Non-Host Tests on device build am: b4b96ca8a3
Original change: https://android-review.googlesource.com/c/trusty/vendor/google/aosp/+/2907877 Change-Id: I25ccba208529dfb34079441d084a7fabb1deb298 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rwxr-xr-xscripts/build.py5
-rwxr-xr-xscripts/run_tests.py8
2 files changed, 10 insertions, 3 deletions
diff --git a/scripts/build.py b/scripts/build.py
index bf7a6c4..bb2b63f 100755
--- a/scripts/build.py
+++ b/scripts/build.py
@@ -509,7 +509,7 @@ def create_test_map(args, build_config, projects):
with ZipFile(zip_path, 'a', compression=ZIP_DEFLATED) as zipf:
zipf.writestr(project_name + "-test-map.json", json.dumps(test_map, indent=4))
-def main(default_config=None):
+def main(default_config=None, emulator=True):
top = os.path.abspath(os.path.join(script_dir, "../../../../.."))
os.chdir(top)
@@ -610,7 +610,8 @@ def main(default_config=None):
run_disabled_tests=args.run_disabled_tests,
test_filters=test_filters,
verbose=args.verbose,
- debug_on_error=args.debug_on_error)
+ debug_on_error=args.debug_on_error,
+ emulator=emulator)
test_result.print_results()
if test_result.failed_projects:
diff --git a/scripts/run_tests.py b/scripts/run_tests.py
index 1a90ad0..332949a 100755
--- a/scripts/run_tests.py
+++ b/scripts/run_tests.py
@@ -257,7 +257,8 @@ def run_tests(
run_disabled_tests: bool = False,
test_filters: Optional[list[re.Pattern]] = None,
verbose: bool=False,
- debug_on_error: bool= False
+ debug_on_error: bool= False,
+ emulator:bool=True
) -> TestResults:
"""Run tests for a project.
@@ -318,6 +319,9 @@ def run_tests(
test_start_time = time.time()
ignore_tests = False
+ if not emulator and not isinstance(test, TrustyHostTest):
+ return 0
+
match test:
case TrustyHostTest():
# append nice and expand path to command
@@ -426,6 +430,7 @@ def test_projects(
test_filters: Optional[list[re.Pattern]] = None,
verbose: bool=False,
debug_on_error: bool= False,
+ emulator: bool=True
) -> MultiProjectTestResults:
"""Run tests for multiple project.
@@ -457,6 +462,7 @@ def test_projects(
test_filters=test_filters,
verbose=verbose,
debug_on_error=debug_on_error,
+ emulator=emulator
))
return MultiProjectTestResults(results)