Skip to content

Commit cd88e72

Browse files
urutvaPatater
authored andcommitted
psa: Add a script to validate PSA targets
Add a script to parse `targets.json` to identify PSA targets and ensure mandatory parameters are configured correctly for all PSA targets. Signed-off-by: Devaraj Ranganna <[email protected]>
1 parent c9c593f commit cd88e72

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env python
2+
"""
3+
Copyright (c) 2019-2020 ARM Limited. All rights reserved.
4+
5+
SPDX-License-Identifier: Apache-2.0
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
"""
19+
20+
21+
import pytest
22+
23+
from tools.targets import TARGETS
24+
25+
def test_psa_target_attributes():
26+
psa_targets = (tar for tar in TARGETS
27+
if tar.is_TFM_target)
28+
29+
for tar in psa_targets:
30+
msg = "tfm_target_name attribute cannot be empty"
31+
assert(tar.tfm_target_name != ""), msg
32+
msg = "tfm_bootloader_supported attribute cannot be empty"
33+
assert(tar.tfm_bootloader_supported != ""), msg
34+
msg = "tfm_default_toolchain attribute cannot be empty"
35+
assert(tar.tfm_default_toolchain != ""), msg
36+
msg = "tfm_supported_toolchains attribute cannot be empty"
37+
assert(tar.tfm_supported_toolchains != ""), msg
38+
msg = "delivery_dir attribute cannot be empty"
39+
assert(tar.tfm_delivery_dir != ""), msg
40+

0 commit comments

Comments
 (0)