summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Herouart <rherouart@google.com>2024-02-16 04:56:33 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2024-02-16 04:56:33 +0000
commitd6772762d0e8f99d82c32a8b36588a48d47c9ca9 (patch)
treee2ef706e7ca83c6e3592e7170fc6be21c2d48758
parent017cbd1203ad9cfbdae6e2837e1205d124e063d7 (diff)
parent85a7a4d1158401be5de5113c2766b4be70105e56 (diff)
downloadaosp-d6772762d0e8f99d82c32a8b36588a48d47c9ca9.tar.gz
scripts: Add test commands am: 85a7a4d115
Original change: https://android-review.googlesource.com/c/trusty/vendor/google/aosp/+/2936299 Change-Id: Ia44e103674d7387aa27672ca4ee849e19a1b4374 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rwxr-xr-xscripts/build.py16
-rwxr-xr-xscripts/trusty_build_config.py5
2 files changed, 20 insertions, 1 deletions
diff --git a/scripts/build.py b/scripts/build.py
index 15a3bf6..230b729 100755
--- a/scripts/build.py
+++ b/scripts/build.py
@@ -519,12 +519,26 @@ def create_test_map(args, build_config, projects):
print(port)
sys.exit(-1)
+ test_map["commands"] = []
+ commands_list = filter(lambda t: t.name.startswith("android-test:"), project.tests)
+ for command in commands_list:
+ command_name = re.sub("android-test:", "", command.name)
+ command_obj = { "command_name": command_name,
+ "needs": []}
+
+ if hasattr(command, 'need') and hasattr(command.need, 'flags'):
+ command_obj["needs"] = list(command.need.flags)
+ if hasattr(command, 'port_type'):
+ command_obj["type"] = str(command.port_type)
+ command_obj["command"] = command.command
+
+ test_map["commands"].append(command_obj)
+
project_buildroot = os.path.join(args.build_root, "build-" + project_name)
zip_path = os.path.join(project_buildroot, "trusty_test_package.zip")
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, emulator=True):
top = os.path.abspath(os.path.join(script_dir, "../../../../.."))
os.chdir(top)
diff --git a/scripts/trusty_build_config.py b/scripts/trusty_build_config.py
index 2432e36..0270dcf 100755
--- a/scripts/trusty_build_config.py
+++ b/scripts/trusty_build_config.py
@@ -125,7 +125,12 @@ class TrustyAndroidTest(TrustyTest):
super().__init__(nameprefix + name, cmd, enabled, port_type)
self.shell_command = command
self.need = need
+ if not self.need:
+ self.need = TrustyPortTestFlags()
+ def needs(self, **need):
+ self.need.set(**need)
+ return self
class TrustyPortTest(TrustyTest):
"""Stores a trusty port name for a test to run."""