Changeset 0737b46 in rtems-tools


Ignore:
Timestamp:
Oct 5, 2017, 3:21:01 AM (20 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
2ae9b6d
Parents:
3c7cd05
Message:

tester: Add a target reset regular expression to detect a reset.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester/rt/config.py

    r3c7cd05 r0737b46  
    3737import datetime
    3838import os
     39import re
    3940import threading
    4041
     
    7475        self.kill_on_end = False
    7576        self.test_label = None
     77        self.target_reset_regx = None
    7678
    7779    def __del__(self):
     
    258260
    259261    def run(self):
     262        if self.defined('target_reset_regex'):
     263            try:
     264                regex = self.expand('%{target_reset_regex}')
     265                self.target_reset_regx = re.compile(regex, re.MULTILINE)
     266            except:
     267                msg = 'invalid target reset regex: %s' % (regex)
     268                raise error.general(msg)
    260269        self.load(self.name)
    261270
     
    265274        ok_to_kill = '*** TEST STATE: USER_INPUT' in text or \
    266275                     '*** TEST STATE: BENCHMARK' in text
    267         reset_target = False
    268276        if ok_to_kill:
    269277            reset_target = True
     278        else:
     279            reset_target = False
     280        if self.test_started and self.target_reset_regx is not None:
     281            if self.target_reset_regx.match(text):
     282                self.capture_console('target reset detected')
     283                ok_to_kill = True
    270284        if self.kill_on_end:
    271285            if self.test_label is None:
Note: See TracChangeset for help on using the changeset viewer.