Skip to content

Commit ef19ade

Browse files
author
Oren Cohen
committed
Revert back to direct calls to python
1 parent e8165fd commit ef19ade

File tree

1 file changed

+28
-23
lines changed

1 file changed

+28
-23
lines changed

tools/psa/release.py

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
subprocess_output = None
3737
subprocess_err = None
3838

39+
MAKE_PY_LOCATTION = os.path.join(ROOT, 'tools', 'make.py')
40+
TEST_PY_LOCATTION = os.path.join(ROOT, 'tools', 'test.py')
3941
TFM_MBED_APP = os.path.join(ROOT, 'tools', 'psa', 'tfm', 'mbed_app.json')
4042
MBED_PSA_TESTS = '*psa-spm*,*psa-crypto_access_control'
4143
TFM_TESTS = {
@@ -97,7 +99,7 @@ def _get_default_image_build_command(target, toolchain, profile):
9799
:return: Build command in a list form.
98100
"""
99101
cmd = [
100-
'mbed', 'compile',
102+
sys.executable, MAKE_PY_LOCATTION,
101103
'-t', toolchain,
102104
'-m', target,
103105
'--profile', profile,
@@ -154,30 +156,26 @@ def build_tests_mbed_spm_platform(target, toolchain, profile):
154156
MBED_PSA_TESTS, target, toolchain, profile))
155157

156158
subprocess.check_call([
157-
'mbed', 'test', '--compile',
159+
sys.executable, TEST_PY_LOCATTION,
160+
'--greentea',
161+
'--profile', profile,
158162
'-t', toolchain,
159163
'-m', target,
160-
'--profile', profile,
161164
'--source', ROOT,
162165
'--build', os.path.join(ROOT, 'BUILD', 'tests', target),
163-
'-n', MBED_PSA_TESTS],
164-
stdout=subprocess_output, stderr=subprocess_err)
166+
'--test-spec', os.path.join(ROOT, 'BUILD', 'tests',
167+
target, 'test_spec.json'),
168+
'--build-data', os.path.join(ROOT, 'BUILD', 'tests',
169+
target, 'build_data.json'),
170+
'-n', MBED_PSA_TESTS
171+
], stdout=subprocess_output, stderr=subprocess_err)
172+
165173

166174
logger.info(
167175
"Finished building tests images({}) for {} successfully".format(
168176
MBED_PSA_TESTS, target))
169177

170178

171-
def _tfm_test_defines(test):
172-
"""
173-
Creates a define list to enable test partitions on TF-M.
174-
175-
:param test: Test name.
176-
:return: List of defines with a leading -D.
177-
"""
178-
return ['-D{}'.format(define) for define in TFM_TESTS[test]]
179-
180-
181179
def build_tests_tfm_platform(target, toolchain, profile):
182180
"""
183181
Builds Secure images for TF-M target.
@@ -190,15 +188,22 @@ def build_tests_tfm_platform(target, toolchain, profile):
190188
logger.info(
191189
"Building tests image({}) for {} using {} with {} profile".format(
192190
test, target, toolchain, profile))
191+
192+
test_defines = ['-D{}'.format(define) for define in TFM_TESTS[test]]
193193
subprocess.check_call([
194-
'mbed', 'test', '--compile',
195-
'-t', toolchain,
196-
'-m', target,
197-
'--profile', profile,
198-
'--source', ROOT,
199-
'--build', os.path.join(ROOT, 'BUILD', 'tests', target),
200-
'-n', test,
201-
'--app-config', TFM_MBED_APP] + _tfm_test_defines(test),
194+
sys.executable, TEST_PY_LOCATTION,
195+
'--greentea',
196+
'--profile', profile,
197+
'-t', toolchain,
198+
'-m', target,
199+
'--source', ROOT,
200+
'--build', os.path.join(ROOT, 'BUILD', 'tests', target),
201+
'--test-spec', os.path.join(ROOT, 'BUILD', 'tests',
202+
target, 'test_spec.json'),
203+
'--build-data', os.path.join(ROOT, 'BUILD', 'tests',
204+
target, 'build_data.json'),
205+
'-n', test,
206+
'--app-config', TFM_MBED_APP] + test_defines,
202207
stdout=subprocess_output, stderr=subprocess_err)
203208

204209
logger.info(

0 commit comments

Comments
 (0)