Changeset f1e8fd4 in rtems-tools


Ignore:
Timestamp:
Oct 21, 2017, 5:59:14 AM (19 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
b1d2db9
Parents:
cec5878
git-author:
Chris Johns <chrisj@…> (10/21/17 05:59:14)
git-committer:
Chris Johns <chrisj@…> (10/21/17 06:04:53)
Message:

tester: Add pretest and posttest target commands with @ARCH@, @BSP@ and @EXE@ substitution.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester/rt/config.py

    rcec5878 rf1e8fd4  
    116116        return regex
    117117
    118     def _target_command(self, command):
     118    def _target_command(self, command, bsp_arch = None, bsp = None, exe = None):
    119119        if self.defined('target_%s_command' % (command)):
    120120            cmd = self.expand('%%{target_%s_command}' % (command)).strip()
     121            if bsp_arch is not None and '@ARCH@' in cmd:
     122                cmd = cmd.replace('@ARCH@', bsp_arch)
     123            if bsp is not None and '@BSP@' in cmd:
     124                cmd = cmd.replace('@BSP@', bsp)
     125            if exe is not None and '@EXE@' in cmd:
     126                cmd = cmd.replace('@EXE@', exe)
    121127            if len(cmd) > 0:
    122128                rs_proc = execute.capture_execution()
     
    245251                    self.report.start(index, total, exe, exe, bsp_arch, bsp)
    246252                    if self.index == 1:
    247                         self._target_command('on')
     253                        self._target_command('on', bsp_arch, bsp, exe)
     254                    self._target_command('pretest', bsp_arch, bsp, exe)
    248255                finally:
    249256                    self._unlock()
     
    258265                self._lock()
    259266                if self.index == self.total:
    260                     self._target_command('off')
     267                    self._target_command('off', bsp_arch, bsp, exe)
     268                self._target_command('posttest', bsp_arch, bsp, exe)
    261269                try:
    262270                    status = self.report.end(exe, self.output)
     
    264272                    if status == 'timeout':
    265273                        if self.index == self.total:
    266                             self._target_command('off')
     274                            self._target_command('off', bsp_arch, bsp, exe)
    267275                        else:
    268                             self._target_command('reset')
     276                            self._target_command('reset', bsp_arch, bsp, exe)
    269277                    self.process = None
    270278                    self.output = None
Note: See TracChangeset for help on using the changeset viewer.