Skip to content

Commit 3abb8b4

Browse files
committed
[ot] scripts/opentitan: pyot: fix @{}/ not being managed for test options.
Also fix missing path separator after @{}/ replacement. Signed-off-by: Emmanuel Blot <[email protected]>
1 parent cb44ca6 commit 3abb8b4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/opentitan/pyot.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,11 @@ def replace(smo: Match) -> str:
426426
if name not in self._dirs:
427427
tmp_dir = mkdtemp(prefix='qemu_ot_dir_')
428428
self._dirs[name] = tmp_dir
429-
return self._dirs[name]
429+
else:
430+
tmp_dir = self._dirs[name]
431+
if not tmp_dir.endswith(sep):
432+
tmp_dir = f'{tmp_dir}{sep}'
433+
return tmp_dir
430434
nvalue = re_sub(r'\@\{(\w*)\}/', replace, value)
431435
if nvalue != value:
432436
self._log.debug('Interpolate %s with %s', value, nvalue)
@@ -1160,6 +1164,7 @@ def _build_test_args(self, test_name: str) \
11601164
if opts and not isinstance(opts, list):
11611165
raise ValueError('fInvalid QEMU options for {test_name}')
11621166
opts = self.flatten([opt.split(' ') for opt in opts])
1167+
opts = [self._qfm.interpolate_dirs(opt, test_name) for opt in opts]
11631168
timeout = int(kwargs.get('timeout', DEFAULT_TIMEOUT))
11641169
return Namespace(**kwargs), opts or [], timeout
11651170

0 commit comments

Comments
 (0)