summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Roland Levillain <rpl@google.com> 2024-06-20 13:57:41 +0100
committer Roland Levillain <rpl@google.com> 2024-06-23 15:03:59 +0000
commitd6c0adcd6736392440d0bec2a06a18f10fd657cf (patch)
tree8db6309ba92ccb3ab3132a4bd63e13e8affeb8d2
parentc4eeff33359159954575d9e25f98bc62c73d0eff (diff)
Ensure tests are both or neither in CTS and MCTS in `regen-test-files`.
For now, there is no good reason to have ART run-tests have a different test suite membership w.r.t. CTS and MCTS. Flag: TEST_ONLY Test: Run `test/utils/regen-test-files` and verify it is a no-op Bug: 147814778 Change-Id: Ic26ca9997013f8a77b4d863e053eb01059c5dc22
-rwxr-xr-xtest/utils/regen-test-files23
1 files changed, 16 insertions, 7 deletions
diff --git a/test/utils/regen-test-files b/test/utils/regen-test-files
index e9ee88a33d..b6e9170ffc 100755
--- a/test/utils/regen-test-files
+++ b/test/utils/regen-test-files
@@ -580,7 +580,17 @@ class Generator:
# Optional test metadata (JSON file).
metadata = self.get_test_metadata(run_test)
- is_cts_test = "cts" in metadata.get("test_suites", [])
+ test_suites = metadata.get("test_suites", [])
+ is_cts_test = "cts" in test_suites
+ is_mcts_test = "mcts-art" in test_suites
+
+ # For now we make it mandatory for an ART CTS test to be an ART
+ # MCTS test and vice versa.
+ if is_cts_test != is_mcts_test:
+ (present, absent) = ("mts", "mcts-art") if is_cts_test else ("mcts-art", "mts")
+ logging.error(f"Inconsistent test suites state in metadata for ART run-test `{run_test}`: " +
+ f"`test_suites` contains `{present}` but not `{absent}`")
+ sys.exit(1)
run_test_module_name = ART_RUN_TEST_MODULE_NAME_PREFIX + run_test
@@ -597,11 +607,10 @@ class Generator:
# Define the `test_suites` property, if test suites are present in
# the test's metadata.
- test_suites_list = metadata.get("test_suites")
test_suites_prop = ""
- if test_suites_list:
+ if test_suites:
test_suites_joined = """,
- """.join([f"\"{s}\"" for s in test_suites_list])
+ """.join([f"\"{s}\"" for s in test_suites])
test_suites_prop = f"""\
test_suites: [
@@ -620,9 +629,9 @@ class Generator:
# against, if needed.
sdk_version_prop = ""
if is_cts_test:
- # Have CTS test modules use the test API (`test_current`) so
- # that they do not depend on the framework private platform API
- # (`private`), which is the default.
+ # Have CTS and MCTS test modules use the test API
+ # (`test_current`) so that they do not depend on the framework
+ # private platform API (`private`), which is the default.
sdk_version_prop = """
sdk_version: "test_current","""