diff options
author | 2022-10-28 17:29:09 +0100 | |
---|---|---|
committer | 2022-11-08 11:51:36 +0000 | |
commit | af3b31d9a87b106763e4f2583042a8663d26b7e8 (patch) | |
tree | 35b4a20ea8843daa0c60b86d8505f6606a351898 /test | |
parent | 5eff6b3307dde2feff372decd0bc7e7e80e340da (diff) |
Add run-parameter test metadata to ART run-tests.
For now, use these run parameters to determine whether to safely
ignore a test's `run.py` Python script while regenerating ART test
files.
Test: art/test/utils/regen-test-files
Bug: 147812905
Change-Id: I76c1460b6df3adea60167a21b653436ecaf34389
Diffstat (limited to 'test')
-rw-r--r-- | test/099-vmdebug/test-metadata.json | 5 | ||||
-rw-r--r-- | test/143-string-value/test-metadata.json | 5 | ||||
-rwxr-xr-x | test/utils/regen-test-files | 26 |
3 files changed, 30 insertions, 6 deletions
diff --git a/test/099-vmdebug/test-metadata.json b/test/099-vmdebug/test-metadata.json new file mode 100644 index 0000000000..2d1dd457fd --- /dev/null +++ b/test/099-vmdebug/test-metadata.json @@ -0,0 +1,5 @@ +{ + "run-param": { + "default-run": true + } +} diff --git a/test/143-string-value/test-metadata.json b/test/143-string-value/test-metadata.json new file mode 100644 index 0000000000..2d1dd457fd --- /dev/null +++ b/test/143-string-value/test-metadata.json @@ -0,0 +1,5 @@ +{ + "run-param": { + "default-run": true + } +} diff --git a/test/utils/regen-test-files b/test/utils/regen-test-files index ab8ba67e9b..db6ba3d489 100755 --- a/test/utils/regen-test-files +++ b/test/utils/regen-test-files @@ -396,19 +396,33 @@ class Generator: # All other tests are considered buildable. return True - # Is (successfully) running `run_test` supported? - # TODO(b/147812905): Add run-time support for more tests. - def is_runnable(self, run_test): - run_test_path = os.path.join(self.art_test_dir, run_test) + # Can the run script of `run_test` be safely ignored? + def can_ignore_run_script(self, run_test): # Unconditionally consider some identified tests that have a # (not-yet-handled) custom `run` script as runnable. + # # TODO(rpl): Get rid of this exception mechanism by supporting # these tests' `run` scripts properly. if run_test in runnable_test_exceptions: return True - # Skip tests with a custom `run` script. + # Check whether there are test metadata with run parameters + # enabling us to safely ignore the run script. + metadata = self.get_test_metadata(run_test) + run_param = metadata.get("run-param", {}) + if run_param.get("default-run", ""): + return True + return False + + # Is (successfully) running `run_test` supported? + # TODO(b/147812905): Add run-time support for more tests. + def is_runnable(self, run_test): + run_test_path = os.path.join(self.art_test_dir, run_test) + + # Skip tests with non-default run rules, unless these run rules + # can be safely ignored. if os.path.isfile(os.path.join(run_test_path, "run.py")): - return False + if not self.can_ignore_run_script(run_test): + return False # Skip tests known to fail. if run_test in known_failing_tests: return False |