diff options
author | Jeremy Johnson <jeremy.johnson@arm.com> | 2022-07-12 16:42:29 +0100 |
---|---|---|
committer | Jeremy Johnson <jeremy.johnson@arm.com> | 2022-07-14 11:37:50 +0100 |
commit | 88588624e513cead1b977d94087733157ed5df3b (patch) | |
tree | 43326cd58401cebd7a55980199a6bb127ab685b2 /scripts | |
parent | 0ecfa37738d56cbb50af584e9bf077052094f460 (diff) | |
download | reference_model-88588624e513cead1b977d94087733157ed5df3b.tar.gz |
Add profile to all created conformance tests.
Add supported profiles for each test in convert2conformance and
tosa_verif_conformance_generator.
Enable filtering of profile tests on running in tosa_verif_run_tests.
Reorganize arguments in conformance_generator to have more important
ones first.
Change-Id: Ie6e5b68727adb3c39b04aa482dd6433788f7bcc9
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/convert2conformance/convert2conformance.py | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/scripts/convert2conformance/convert2conformance.py b/scripts/convert2conformance/convert2conformance.py index aa41ff1..06726ba 100755 --- a/scripts/convert2conformance/convert2conformance.py +++ b/scripts/convert2conformance/convert2conformance.py @@ -30,6 +30,8 @@ NAME_DESC_FILENAME = "desc.json" NAME_CONFORMANCE_RESULT_PREFIX = "Conformance-" NAME_REFMODEL_RUN_RESULT_SUFFIX = ".runner.tosa_refmodel_sut_run.npy" +PROFILES_LIST = ["tosa-bi", "tosa-mi"] + def parse_args(argv): """Parse the arguments.""" @@ -69,9 +71,18 @@ def parse_args(argv): help="Framework schema needed to convert framework models", ) parser.add_argument( + "--profile", + dest="profile", + choices=PROFILES_LIST, + action="append", + required=True, + help="Profiles this test is suitable for. May be repeated", + ) + parser.add_argument( "-v", "--verbose", dest="verbose", action="store_true", help="Verbose operation" ) args = parser.parse_args(argv) + return args @@ -138,7 +149,11 @@ def convert_numpy_file(n_file: Path, output: Path, outname: Optional[str] = None def update_desc_json( - test_dir: Path, test_desc, output_dir: Optional[Path] = None, create_result=True + test_dir: Path, + test_desc, + output_dir: Optional[Path] = None, + create_result=True, + profiles=None, ): """Update the desc.json format for conformance and optionally create result.""" ofm_files = [] @@ -171,6 +186,13 @@ def update_desc_json( if not test_desc["expected_failure"]: # Output expected result file for conformance if expected pass test_desc["expected_result_file"] = cfm_files + + # Add supported profiles + if profiles is None: + # Assume base profile + profiles = [PROFILES_LIST[0]] + test_desc["profile"] = profiles + return test_desc @@ -289,7 +311,11 @@ def main(argv=None): # Update desc.json and convert result files to JSON test_desc = update_desc_json( - desc_filename.parent, test_desc, output_dir=args.output_dir, create_result=True + desc_filename.parent, + test_desc, + output_dir=args.output_dir, + create_result=True, + profiles=args.profile, ) if not test_desc: # Error from conversion/update |