Skip to content

Commit

Permalink
[ot] scripts/opentitan: pyot: fix @{}/ not being managed for test opt…
Browse files Browse the repository at this point in the history
…ions.

Also fix missing path separator after @{}/ replacement.

Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
  • Loading branch information
rivos-eblot committed Aug 31, 2023
1 parent cb44ca6 commit 3abb8b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/opentitan/pyot.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,11 @@ def replace(smo: Match) -> str:
if name not in self._dirs:
tmp_dir = mkdtemp(prefix='qemu_ot_dir_')
self._dirs[name] = tmp_dir
return self._dirs[name]
else:
tmp_dir = self._dirs[name]
if not tmp_dir.endswith(sep):
tmp_dir = f'{tmp_dir}{sep}'
return tmp_dir
nvalue = re_sub(r'\@\{(\w*)\}/', replace, value)
if nvalue != value:
self._log.debug('Interpolate %s with %s', value, nvalue)
Expand Down Expand Up @@ -1160,6 +1164,7 @@ def _build_test_args(self, test_name: str) \
if opts and not isinstance(opts, list):
raise ValueError('fInvalid QEMU options for {test_name}')
opts = self.flatten([opt.split(' ') for opt in opts])
opts = [self._qfm.interpolate_dirs(opt, test_name) for opt in opts]
timeout = int(kwargs.get('timeout', DEFAULT_TIMEOUT))
return Namespace(**kwargs), opts or [], timeout

Expand Down

0 comments on commit 3abb8b4

Please sign in to comment.