From a489a7313b368b3db23bb51b38bc09d44afe1532 Mon Sep 17 00:00:00 2001 From: Chun-Chieh Li Date: Thu, 12 Sep 2019 10:37:16 +0800 Subject: [PATCH] Convert TZ target name to test spec platform name 1. All TZ targets should have name pattern: PLATFORM_[PSA_]S/NS, where: (1) 'PLATFORM' for test spec platform name (2) 'PSA' is optional to distinguish PSA/non-PSA targets, especially when both PSA/non-PSA targets are supported (3) 'S'/'NS' for secure/non-secure targets 2. Secure target may participate in Greentea, so its name is also truncated here. --- tools/test_api.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/test_api.py b/tools/test_api.py index 3cad6f7b815..1fd5fe83b2e 100644 --- a/tools/test_api.py +++ b/tools/test_api.py @@ -2272,9 +2272,20 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name, def test_spec_from_test_builds(test_builds): for build in test_builds: - if Target.get_target(test_builds[build]['platform']).is_PSA_non_secure_target: + # Convert TZ target name to test spec platform name + # + # 1. All TZ targets should have name pattern: PLATFORM_[PSA_]S/NS, where: + # (1) 'PLATFORM' for test spec platform name + # (2) 'PSA' is optional to distinguish PSA/non-PSA targets, especially when + # both PSA/non-PSA targets are supported + # (3) 'S'/'NS' for secure/non-secure targets + # 2. Secure target may participate in Greentea, so its name is also truncated here. + if Target.get_target(test_builds[build]['platform']).is_TrustZone_target: if test_builds[build]['platform'].endswith('_NS'): test_builds[build]['platform'] = test_builds[build]['platform'][:-3] + elif test_builds[build]['platform'].endswith('_S'): + test_builds[build]['platform'] = test_builds[build]['platform'][:-2] + if test_builds[build]['platform'].endswith('_PSA'): test_builds[build]['platform'] = test_builds[build]['platform'][:-4] return {