Skip to content

Commit a489a73

Browse files
committed
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.
1 parent 2cd10fc commit a489a73

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tools/test_api.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2272,9 +2272,20 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
22722272

22732273
def test_spec_from_test_builds(test_builds):
22742274
for build in test_builds:
2275-
if Target.get_target(test_builds[build]['platform']).is_PSA_non_secure_target:
2275+
# Convert TZ target name to test spec platform name
2276+
#
2277+
# 1. All TZ targets should have name pattern: PLATFORM_[PSA_]S/NS, where:
2278+
# (1) 'PLATFORM' for test spec platform name
2279+
# (2) 'PSA' is optional to distinguish PSA/non-PSA targets, especially when
2280+
# both PSA/non-PSA targets are supported
2281+
# (3) 'S'/'NS' for secure/non-secure targets
2282+
# 2. Secure target may participate in Greentea, so its name is also truncated here.
2283+
if Target.get_target(test_builds[build]['platform']).is_TrustZone_target:
22762284
if test_builds[build]['platform'].endswith('_NS'):
22772285
test_builds[build]['platform'] = test_builds[build]['platform'][:-3]
2286+
elif test_builds[build]['platform'].endswith('_S'):
2287+
test_builds[build]['platform'] = test_builds[build]['platform'][:-2]
2288+
22782289
if test_builds[build]['platform'].endswith('_PSA'):
22792290
test_builds[build]['platform'] = test_builds[build]['platform'][:-4]
22802291
return {

0 commit comments

Comments
 (0)